]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC: r319350, r320620, r321385, r321490, r321588, r321948
authormarius <marius@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 6 Aug 2017 16:07:34 +0000 (16:07 +0000)
committermarius <marius@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 6 Aug 2017 16:07:34 +0000 (16:07 +0000)
commita6763dbd675e8310d963b627a358ab1ffbb23dbd
treef7133923adcbfe2e500f4e4d688d27f6ba1b491a
parentd10881af4f1aeb60dc33d1a60316d82f034f9a96
MFC: r319350, r320620, r321385, r321490, r321588, r321948

o Use SDHCI_CAN_DRIVE_TYPE_{A,C,D} to check for driver type support in
  SDHCI_CAPABILITIES2 instead of SDHCI_CTRL2_DRIVER_TYPE_{A,C,D} which
  are meant for setting the driver type in SDHCI_HOST_CONTROL2.

o Correct a typo in the comment part of r320577 (MFCed to stable/10 in
  r320899).

o Add support for eMMC HS200 and HS400 bus speed modes at 200 MHz to
  sdhci(4), mmc(4) and mmcsd(4).

  On the system where the addition of DDR52 support increased the read
  throughput to ~80 MB/s (from ~45 MB/s at high speed), HS200 yields
  ~154 MB/s and HS400 ~187 MB/s, i. e. performance now has more than
  quadrupled compared to pre-r315598 (pre-r318495 in stable/10).

  However, in fact this isn't a feature-only change; there are boards
  based on Intel Bay Trail where DDR52 is problematic and the suggested
  workaround is to use HS200 mode instead. So far exact details are
  unknown, however, i. e. whether that's due to a defect in these SoCs
  or on the boards.

  Moreover, due to the above changes requiring to be aware of possible
  MMC siblings in the fast path of mmc(4), corresponding information
  now is cached in mmc_softc. As a side-effect, mmc_calculate_clock(),
  now longer will trigger a panic in low memory situations and all of
  mmc(4) operate on the same set of child devices.

o Fix a bug in the failure reporting of mmcsd_delete() that could lead
  to a panic.

o Fix 2 bugs on resume, one in mmcsd(4) that could lead to a panic and
  another one in mmc(4) that could lead to devices no longer working.

o Fix a memory leak in mmcsd_ioctl() in case copyin(9) fails. [1]

o Fix missing variable initialization in mmc_switch_status(). [2]

o Fix R1_SWITCH_ERROR detection in mmc_switch_status(). [3]

o Handle the case of device_add_child(9) failing, for example due to
  a memory shortage, gracefully in mmc(4) and sdhci(4), including not
  leaking memory for the instance variables in case of mmc(4), also
  fixing [4].

o Correctly use the size of a pointer rather than that of a pointer to
  a pointer (this bug was present in head r321385 only, i. e. not in a
  stable branch). [5]

o Handle the case of an unknown SD CSD version in mmc_decode_csd_sd()
  gracefully instead of calling panic(9).

o Again, check and handle the return values of some additional function
  calls in mmc(4) instead of assuming that everything went right or mark
  non-fatal errors by casting the return value to void.

o Correct a typo in the Linux IOCTL compatibility; it should have been
  MMC_IOC_MULTI_CMD rather than MMC_IOC_CMD_MULTI.

o Now that we are reaching ever faster speeds (more improvement in this
  regard is to be expected when adding ADMA support to sdhci(4)), apply
  a few micro-optimizations to mmc(4), mmcsd(4) and sdhci(4).

o Correct confusing and error prone mix-ups between "br" or "bridge" in
  mmc(4) and mmcsd(4) where - according to the terminology outlined in
  comments of bridge.h and mmcbr_if.m around since their addition in
  r163516 - the bus is meant and used instead.

o Remove comment lines from bridge.h incorrectly suggesting that there
  would be a MMC bridge base class driver.

o Update comments in bridge.h regarding the star topology of SD and SDIO;
  since version 3.00 of the SDHCI specification, for eSD and eSDIO bus
  topologies are actually possible in form of so called "shared buses"
  (in some subcontext later on renamed to "embedded" buses).

Reported by: Coverity
CID: 1372612 [1], 1372624 [2], 1372594 [3], 1007069 [4],
1378432 [5]

git-svn-id: svn://svn.freebsd.org/base/stable/10@322120 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
16 files changed:
sys/dev/mmc/bridge.h
sys/dev/mmc/mmc.c
sys/dev/mmc/mmc_ioctl.h
sys/dev/mmc/mmc_private.h
sys/dev/mmc/mmc_subr.c
sys/dev/mmc/mmc_subr.h
sys/dev/mmc/mmcbr_if.m
sys/dev/mmc/mmcbrvar.h
sys/dev/mmc/mmcbus_if.m
sys/dev/mmc/mmcreg.h
sys/dev/mmc/mmcsd.c
sys/dev/sdhci/sdhci.c
sys/dev/sdhci/sdhci.h
sys/dev/sdhci/sdhci_acpi.c
sys/dev/sdhci/sdhci_if.m
sys/dev/sdhci/sdhci_pci.c