OSDN Git Service

spi: stm32-qspi: fix pm_runtime usage_count counter
authorChristophe Kerello <christophe.kerello@foss.st.com>
Mon, 19 Apr 2021 12:15:39 +0000 (14:15 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 19 Apr 2021 13:18:42 +0000 (14:18 +0100)
commit102e9d1936569d43f55dd1ea89be355ad207143c
treeadcf8d27f2f52a943a3ee9f6e936c6d77f3e58aa
parent126bdb606fd2802454e6048caef1be3e25dd121e
spi: stm32-qspi: fix pm_runtime usage_count counter

pm_runtime usage_count counter is not well managed.
pm_runtime_put_autosuspend callback drops the usage_counter but this
one has never been increased. Add pm_runtime_get_sync callback to bump up
the usage counter. It is also needed to use pm_runtime_force_suspend and
pm_runtime_force_resume APIs to handle properly the clock.

Fixes: 9d282c17b023 ("spi: stm32-qspi: Add pm_runtime support")
Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210419121541.11617-2-patrice.chotard@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-stm32-qspi.c