diff options
author | Gilad Ben-Yossef <gilad@benyossef.com> | 2019-02-07 15:36:11 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-02-08 15:28:02 +0800 |
commit | 1358c13a48c43f5e4de0c1835291837a27b9720c (patch) | |
tree | e5ec75ed516856e6e08a1cbe1dc5f6415c20a810 /drivers/crypto/ccree/cc_pm.h | |
parent | 356690d029e10f1aadebc49819d3908d5f6389fb (diff) | |
download | linux-stable-1358c13a48c43f5e4de0c1835291837a27b9720c.tar.gz linux-stable-1358c13a48c43f5e4de0c1835291837a27b9720c.tar.bz2 linux-stable-1358c13a48c43f5e4de0c1835291837a27b9720c.zip |
crypto: ccree - fix resume race condition on init
We were enabling autosuspend, which is using data set by the
hash module, prior to the hash module being inited, casuing
a crash on resume as part of the startup sequence if the race
was lost.
This was never a real problem because the PM infra was using low
res timers so we were always winning the race, until commit 8234f6734c5d
("PM-runtime: Switch autosuspend over to using hrtimers") changed that :-)
Fix this by seperating the PM setup and enablement and doing the
latter only at the end of the init sequence.
Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: stable@kernel.org # v4.20
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccree/cc_pm.h')
-rw-r--r-- | drivers/crypto/ccree/cc_pm.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/crypto/ccree/cc_pm.h b/drivers/crypto/ccree/cc_pm.h index 020a5403c58b..f62624357020 100644 --- a/drivers/crypto/ccree/cc_pm.h +++ b/drivers/crypto/ccree/cc_pm.h @@ -16,6 +16,7 @@ extern const struct dev_pm_ops ccree_pm; int cc_pm_init(struct cc_drvdata *drvdata); +void cc_pm_go(struct cc_drvdata *drvdata); void cc_pm_fini(struct cc_drvdata *drvdata); int cc_pm_suspend(struct device *dev); int cc_pm_resume(struct device *dev); @@ -29,6 +30,8 @@ static inline int cc_pm_init(struct cc_drvdata *drvdata) return 0; } +static void cc_pm_go(struct cc_drvdata *drvdata) {} + static inline void cc_pm_fini(struct cc_drvdata *drvdata) {} static inline int cc_pm_suspend(struct device *dev) |