]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: ccree - fix resume race condition on init
authorGilad Ben-Yossef <gilad@benyossef.com>
Thu, 7 Feb 2019 13:36:11 +0000 (15:36 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 8 Feb 2019 07:28:02 +0000 (15:28 +0800)
commitec8d8b6393b64d1948d0f30e1166ed0bd3dfc687
treee5ec75ed516856e6e08a1cbe1dc5f6415c20a810
parent280e0aaca0b71dd910c50f3217f02cc15b146e00
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 da8ba0b861bb
("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>
drivers/crypto/ccree/cc_driver.c
drivers/crypto/ccree/cc_pm.c
drivers/crypto/ccree/cc_pm.h