A step to correctly handling command timeouts in the MMC layer.
commit85ccd3136bf34097cf6ba4633f903d954230107f
authorImre Vadász <imre@vdsz.com>
Sun, 21 May 2017 14:02:20 +0000 (21 16:02 +0200)
committerImre Vadász <imre@vdsz.com>
Mon, 22 May 2017 19:58:37 +0000 (22 21:58 +0200)
tree90ddf9a8471e92538b34bd706fa41ab6830bd2ed
parent4d3ae5900ccbcc3c6787707334347ba4e6da7e5e
A step to correctly handling command timeouts in the MMC layer.

    - Now that properly issuing CMD6 is crucial (so data isn't written to
      the wrong partition for example), make a step into the direction of
      correctly handling the timeout for these commands in the MMC layer.
      Also, do a SEND_STATUS when CMD6 is invoked with an R1B response as
      recommended by relevant specifications. However, quite some work is
      left to be done in this regard; all other R1B-type commands done by
      the MMC layer also should be followed by a SEND_STATUS (CMD13), the
      erase timeout calculations/handling as documented in specifications
      are entirely ignored so far, the MMC layer doesn't provide timeouts
      applicable up to the bridge drivers and at least sdhci(4) currently
      is hardcoding 1 s as timeout for all command types unconditionally.
      Let alone already available return codes often not being checked in
      the MMC layer ...

    - For devices following the eMMC specification v4.41 or later, year 0
      is 2013 rather than 1997; so correct this for assembling the device
      ID string properly.

* This omits all the parts specific to eMMC "partitions" from the FreeBSD
  change.

* Add the Intel sdhci controller ids to sdhci_pci.c to set the
  SDHCI_QUIRK_WAIT_WHILE_BUSY quirk there.
  This also disables DMA on apollo lake sdhci, while there and whitelists
  ADMA2 on Bay Trail and Braswell sdhci controllers.

Taken-From: FreeBSD (svn r315430)
15 files changed:
sys/bus/mmc/Makefile
sys/bus/mmc/bridge.h
sys/bus/mmc/mmc.c
sys/bus/mmc/mmc_private.h [copied from sys/bus/mmc/mmcvar.h with 71% similarity]
sys/bus/mmc/mmc_subr.c [new file with mode: 0644]
sys/bus/mmc/mmc_subr.h [copied from sys/bus/mmc/mmcvar.h with 71% similarity]
sys/bus/mmc/mmcbrvar.h
sys/bus/mmc/mmcreg.h
sys/bus/mmc/mmcvar.h
sys/conf/files
sys/dev/disk/mmcsd/mmcsd.c
sys/dev/disk/sdhci/sdhci.c
sys/dev/disk/sdhci/sdhci.h
sys/dev/disk/sdhci/sdhci_acpi.c
sys/dev/disk/sdhci/sdhci_pci.c