mmc: rtsx_usb_sdmmc: Re-work runtime PM support
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 31 May 2018 09:40:40 +0000 (11:40 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 17 Dec 2018 07:26:24 +0000 (08:26 +0100)
commitf275179f7bdcf08f4c74c2d1d19c4e8269be3454
tree68c0abe0fda33093c3930dd10ea7828c580aba24
parent4bfdd76dcb672dd55121b04ed7f1c1ff4343f1ef
mmc: rtsx_usb_sdmmc: Re-work runtime PM support

The current implementation uses the runtime PM autosuspend feature with a
default timeout set to 50ms. This really doesn't makes sense, as it's a USB
driven host device, which needs it rtsx USB device (parent device) to be
runtime resumed to provide power to the card.

In practise, using the autosuspend or any async runtime PM suspend method,
means unnecessary delaying the host device and thus the parent, to be
runtime suspended when a card is removed/powered off. For this reasons,
let's simply drop the support for runtime PM autosuspend and tell the mmc
core to use synced runtime PM suspend methods, via setting
MMC_CAP_SYNC_RUNTIME_PM during probe.

Moreover, as the mmc core nowadays deploys runtime PM reference counting of
the mmc host device, convert ->set_ios() to use the more lightweight
pm_runtime_get_noresume() and pm_runtime_put_noidle() APIs.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
drivers/mmc/host/rtsx_usb_sdmmc.c