1. 17 12月, 2018 25 次提交
  2. 06 12月, 2018 1 次提交
    • A
      mmc: sdhci: fix the timeout check window for clock and reset · b704441e
      Alek Du 提交于
      We observed some premature timeouts on a virtualization platform, the log
      is like this:
      
      case 1:
      [159525.255629] mmc1: Internal clock never stabilised.
      [159525.255818] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
      [159525.256049] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
      ...
      [159525.257205] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x0000fa03
      From the clock control register dump, we are pretty sure the clock was
      stablized.
      
      case 2:
      [  914.550127] mmc1: Reset 0x2 never completed.
      [  914.550321] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
      [  914.550608] mmc1: sdhci: Sys addr:  0x00000010 | Version:  0x00001002
      
      After checking the sdhci code, we found the timeout check actually has a
      little window that the CPU can be scheduled out and when it comes back,
      the original time set or check is not valid.
      
      Fixes: 5a436cc0 ("mmc: sdhci: Optimize delay loops")
      Cc: stable@vger.kernel.org      # v4.12+
      Signed-off-by: NAlek Du <alek.du@intel.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      b704441e
  3. 05 12月, 2018 1 次提交
  4. 04 12月, 2018 1 次提交
    • A
      MMC: OMAP: fix broken MMC on OMAP15XX/OMAP5910/OMAP310 · e8cde625
      Aaro Koskinen 提交于
      Since v2.6.22 or so there has been reports [1] about OMAP MMC being
      broken on OMAP15XX based hardware (OMAP5910 and OMAP310). The breakage
      seems to have been caused by commit 46a6730e ("mmc-omap: Fix
      omap to use MMC_POWER_ON") that changed clock enabling to be done
      on MMC_POWER_ON. This can happen multiple times in a row, and on 15XX
      the hardware doesn't seem to like it and the MMC just stops responding.
      Fix by memorizing the power mode and do the init only when necessary.
      
      Before the patch (on Palm TE):
      
      	mmc0: new SD card at address b368
      	mmcblk0: mmc0:b368 SDC   977 MiB
      	mmci-omap mmci-omap.0: command timeout (CMD18)
      	mmci-omap mmci-omap.0: command timeout (CMD13)
      	mmci-omap mmci-omap.0: command timeout (CMD13)
      	mmci-omap mmci-omap.0: command timeout (CMD12) [x 6]
      	mmci-omap mmci-omap.0: command timeout (CMD13) [x 6]
      	mmcblk0: error -110 requesting status
      	mmci-omap mmci-omap.0: command timeout (CMD8)
      	mmci-omap mmci-omap.0: command timeout (CMD18)
      	mmci-omap mmci-omap.0: command timeout (CMD13)
      	mmci-omap mmci-omap.0: command timeout (CMD13)
      	mmci-omap mmci-omap.0: command timeout (CMD12) [x 6]
      	mmci-omap mmci-omap.0: command timeout (CMD13) [x 6]
      	mmcblk0: error -110 requesting status
      	mmcblk0: recovery failed!
      	print_req_error: I/O error, dev mmcblk0, sector 0
      	Buffer I/O error on dev mmcblk0, logical block 0, async page read
      	 mmcblk0: unable to read partition table
      
      After the patch:
      
      	mmc0: new SD card at address b368
      	mmcblk0: mmc0:b368 SDC   977 MiB
      	 mmcblk0: p1
      
      The patch is based on a fix and analysis done by Ladislav Michl.
      
      Tested on OMAP15XX/OMAP310 (Palm TE), OMAP1710 (Nokia 770)
      and OMAP2420 (Nokia N810).
      
      [1] https://marc.info/?t=123175197000003&r=1&w=2
      
      Fixes: 46a6730e ("mmc-omap: Fix omap to use MMC_POWER_ON")
      Reported-by: NLadislav Michl <ladis@linux-mips.org>
      Reported-by: NAndrzej Zaborowski <balrogg@gmail.com>
      Tested-by: NLadislav Michl <ladis@linux-mips.org>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NAaro Koskinen <aaro.koskinen@iki.fi>
      Cc: stable@vger.kernel.org
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      e8cde625
  5. 19 11月, 2018 2 次提交
    • A
      mmc: sdhci-pci: Workaround GLK firmware failing to restore the tuning value · 5305ec6a
      Adrian Hunter 提交于
      GLK firmware can indicate that the tuning value will be restored after
      runtime suspend, but not actually do that. Add a workaround that detects
      such cases, and lets the driver do re-tuning instead.
      Reported-by: NAnisse Astier <anisse@astier.eu>
      Tested-by: NAnisse Astier <anisse@astier.eu>
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      5305ec6a
    • R
      mmc: sdhci-pci: Try "cd" for card-detect lookup before using NULL · cdcefe6b
      Rajat Jain 提交于
      Problem:
      
      The card detect IRQ does not work with modern BIOS (that want
      to use _DSD to provide the card detect GPIO to the driver).
      
      Details:
      
      The mmc core provides the mmc_gpiod_request_cd() API to let host drivers
      request the gpio descriptor for the "card detect" pin.
      This pin is specified in the ACPI for the SDHC device:
      
       * Either as a resource using _CRS. This is a method used by legacy BIOS.
         (The driver needs to tell which resource index).
      
       * Or as a named property ("cd-gpios"/"cd-gpio") in _DSD (which internally
         points to an entry in _CRS). This way, the driver can lookup using a
         string. This is what modern BIOS prefer to use.
      
      This API finally results in a call to the following code:
      
      struct gpio_desc *acpi_find_gpio(..., const char *con_id,...)
      {
      ...
         /* Lookup gpio (using "<con_id>-gpio") in the _DSD */
      ...
         if (!acpi_can_fallback_to_crs(adev, con_id))
                return ERR_PTR(-ENOENT);
      ...
         /* Falling back to _CRS is allowed, Lookup gpio in the _CRS */
      ...
      }
      
      Note that this means that if the ACPI has _DSD properties, the kernel
      will never use _CRS for the lookup (Because acpi_can_fallback_to_crs()
      will always be false for any device hat has _DSD entries).
      
      The SDHCI driver is thus currently broken on a modern BIOS, even if
      BIOS provides both _CRS (for index based lookup) and _DSD entries (for
      string based lookup). Ironically, none of these will be used for the
      lookup currently because:
      
      * Since the con_id is NULL, acpi_find_gpio() does not find a matching
        entry in DSDT. (The _DSDT entry has the property name = "cd-gpios")
      
      * Because ACPI contains DSDT entries, thus acpi_can_fallback_to_crs()
        returns false (because device properties have been populated from
        _DSD), thus the _CRS is never used for the lookup.
      
      Fix:
      
      Try "cd" for lookup in the _DSD before falling back to using NULL so
      as to try looking up in the _CRS.
      
      I've tested this patch successfully with both Legacy BIOS (that
      provide only _CRS method) as well as modern BIOS (that provide both
      _CRS and _DSD). Also the use of "cd" appears to be fairly consistent
      across other users of this API (other MMC host controller drivers).
      
      Link: https://lkml.org/lkml/2018/9/25/1113Signed-off-by: NRajat Jain <rajatja@google.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Fixes: f10e4bf6 ("gpio: acpi: Even more tighten up ACPI GPIO lookups")
      Cc: stable@vger.kernel.org
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      cdcefe6b
  6. 15 10月, 2018 10 次提交