1. 12 10月, 2019 1 次提交
    • R
      mmc: sdhci-of-esdhc: set DMA snooping based on DMA coherence · 7ed2867c
      Russell King 提交于
      commit 121bd08b029e03404c451bb237729cdff76eafed upstream.
      
      We must not unconditionally set the DMA snoop bit; if the DMA API is
      assuming that the device is not DMA coherent, and the device snoops the
      CPU caches, the device can see stale cache lines brought in by
      speculative prefetch.
      
      This leads to the device seeing stale data, potentially resulting in
      corrupted data transfers.  Commonly, this results in a descriptor fetch
      error such as:
      
      mmc0: ADMA error
      mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
      mmc0: sdhci: Sys addr:  0x00000000 | Version:  0x00002202
      mmc0: sdhci: Blk size:  0x00000008 | Blk cnt:  0x00000001
      mmc0: sdhci: Argument:  0x00000000 | Trn mode: 0x00000013
      mmc0: sdhci: Present:   0x01f50008 | Host ctl: 0x00000038
      mmc0: sdhci: Power:     0x00000003 | Blk gap:  0x00000000
      mmc0: sdhci: Wake-up:   0x00000000 | Clock:    0x000040d8
      mmc0: sdhci: Timeout:   0x00000003 | Int stat: 0x00000001
      mmc0: sdhci: Int enab:  0x037f108f | Sig enab: 0x037f108b
      mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00002202
      mmc0: sdhci: Caps:      0x35fa0000 | Caps_1:   0x0000af00
      mmc0: sdhci: Cmd:       0x0000333a | Max curr: 0x00000000
      mmc0: sdhci: Resp[0]:   0x00000920 | Resp[1]:  0x001d8a33
      mmc0: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x3f400e00
      mmc0: sdhci: Host ctl2: 0x00000000
      mmc0: sdhci: ADMA Err:  0x00000009 | ADMA Ptr: 0x000000236d43820c
      mmc0: sdhci: ============================================
      mmc0: error -5 whilst initialising SD card
      
      but can lead to other errors, and potentially direct the SDHCI
      controller to read/write data to other memory locations (e.g. if a valid
      descriptor is visible to the device in a stale cache line.)
      
      Fix this by ensuring that the DMA snoop bit corresponds with the
      behaviour of the DMA API.  Since the driver currently only supports DT,
      use of_dma_is_coherent().  Note that device_get_dma_attr() can not be
      used as that risks re-introducing this bug if/when the driver is
      converted to ACPI.
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7ed2867c
  2. 31 5月, 2019 3 次提交
  3. 13 2月, 2019 1 次提交
  4. 16 7月, 2018 2 次提交
  5. 11 12月, 2017 2 次提交
  6. 30 10月, 2017 1 次提交
  7. 30 8月, 2017 1 次提交
  8. 28 4月, 2017 2 次提交
  9. 25 4月, 2017 5 次提交
  10. 13 2月, 2017 2 次提交
    • Y
      mmc: sdhci-of-esdhc: avoid clock glitch when frequency is changing · e87d2db2
      yangbo lu 提交于
      The eSDHC_PRSSTAT[SDSTB] bit indicates whether the internal card clock is
      stable. This bit is for the host driver to poll clock status when changing
      the clock frequency. It is recommended to clear eSDHC_SYSCTL[SDCLKEN]
      to remove glitch on the card clock when the frequency is changing. This
      patch is to disable SDCLKEN bit before changing frequency and enable it
      after SDSTB bit is set.
      Signed-off-by: NYangbo Lu <yangbo.lu@nxp.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      e87d2db2
    • Y
      mmc: sdhci-of-esdhc: remove default broken-cd for ARM · e9acc77d
      yangbo lu 提交于
      Initially all QorIQ platforms were PowerPC architecture and they didn't
      support card detection except several platforms. The driver added the
      quirk SDHCI_QUIRK_BROKEN_CARD_DETECTION as default and this made broken-cd
      property in dts node didn't work. Now QorIQ platform turns to ARM
      architecture and most of them could support card detection. However it's
      a large number of dts trees that need to be fixed with broken-cd if we
      remove the default SDHCI_QUIRK_BROKEN_CARD_DETECTION in driver. And the
      users don't want to see this. So this patch is to remove this default
      quirk just for ARM and keep it for PowerPC.(Note, QorIQ PowerPC platform
      only has big-endian eSDHC while QorIQ ARM platform has big-endian or
      little-endian eSDHC) This makes broken-cd property work again for ARM.
      Signed-off-by: NYangbo Lu <yangbo.lu@nxp.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      e9acc77d
  11. 29 11月, 2016 1 次提交
  12. 18 11月, 2016 1 次提交
  13. 27 9月, 2016 1 次提交
  14. 27 7月, 2016 1 次提交
  15. 29 2月, 2016 1 次提交
  16. 22 12月, 2015 1 次提交
    • Y
      mmc: sdhci-of-esdhc: add/remove some quirks according to vendor version · 1ef5e49e
      yangbo lu 提交于
      A previous patch had removed esdhc_of_platform_init() by mistake.
      static void esdhc_of_platform_init(struct sdhci_host *host)
      {
      	u32 vvn;
      
      	vvn = in_be32(host->ioaddr + SDHCI_SLOT_INT_STATUS);
      	vvn = (vvn & SDHCI_VENDOR_VER_MASK) >> SDHCI_VENDOR_VER_SHIFT;
      	if (vvn == VENDOR_V_22)
      		host->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
      
      	if (vvn > VENDOR_V_22)
      		host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ;
      }
      
      This patch is used to fix it by add/remove some quirks according to
      verdor version in probe.
      Signed-off-by: NYangbo Lu <yangbo.lu@freescale.com>
      Fixes: f4932cfd ("mmc: sdhci-of-esdhc: support both BE and LE host controller")
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      1ef5e49e
  17. 26 10月, 2015 4 次提交
  18. 27 8月, 2015 1 次提交
  19. 01 6月, 2015 2 次提交
  20. 23 3月, 2015 1 次提交
  21. 19 1月, 2015 2 次提交
  22. 09 9月, 2014 1 次提交
  23. 23 5月, 2014 1 次提交
  24. 22 5月, 2014 2 次提交