1. 13 7月, 2020 2 次提交
  2. 29 5月, 2020 1 次提交
  3. 28 5月, 2020 4 次提交
  4. 14 11月, 2019 1 次提交
    • U
      mmc: core: Re-work HW reset for SDIO cards · 2ac55d5e
      Ulf Hansson 提交于
      It have turned out that it's not a good idea to unconditionally do a power
      cycle and then to re-initialize the SDIO card, as currently done through
      mmc_hw_reset() -> mmc_sdio_hw_reset(). This because there may be multiple
      SDIO func drivers probed, who also shares the same SDIO card.
      
      To address these scenarios, one may be tempted to use a notification
      mechanism, as to allow the core to inform each of the probed func drivers,
      about an ongoing HW reset. However, supporting such an operation from the
      func driver point of view, may not be entirely trivial.
      
      Therefore, let's use a more simplistic approach to solve the problem, by
      instead forcing the card to be removed and re-detected, via scheduling a
      rescan-work. In this way, we can rely on existing infrastructure, as the
      func driver's ->remove() and ->probe() callbacks, becomes invoked to deal
      with the cleanup and the re-initialization.
      
      This solution may be considered as rather heavy, especially if a func
      driver doesn't share its card with other func drivers. To address this,
      let's keep the current immediate HW reset option as well, but run it only
      when there is one func driver probed for the card.
      
      Finally, to allow the caller of mmc_hw_reset(), to understand if the reset
      is being asynchronously managed from a scheduled work, it returns 1
      (propagated from mmc_sdio_hw_reset()). If the HW reset is executed
      successfully and synchronously it returns 0, which maintains the existing
      behaviour.
      Reviewed-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NDouglas Anderson <dianders@chromium.org>
      Cc: stable@vger.kernel.org # v5.4+
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      2ac55d5e
  5. 11 9月, 2019 2 次提交
    • U
      mmc: core: Fixup processing of SDIO IRQs during system suspend/resume · 51133850
      Ulf Hansson 提交于
      System suspend/resume of SDIO cards, with SDIO IRQs enabled and when using
      MMC_CAP2_SDIO_IRQ_NOTHREAD is unfortunate still suffering from a fragile
      behaviour. Some problems have been taken care of so far, but more issues
      remains.
      
      For example, calling the ->ack_sdio_irq() callback to let host drivers
      re-enable the SDIO IRQs is a bad idea, unless the IRQ have been consumed,
      which may not be the case during system suspend/resume. This may lead to
      that a host driver re-signals the same SDIO IRQ over and over again,
      causing a storm of IRQs and gives a ping-pong effect towards the
      sdio_irq_work().
      
      Moreover, calling the ->enable_sdio_irq() callback at system resume to
      re-enable already enabled SDIO IRQs for the host, causes the runtime PM
      count for some host drivers to become in-balanced. This then leads to the
      host to remain runtime resumed, no matter if it's needed or not.
      
      To fix these problems, let's check if process_sdio_pending_irqs() actually
      consumed the SDIO IRQ, before we continue to ack the IRQ by invoking the
      ->ack_sdio_irq() callback.
      
      Additionally, there should be no need to re-enable SDIO IRQs as the host
      driver already knows if they were enabled at system suspend, thus also
      whether it needs to re-enable them at system resume. For this reason, drop
      the call to ->enable_sdio_irq() during system resume.
      
      In regards to these changes there is yet another issue, which is when there
      is an SDIO IRQ being signaled by the host driver, but after the SDIO card
      has been system suspended. Currently these IRQs are just thrown away, while
      we should at least make sure to try to consume them when the SDIO card has
      been system resumed. Fix this by queueing a sdio_irq_work() after we system
      resumed the SDIO card.
      Tested-by: NMatthias Kaehlcke <mka@chromium.org>
      Reviewed-by: NMatthias Kaehlcke <mka@chromium.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      51133850
    • U
      mmc: core: WARN if SDIO IRQs are enabled for non-powered card in suspend · c5d3e8fa
      Ulf Hansson 提交于
      To make sure SDIO func drivers behaves correctly during system
      suspend/resume, let add a WARN_ON in case the condition is a non-powered
      SDIO card and there are some SDIO IRQs still being claimed.
      Tested-by: NMatthias Kaehlcke <mka@chromium.org>
      Reviewed-by: NMatthias Kaehlcke <mka@chromium.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      c5d3e8fa
  6. 10 7月, 2019 6 次提交
  7. 18 6月, 2019 1 次提交
  8. 31 5月, 2019 1 次提交
  9. 28 2月, 2019 1 次提交
  10. 16 7月, 2018 1 次提交
  11. 08 5月, 2018 3 次提交
  12. 02 5月, 2018 2 次提交
  13. 15 3月, 2018 1 次提交
  14. 20 6月, 2017 2 次提交
  15. 15 2月, 2017 2 次提交
  16. 13 2月, 2017 5 次提交
  17. 05 12月, 2016 1 次提交
  18. 17 3月, 2016 1 次提交
  19. 14 1月, 2016 1 次提交
    • C
      mmc: core: Enable tuning according to the actual timing · e10c3219
      Carlo Caione 提交于
      While in sdhci_execute_tuning() the choice whether or not to enable the
      tuning is done on the actual timing, in the mmc_sdio_init_uhs_card() the
      check is done on the capability of the card.
      
      This difference is causing some issues with some SDIO cards in DDR50
      mode where the CDM19 is wrongly issued.
      
      With this patch we modify the check in both
      mmc_(sd|sdio)_init_uhs_card() functions to take the proper decision
      only according to the actual timing specification.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NCarlo Caione <carlo@endlessm.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      e10c3219
  20. 22 12月, 2015 1 次提交
  21. 26 10月, 2015 1 次提交
    • U
      mmc: core: Remove MMC_CLKGATE · 9eadcc05
      Ulf Hansson 提交于
      MMC_CLKGATE was once invented to save power by gating the bus clock at
      request inactivity. At that time it served its purpose. The modern way to
      deal with power saving for these scenarios, is by using runtime PM.
      
      Nowadays, several host drivers have deployed runtime PM, but for those
      that haven't and which still cares power saving at request inactivity,
      it's certainly time to deploy runtime PM as it has been around for several
      years now.
      
      To simplify code to mmc core and thus decrease maintenance efforts, this
      patch removes all code related to MMC_CLKGATE.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      9eadcc05