* [PATCH 0/3] crypto: Use pm_runtime_resume_and_get()
@ 2026-09-22 3:19 phucduc.bui
2026-09-22 3:19 ` [PATCH 1/3] crypto: sun8i-ss - " phucduc.bui
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: phucduc.bui @ 2026-09-22 3:19 UTC (permalink / raw)
To: Corentin Labbe, Herbert Xu, davem, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Gilad Ben-Yossef, Hans Ulli Kroll, Linus Walleij,
linux-crypto, linux-arm-kernel
Cc: linux-sunxi, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Hi all,
This series replaces open-coded pm_runtime_get_sync() and
pm_runtime_put_noidle() error handling with
pm_runtime_resume_and_get() in several crypto drivers.
No functional change intended.
Best regards,
Phuc
bui duc phuc (3):
crypto: sun8i-ss - Use pm_runtime_resume_and_get()
crypto: ccree - Use pm_runtime_resume_and_get()
crypto: sl3516 - Use pm_runtime_resume_and_get()
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 3 +--
drivers/crypto/ccree/cc_pm.c | 8 +-------
drivers/crypto/gemini/sl3516-ce-cipher.c | 3 +--
drivers/crypto/gemini/sl3516-ce-rng.c | 6 ++----
4 files changed, 5 insertions(+), 15 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] crypto: sun8i-ss - Use pm_runtime_resume_and_get()
2026-09-22 3:19 [PATCH 0/3] crypto: Use pm_runtime_resume_and_get() phucduc.bui
@ 2026-09-22 3:19 ` phucduc.bui
2026-09-22 3:19 ` [PATCH 2/3] crypto: ccree " phucduc.bui
2026-09-22 3:19 ` [PATCH 3/3] crypto: sl3516 " phucduc.bui
2 siblings, 0 replies; 4+ messages in thread
From: phucduc.bui @ 2026-09-22 3:19 UTC (permalink / raw)
To: Corentin Labbe, Herbert Xu, davem, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Gilad Ben-Yossef, Hans Ulli Kroll, Linus Walleij,
linux-crypto, linux-arm-kernel
Cc: linux-sunxi, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Replace the open-coded pm_runtime_get_sync() + pm_runtime_put_noidle()
error handling pattern with pm_runtime_resume_and_get(), which already
does this internally.
No functional change.
Found by manual code inspection.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c
index 36a1ebca2e70..56ba4ff6d5ff 100644
--- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c
+++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c
@@ -120,12 +120,11 @@ int sun8i_ss_hash_init_tfm(struct crypto_ahash *tfm)
memcpy(algt->fbname, crypto_ahash_driver_name(op->fallback_tfm),
CRYPTO_MAX_ALG_NAME);
- err = pm_runtime_get_sync(op->ss->dev);
+ err = pm_runtime_resume_and_get(op->ss->dev);
if (err < 0)
goto error_pm;
return 0;
error_pm:
- pm_runtime_put_noidle(op->ss->dev);
crypto_free_ahash(op->fallback_tfm);
return err;
}
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/3] crypto: ccree - Use pm_runtime_resume_and_get()
2026-09-22 3:19 [PATCH 0/3] crypto: Use pm_runtime_resume_and_get() phucduc.bui
2026-09-22 3:19 ` [PATCH 1/3] crypto: sun8i-ss - " phucduc.bui
@ 2026-09-22 3:19 ` phucduc.bui
2026-09-22 3:19 ` [PATCH 3/3] crypto: sl3516 " phucduc.bui
2 siblings, 0 replies; 4+ messages in thread
From: phucduc.bui @ 2026-09-22 3:19 UTC (permalink / raw)
To: Corentin Labbe, Herbert Xu, davem, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Gilad Ben-Yossef, Hans Ulli Kroll, Linus Walleij,
linux-crypto, linux-arm-kernel
Cc: linux-sunxi, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Replace the open-coded pm_runtime_get_sync() + pm_runtime_put_noidle()
error handling pattern with pm_runtime_resume_and_get(), which already
does this internally.
No functional change.
Found by manual code inspection.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/crypto/ccree/cc_pm.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/crypto/ccree/cc_pm.c b/drivers/crypto/ccree/cc_pm.c
index bbd118f8de0e..666866119588 100644
--- a/drivers/crypto/ccree/cc_pm.c
+++ b/drivers/crypto/ccree/cc_pm.c
@@ -66,13 +66,7 @@ const struct dev_pm_ops ccree_pm = {
int cc_pm_get(struct device *dev)
{
- int rc = pm_runtime_get_sync(dev);
- if (rc < 0) {
- pm_runtime_put_noidle(dev);
- return rc;
- }
-
- return 0;
+ return pm_runtime_resume_and_get(dev);
}
void cc_pm_put_suspend(struct device *dev)
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 3/3] crypto: sl3516 - Use pm_runtime_resume_and_get()
2026-09-22 3:19 [PATCH 0/3] crypto: Use pm_runtime_resume_and_get() phucduc.bui
2026-09-22 3:19 ` [PATCH 1/3] crypto: sun8i-ss - " phucduc.bui
2026-09-22 3:19 ` [PATCH 2/3] crypto: ccree " phucduc.bui
@ 2026-09-22 3:19 ` phucduc.bui
2 siblings, 0 replies; 4+ messages in thread
From: phucduc.bui @ 2026-09-22 3:19 UTC (permalink / raw)
To: Corentin Labbe, Herbert Xu, davem, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Gilad Ben-Yossef, Hans Ulli Kroll, Linus Walleij,
linux-crypto, linux-arm-kernel
Cc: linux-sunxi, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Replace the open-coded pm_runtime_get_sync() + pm_runtime_put_noidle()
error handling pattern with pm_runtime_resume_and_get(), which already
does this internally.
No functional change.
Found by manual code inspection.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/crypto/gemini/sl3516-ce-cipher.c | 3 +--
drivers/crypto/gemini/sl3516-ce-rng.c | 6 ++----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/crypto/gemini/sl3516-ce-cipher.c b/drivers/crypto/gemini/sl3516-ce-cipher.c
index 02ec4282333b..eba46aebf176 100644
--- a/drivers/crypto/gemini/sl3516-ce-cipher.c
+++ b/drivers/crypto/gemini/sl3516-ce-cipher.c
@@ -331,13 +331,12 @@ int sl3516_ce_cipher_init(struct crypto_tfm *tfm)
crypto_tfm_alg_driver_name(&sktfm->base),
crypto_tfm_alg_driver_name(crypto_skcipher_tfm(op->fallback_tfm)));
- err = pm_runtime_get_sync(op->ce->dev);
+ err = pm_runtime_resume_and_get(op->ce->dev);
if (err < 0)
goto error_pm;
return 0;
error_pm:
- pm_runtime_put_noidle(op->ce->dev);
crypto_free_skcipher(op->fallback_tfm);
return err;
}
diff --git a/drivers/crypto/gemini/sl3516-ce-rng.c b/drivers/crypto/gemini/sl3516-ce-rng.c
index 76931ec1cec5..19af03b03e42 100644
--- a/drivers/crypto/gemini/sl3516-ce-rng.c
+++ b/drivers/crypto/gemini/sl3516-ce-rng.c
@@ -24,11 +24,9 @@ static int sl3516_ce_rng_read(struct hwrng *rng, void *buf, size_t max, bool wai
ce->hwrng_stat_bytes += max;
#endif
- err = pm_runtime_get_sync(ce->dev);
- if (err < 0) {
- pm_runtime_put_noidle(ce->dev);
+ err = pm_runtime_resume_and_get(ce->dev);
+ if (err < 0)
return err;
- }
while (read < max) {
*data = readl(ce->base + IPSEC_RAND_NUM_REG);
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-22 3:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22 3:19 [PATCH 0/3] crypto: Use pm_runtime_resume_and_get() phucduc.bui
2026-09-22 3:19 ` [PATCH 1/3] crypto: sun8i-ss - " phucduc.bui
2026-09-22 3:19 ` [PATCH 2/3] crypto: ccree " phucduc.bui
2026-09-22 3:19 ` [PATCH 3/3] crypto: sl3516 " phucduc.bui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®