git: A step to correctly handling command timeouts in the MMC layer.

Imre Vadasz ivadasz at crater.dragonflybsd.org
Tue May 23 11:08:18 PDT 2017


commit 85ccd3136bf34097cf6ba4633f903d954230107f
Author: Imre Vadász <imre at vdsz.com>
Date:   Sun May 21 16:02:20 2017 +0200

    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)

Summary of changes:
 sys/bus/mmc/Makefile                    |   2 +-
 sys/bus/mmc/bridge.h                    |   1 +
 sys/bus/mmc/mmc.c                       | 326 ++++++++++++--------------------
 sys/bus/mmc/{mmcvar.h => mmc_private.h} |  54 ++----
 sys/bus/mmc/mmc_subr.c                  | 251 ++++++++++++++++++++++++
 sys/bus/mmc/{mmcvar.h => mmc_subr.h}    |  56 ++----
 sys/bus/mmc/mmcbrvar.h                  |   8 +-
 sys/bus/mmc/mmcreg.h                    |  69 ++++++-
 sys/bus/mmc/mmcvar.h                    |   4 +-
 sys/conf/files                          |   1 +
 sys/dev/disk/mmcsd/mmcsd.c              |   1 +
 sys/dev/disk/sdhci/sdhci.c              |  10 +-
 sys/dev/disk/sdhci/sdhci.h              |   3 +
 sys/dev/disk/sdhci/sdhci_acpi.c         |  40 +++-
 sys/dev/disk/sdhci/sdhci_pci.c          |  21 ++
 15 files changed, 542 insertions(+), 305 deletions(-)
 copy sys/bus/mmc/{mmcvar.h => mmc_private.h} (71%)
 create mode 100644 sys/bus/mmc/mmc_subr.c
 copy sys/bus/mmc/{mmcvar.h => mmc_subr.h} (71%)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/85ccd3136bf34097cf6ba4633f903d954230107f


-- 
DragonFly BSD source repository



More information about the Commits mailing list