1. 24 3月, 2020 3 次提交
  2. 11 3月, 2020 1 次提交
  3. 12 9月, 2019 1 次提交
  4. 11 9月, 2019 2 次提交
  5. 03 9月, 2019 1 次提交
  6. 20 6月, 2019 1 次提交
  7. 19 6月, 2019 1 次提交
  8. 18 6月, 2019 1 次提交
    • D
      mmc: core: API to temporarily disable retuning for SDIO CRC errors · 0a55f4ab
      Douglas Anderson 提交于
      Normally when the MMC core sees an "-EILSEQ" error returned by a host
      controller then it will trigger a retuning of the card.  This is
      generally a good idea.
      
      However, if a command is expected to sometimes cause transfer errors
      then these transfer errors shouldn't cause a re-tuning.  This
      re-tuning will be a needless waste of time.  One example case where a
      transfer is expected to cause errors is when transitioning between
      idle (sometimes referred to as "sleep" in Broadcom code) and active
      state on certain Broadcom WiFi SDIO cards.  Specifically if the card
      was already transitioning between states when the command was sent it
      could cause an error on the SDIO bus.
      
      Let's add an API that the SDIO function drivers can call that will
      temporarily disable the auto-tuning functionality.  Then we can add a
      call to this in the Broadcom WiFi driver and any other driver that
      might have similar needs.
      
      NOTE: this makes the assumption that the card is already tuned well
      enough that it's OK to disable the auto-retuning during one of these
      error-prone situations.  Presumably the driver code performing the
      error-prone transfer knows how to recover / retry from errors.  ...and
      after we can get back to a state where transfers are no longer
      error-prone then we can enable the auto-retuning again.  If we truly
      find ourselves in a case where the card needs to be retuned sometimes
      to handle one of these error-prone transfers then we can always try a
      few transfers first without auto-retuning and then re-try with
      auto-retuning if the first few fail.
      
      Without this change on rk3288-veyron-minnie I periodically see this in
      the logs of a machine just sitting there idle:
        dwmmc_rockchip ff0d0000.dwmmc: Successfully tuned phase to XYZ
      
      Cc: stable@vger.kernel.org #v4.18+
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      0a55f4ab
  9. 25 2月, 2019 3 次提交
  10. 17 12月, 2018 2 次提交
  11. 08 10月, 2018 1 次提交
  12. 16 7月, 2018 2 次提交
    • U
      mmc: core: Drop the unused mmc_power_save|restore_host() · 29772f8a
      Ulf Hansson 提交于
      The last user of mmc_power_save|restore_host() APIs is gone, hence let's
      drop them. Drop also the corresponding bus_ops callback,
      ->power_save|restore() as those becomes redundant.
      
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Eyal Reizer <eyalreizer@gmail.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      29772f8a
    • S
      mmc: core: more fine-grained hooks for HS400 tuning · ba6c7ac3
      Simon Horman 提交于
      This adds two new HS400 tuning operations:
      * hs400_downgrade
      * hs400_complete
      
      These supplement the existing HS400 operation:
      * prepare_hs400_tuning
      
      This is motivated by a requirement of Renesas SDHI for the following:
      1. Disabling SCC before selecting to HS if selection of HS400 has occurred.
         This can be done in an implementation of prepare_hs400_tuning_downgrade
      2. Updating registers after switching to HS400
         This can be done in an implementation of complete_hs400_tuning
      
      If hs400_downgrade or hs400_complete are not implemented then they are not
      called. Thus means there should be no affect for existing drivers as none
      implemt these ops.
      Signed-off-by: NSimon Horman <horms+renesas@verge.net.au>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      ba6c7ac3
  13. 21 5月, 2018 1 次提交
    • S
      mmc: core: add tunable delay waiting for power to be stable · 6d796c68
      Shawn Lin 提交于
      The hard-coded 10ms delay in mmc_power_up came from
      commit 79bccc5a ("mmc: increase power up delay"), which said "The TI
      controller on Toshiba Tecra M5 needs more time to power up or the cards
      will init incorrectly or not at all." But it's too engineering solution
      for a special board but force all platforms to wait for that long time,
      especially painful for mmc_power_up for eMMC when booting.
      
      However, it's added since 2009, and we can't tell if other platforms
      benefit from it. But in practise, the modern hardware are most likely to
      have a stable power supply with 1ms after setting it for no matter PMIC
      or discrete power. And more importnatly, most regulators implement the
      callback of ->set_voltage_time_sel() for regulator core to wait for
      specific period of time for the power supply to be stable, which means
      once regulator_set_voltage_* return, the power should reach the the
      minimum voltage that works for initialization. Of course, if there
      are some other ways for host to power the card, we should allow them
      to argue a suitable delay as well.
      
      With this patch, we could assign the delay from firmware, or we could
      assigne it via ->set_ios() callback from host drivers.
      Signed-off-by: NShawn Lin <shawn.lin@rock-chips.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      6d796c68
  14. 03 5月, 2018 1 次提交
  15. 02 5月, 2018 1 次提交
  16. 11 12月, 2017 3 次提交
  17. 30 10月, 2017 3 次提交
  18. 04 10月, 2017 1 次提交
    • L
      mmc: Delete bounce buffer handling · de3ee99b
      Linus Walleij 提交于
      In may, Steven sent a patch deleting the bounce buffer handling
      and the CONFIG_MMC_BLOCK_BOUNCE option.
      
      I chose the less invasive path of making it a runtime config
      option, and we merged that successfully for kernel v4.12.
      
      The code is however just standing in the way and taking up
      space for seemingly no gain on any systems in wide use today.
      
      Pierre says the code was there to improve speed on TI SDHCI
      controllers on certain HP laptops and possibly some Ricoh
      controllers as well. Early SDHCI controllers lacked the
      scatter-gather feature, which made software bounce buffers
      a significant speed boost.
      
      We are clearly talking about the list of SDHCI PCI-based
      MMC/SD card readers found in the pci_ids[] list in
      drivers/mmc/host/sdhci-pci-core.c.
      
      The TI SDHCI derivative is not supported by the upstream
      kernel. This leaves the Ricoh.
      
      What we can however notice is that the x86 defconfigs in the
      kernel did not enable CONFIG_MMC_BLOCK_BOUNCE option, which
      means that any such laptop would have to have a custom
      configured kernel to actually take advantage of this
      bounce buffer speed-up. It simply seems like there was
      a speed optimization for the Ricoh controllers that noone
      was using. (I have not checked the distro defconfigs but
      I am pretty sure the situation is the same there.)
      
      Bounce buffers increased performance on the OMAP HSMMC
      at one point, and was part of the original submission in
      commit a45c6cb8 ("[ARM] 5369/1: omap mmc: Add new
         omap hsmmc controller for 2430 and 34xx, v3")
      
      This optimization was removed in
      commit 0ccd76d4 ("omap_hsmmc: Implement scatter-gather
         emulation")
      which found that scatter-gather emulation provided even
      better performance.
      
      The same was introduced for SDHCI in
      commit 2134a922 ("sdhci: scatter-gather (ADMA) support")
      
      I am pretty positively convinced that software
      scatter-gather emulation will do for any host controller what
      the bounce buffers were doing. Essentially, the bounce buffer
      was a reimplementation of software scatter-gather-emulation in
      the MMC subsystem, and it should be done away with.
      
      Cc: Pierre Ossman <pierre@ossman.eu>
      Cc: Juha Yrjola <juha.yrjola@solidboot.com>
      Cc: Steven J. Hill <Steven.Hill@cavium.com>
      Cc: Shawn Lin <shawn.lin@rock-chips.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Suggested-by: NSteven J. Hill <Steven.Hill@cavium.com>
      Suggested-by: NShawn Lin <shawn.lin@rock-chips.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      de3ee99b
  19. 30 8月, 2017 3 次提交
  20. 20 6月, 2017 4 次提交
    • A
      mmc: slot-gpio: Add support to enable irq wake on cd_irq · 03dbaa04
      Adrian Hunter 提交于
      Add host capability MMC_CAP_CD_WAKE to enable irq wake on the card detect
      irq.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      03dbaa04
    • U
      mmc: core: Remove MMC_CAP2_HC_ERASE_SZ · d2a47176
      Ulf Hansson 提交于
      The MMC_CAP2_HC_ERASE_SZ is used only by a few mmc host drivers. Its intent
      is to enable eMMC's high-capacity erase size, as to improve the behaviour
      of the erase operations.
      
      We should strive to avoid software configuration options that aren't
      necessary, but instead deploy common behaviours. For these reasons, let's
      remove the capability bit for MMC_CAP2_HC_ERASE_SZ and make it the default
      behaviour.
      
      Note that this change doesn't affect eMMCs supporting trim/discard, because
      these commands operates on sectors and takes precedence over erase
      commands.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: NShawn Lin <shawn.lin@rock-chips.com>
      Tested-by: NShawn Lin <shawn.lin@rock-chips.com>
      d2a47176
    • L
      mmc: core: Delete bounce buffer Kconfig option · c3dccb74
      Linus Walleij 提交于
      This option is activated by all multiplatform configs and what
      not so we almost always have it turned on, and the memory it
      saves is negligible, even more so moving forward. The actual
      bounce buffer only gets allocated only when used, the only
      thing the ifdefs are saving is a little bit of code.
      
      It is highly improper to have this as a Kconfig option that
      get turned on by Kconfig, make this a pure runtime-thing and
      let the host decide whether we use bounce buffers. We add a
      new property "disable_bounce" to the host struct.
      
      Notice that mmc_queue_calc_bouncesz() already disables the
      bounce buffers if host->max_segs != 1, so any arch that has a
      maximum number of segments higher than 1 will have bounce
      buffers disabled.
      
      The option CONFIG_MMC_BLOCK_BOUNCE is default y so the
      majority of platforms in the kernel already have it on, and
      it then gets turned off at runtime since most of these have
      a host->max_segs > 1. The few exceptions that have
      host->max_segs == 1 and still turn off the bounce buffering
      are those that disable it in their defconfig.
      
      Those are the following:
      
      arch/arm/configs/colibri_pxa300_defconfig
      arch/arm/configs/zeus_defconfig
      - Uses MMC_PXA, drivers/mmc/host/pxamci.c
      - Sets host->max_segs = NR_SG, which is 1
      - This needs its bounce buffer deactivated so we set
        host->disable_bounce to true in the host driver
      
      arch/arm/configs/davinci_all_defconfig
      - Uses MMC_DAVINCI, drivers/mmc/host/davinci_mmc.c
      - This driver sets host->max_segs to MAX_NR_SG, which is 16
      - That means this driver anyways disabled bounce buffers
      - No special action needed for this platform
      
      arch/arm/configs/lpc32xx_defconfig
      arch/arm/configs/nhk8815_defconfig
      arch/arm/configs/u300_defconfig
      - Uses MMC_ARMMMCI, drivers/mmc/host/mmci.[c|h]
      - This driver by default sets host->max_segs to NR_SG,
        which is 128, unless a DMA engine is used, and in that case
        the number of segments are also > 1
      - That means this driver already disables bounce buffers
      - No special action needed for these platforms
      
      arch/arm/configs/sama5_defconfig
      - Uses MMC_SDHCI, MMC_SDHCI_PLTFM, MMC_SDHCI_OF_AT91, MMC_ATMELMCI
      - Uses drivers/mmc/host/sdhci.c
      - Normally sets host->max_segs to SDHCI_MAX_SEGS which is 128 and
        thus disables bounce buffers
      - Sets host->max_segs to 1 if SDHCI_USE_SDMA is set
      - SDHCI_USE_SDMA is only set by SDHCI on PCI adapers
      - That means that for this platform bounce buffers are already
        disabled at runtime
      - No special action needed for this platform
      
      arch/blackfin/configs/CM-BF533_defconfig
      arch/blackfin/configs/CM-BF537E_defconfig
      - Uses MMC_SPI (a simple MMC card connected on SPI pins)
      - Uses drivers/mmc/host/mmc_spi.c
      - Sets host->max_segs to MMC_SPI_BLOCKSATONCE which is 128
      - That means this platform already disables bounce buffers at
        runtime
      - No special action needed for these platforms
      
      arch/mips/configs/cavium_octeon_defconfig
      - Uses MMC_CAVIUM_OCTEON, drivers/mmc/host/cavium.c
      - Sets host->max_segs to 16 or 1
      - Setting host->disable_bounce to be sure for the 1 case
      
      arch/mips/configs/qi_lb60_defconfig
      - Uses MMC_JZ4740, drivers/mmc/host/jz4740_mmc.c
      - This sets host->max_segs to 128 so bounce buffers are
        already runtime disabled
      - No action needed for this platform
      
      It would be interesting to come up with a list of the platforms
      that actually end up using bounce buffers. I have not been
      able to infer such a list, but it occurs when
      host->max_segs == 1 and the bounce buffering is not explicitly
      disabled.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      c3dccb74
    • U
      mmc: sdio: Add API to manage SDIO IRQs from a workqueue · 68269660
      Ulf Hansson 提交于
      For hosts not supporting MMC_CAP2_SDIO_IRQ_NOTHREAD but MMC_CAP_SDIO_IRQ,
      the SDIO IRQs are processed from a dedicated kernel thread. For these
      cases, the host calls mmc_signal_sdio_irq() from its ISR to signal a new
      SDIO IRQ.
      
      Signaling an SDIO IRQ makes the host's ->enable_sdio_irq() callback to be
      invoked to temporary disable the IRQs, before the kernel thread is woken up
      to process it. When processing of the IRQs are completed, they are
      re-enabled by the kernel thread, again via invoking the host's
      ->enable_sdio_irq().
      
      The observation from this, is that the execution path is being unnecessary
      complex, as the host driver already knows that it needs to temporary
      disable the IRQs before signaling a new one. Moreover, replacing the kernel
      thread with a work/workqueue would not only greatly simplify the code, but
      also make it more robust.
      
      To address the above problems, let's continue to build upon the support for
      MMC_CAP2_SDIO_IRQ_NOTHREAD, as it already implements SDIO IRQs to be
      processed without using the clumsy kernel thread and without the ping-pong
      calls of the host's ->enable_sdio_irq() callback for each processed IRQ.
      
      Therefore, let's add new API sdio_signal_irq(), which enables hosts to
      signal/process SDIO IRQs by using a work/workqueue, rather than using the
      kernel thread.
      
      Add also a new host callback ->ack_sdio_irq(), which the work invokes when
      the SDIO IRQs have been processed. This informs the host about when it
      shall re-enable the SDIO IRQs. Potentially, we could re-use the existing
      ->enable_sdio_irq() callback instead of adding a new one, however it has
      turned out that it's more convenient for hosts to get this information via
      a separate callback.
      
      Hosts that wants to use this new method to signal/process SDIO IRQs, must
      enable MMC_CAP2_SDIO_IRQ_NOTHREAD and implement the ->ack_sdio_irq()
      callback.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: NDouglas Anderson <dianders@chromium.org>
      Reviewed-by: NDouglas Anderson <dianders@chromium.org>
      68269660
  21. 25 4月, 2017 1 次提交
  22. 13 2月, 2017 3 次提交