]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
memstick: Prevent memstick host from getting runtime suspended during card detection
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Fri, 11 Jan 2019 08:30:00 +0000 (09:30 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
commit4a6017e13631c41ae76566d900ed9c327b216d9f
tree4764b3642bf0cce05e803c802cc588be5da4832e
parent324cef401321933990767cc30ca82cd4418e19bc
memstick: Prevent memstick host from getting runtime suspended during card detection

BugLink: https://bugs.launchpad.net/bugs/1811337
We can use MEMSTICK_POWER_{ON,OFF} along with pm_runtime_{get,put}
helpers to let memstick host support runtime pm.

The rpm count may go down to zero before the memstick host powers on, so
the host can be runtime suspended.

So before doing card detection, increment the rpm count to avoid the
host gets runtime suspended. Balance the rpm count after card detection
is done.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
(cherry picked from commit e03e303edf1c63e6dd455ccd568c74e93ef3ba8c)
Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/memstick/core/memstick.c