1. 13 Sep, 2019 2 commits
    • Ulf Hansson's avatar
      mmc: tmio: Fixup runtime PM management during probe · aa86f1a3
      Ulf Hansson authored
      The tmio_mmc_host_probe() calls pm_runtime_set_active() to update the
      runtime PM status of the device, as to make it reflect the current status
      of the HW. This works fine for most cases, but unfortunate not for all.
      Especially, there is a generic problem when the device has a genpd attached
      and that genpd have the ->start|stop() callbacks assigned.
      More precisely, if the driver calls pm_runtime_set_active() during
      ->probe(), genpd does not get to invoke the ->start() callback for it,
      which means the HW isn't really fully powered on. Furthermore, in the next
      phase, when the device becomes runtime suspended, genpd will invoke the
      ->stop() callback for it, potentially leading to usage count imbalance
      problems, depending on what's implemented behind the callbacks of course.
      To fix this problem, convert to call pm_runtime_get_sync() from
      tmio_mmc_host_probe() rather than pm_runtime_set_active(). Additionally, to
      avoid bumping usage counters and unnecessary re-initializing the HW the
      first time the tmio driver's ->runtime_resume() callback is called,
      introduce a state flag to keeping track of this.
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
    • Ulf Hansson's avatar
      Revert "mmc: tmio: move runtime PM enablement to the driver implementations" · 8861474a
      Ulf Hansson authored
      This reverts commit 7ff21319.
      It turns out that the above commit introduces other problems. For example,
      calling pm_runtime_set_active() must not be done prior calling
      pm_runtime_enable() as that makes it fail. This leads to additional
      problems, such as clock enables being wrongly balanced.
      Rather than fixing the problem on top, let's start over by doing a revert.
      Fixes: 7ff21319
       ("mmc: tmio: move runtime PM enablement to the driver implementations")
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
  2. 10 Jul, 2019 1 commit
  3. 10 Jun, 2019 1 commit
  4. 28 May, 2019 1 commit
  5. 15 Apr, 2019 2 commits
  6. 26 Feb, 2019 1 commit
  7. 25 Feb, 2019 3 commits
  8. 17 Dec, 2018 4 commits
  9. 15 Oct, 2018 2 commits
  10. 08 Oct, 2018 4 commits
  11. 01 Aug, 2018 2 commits
  12. 16 Jul, 2018 1 commit
  13. 04 Apr, 2018 1 commit
  14. 05 Mar, 2018 8 commits
  15. 22 Jan, 2018 1 commit
    • Arnd Bergmann's avatar
      mmc: tmio: hide unused tmio_mmc_clk_disable/tmio_mmc_clk_enable functions · 4a09d0b8
      Arnd Bergmann authored
      When CONFIG_PM is disabled, we get a warning about the clock handling
      being unused:
      drivers/mmc/host/tmio_mmc_core.c:937:13: error: 'tmio_mmc_clk_disable' defined but not used [-Werror=unused-function]
       static void tmio_mmc_clk_disable(struct tmio_mmc_host *host)
      drivers/mmc/host/tmio_mmc_core.c:929:12: error: 'tmio_mmc_clk_enable' defined but not used [-Werror=unused-function]
       static int tmio_mmc_clk_enable(struct tmio_mmc_host *host)
      As the clock handling is now done elsewhere, this is only used when
      power management is enabled. We could make the functions as __maybe_unused,
      but since there is already an #ifdef section, it seems easier to move
      the helpers closer to their callers.
      Fixes: b21fc294
       ("mmc: tmio: move clk_enable/disable out of tmio_mmc_host_probe()")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
  16. 18 Jan, 2018 5 commits
  17. 12 Jan, 2018 1 commit