Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: stm32 - Revert broken pm_runtime_resume_and_get changes

We should not call pm_runtime_resume_and_get where the reference
count is expected to be incremented unconditionally. This patch
reverts these calls to the original unconditional get_sync call.

Reported-by: Heiner Kallweit <hkallweit1@gmail.com>
Fixes: 747bf30fd944 ("crypto: stm32/cryp - Fix PM reference leak...")
Fixes: 1cb3ad701970 ("crypto: stm32/hash - Fix PM reference leak...")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

+5 -4
+2 -1
drivers/crypto/stm32/stm32-cryp.c
··· 534 534 { 535 535 int ret; 536 536 u32 cfg, hw_mode; 537 - pm_runtime_resume_and_get(cryp->dev); 537 + 538 + pm_runtime_get_sync(cryp->dev); 538 539 539 540 /* Disable interrupt */ 540 541 stm32_cryp_write(cryp, CRYP_IMSCR, 0);
+3 -3
drivers/crypto/stm32/stm32-hash.c
··· 813 813 static int stm32_hash_hw_init(struct stm32_hash_dev *hdev, 814 814 struct stm32_hash_request_ctx *rctx) 815 815 { 816 - pm_runtime_resume_and_get(hdev->dev); 816 + pm_runtime_get_sync(hdev->dev); 817 817 818 818 if (!(HASH_FLAGS_INIT & hdev->flags)) { 819 819 stm32_hash_write(hdev, HASH_CR, HASH_CR_INIT); ··· 962 962 u32 *preg; 963 963 unsigned int i; 964 964 965 - pm_runtime_resume_and_get(hdev->dev); 965 + pm_runtime_get_sync(hdev->dev); 966 966 967 967 while ((stm32_hash_read(hdev, HASH_SR) & HASH_SR_BUSY)) 968 968 cpu_relax(); ··· 1000 1000 1001 1001 preg = rctx->hw_context; 1002 1002 1003 - pm_runtime_resume_and_get(hdev->dev); 1003 + pm_runtime_get_sync(hdev->dev); 1004 1004 1005 1005 stm32_hash_write(hdev, HASH_IMR, *preg++); 1006 1006 stm32_hash_write(hdev, HASH_STR, *preg++);