crypto: ccree - fix PM race condition
authorGilad Ben-Yossef <gilad@benyossef.com>
Thu, 16 Jan 2020 10:14:43 +0000 (12:14 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 22 Jan 2020 08:21:10 +0000 (16:21 +0800)
commit15fd2566bf54ee4d4781d8f170acfc9472a1541f
treeccb47dc306ee048067e588961dc3fbefd579a823
parent5c83e8ec4d51ac4cc58482ed04297e6882b32a09
crypto: ccree - fix PM race condition

The PM code was racy, possibly causing the driver to submit
requests to a powered down device. Fix the race and while
at it simplify the PM code.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Fixes: 1358c13a48c4 ("crypto: ccree - fix resume race condition on init")
Cc: stable@kernel.org # v4.20
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccree/cc_driver.h
drivers/crypto/ccree/cc_pm.c
drivers/crypto/ccree/cc_request_mgr.c
drivers/crypto/ccree/cc_request_mgr.h