]> git.itanic.dy.fi Git - linux-stable/commit
memstick: Prevent memstick host from getting runtime suspended during card detection
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Mon, 5 Nov 2018 08:45:04 +0000 (16:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Feb 2019 09:09:00 +0000 (10:09 +0100)
commita6e15ccc870a628c0a494f5aeed3e3048748905d
tree5ef85d8e1c6c067cfdbdbfdad0dc7c51bdbc79f3
parent2303374453375547cc9e2d1d8dc8acd6820076de
memstick: Prevent memstick host from getting runtime suspended during card detection

[ Upstream commit e03e303edf1c63e6dd455ccd568c74e93ef3ba8c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/memstick/core/memstick.c