Skip to content

Commit

Permalink
hwrng: stm32 - fix pm_suspend issue
Browse files Browse the repository at this point in the history
When suspend is called after pm_runtime_suspend,
same callback is used and access to rng register is
freezing system. By calling the pm_runtime_force_suspend,
it first checks that runtime has been already done.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
lionel.debieve@st.com authored and Herbert Xu committed May 5, 2018
1 parent af51378 commit 9bae549
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/char/hw_random/stm32-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,13 @@ static int stm32_rng_runtime_resume(struct device *dev)
}
#endif

static UNIVERSAL_DEV_PM_OPS(stm32_rng_pm_ops, stm32_rng_runtime_suspend,
stm32_rng_runtime_resume, NULL);
static const struct dev_pm_ops stm32_rng_pm_ops = {
SET_RUNTIME_PM_OPS(stm32_rng_runtime_suspend,
stm32_rng_runtime_resume, NULL)
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume)
};


static const struct of_device_id stm32_rng_match[] = {
{
Expand Down

0 comments on commit 9bae549

Please sign in to comment.