crypto: Use pm_runtime_resume_and_get()
Subsystems (6)
cover crypto: Use pm_runtime_resume_and_get()
From: bui duc phuc <[email protected]>
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(-)
Signature · 1 line
2.43.0
PATCH 1/3 crypto: sun8i-ss - Use pm_runtime_resume_and_get()
From: bui duc phuc <[email protected]>
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.
--- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c +1 -2
@@ -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; }
Signature · 1 line
2.43.0
PATCH 2/3 crypto: ccree - Use pm_runtime_resume_and_get()
In reply to [email protected]From: bui duc phuc <[email protected]>
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.
--- drivers/crypto/ccree/cc_pm.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/crypto/ccree/cc_pm.c +1 -7
@@ -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)
Signature · 1 line
2.43.0
PATCH 3/3 crypto: sl3516 - Use pm_runtime_resume_and_get()
In reply to [email protected]From: bui duc phuc <[email protected]>
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.
--- drivers/crypto/gemini/sl3516-ce-cipher.c | 3 +-- drivers/crypto/gemini/sl3516-ce-rng.c | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-)
drivers/crypto/gemini/sl3516-ce-cipher.c +1 -2
@@ -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; }
drivers/crypto/gemini/sl3516-ce-rng.c +2 -4
@@ -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 );
Signature · 1 line
2.43.0
Re: [PATCH 3/3] crypto: sl3516 - Use pm_runtime_resume_and_get()
Quoted 11 lines · On Tue, Sep 22, 2026 at 5:20 AM <[email protected]> wrote:
From: bui duc phuc <[email protected]>
Replace the open-coded
pm_runtime_get_sync()+pm_runtime_put_noidle()error handling pattern withpm_runtime_resume_and_get(), which already does this internally.No functional change.
Found by manual code inspection.
Signed-off-by bui duc phuc <[email protected]>
Yours,
Linus Walleij
Herbert Xu
maintainerQuoted 18 lines · On Tue, Sep 22, 2026 at 10:19:51AM +0700, [email protected] wrote:
From: bui duc phuc <[email protected]>
Hi all,
This series replaces open-coded
pm_runtime_get_sync()andpm_runtime_put_noidle()error handling withpm_runtime_resume_and_get()in several crypto drivers.No functional change intended.
Best regards,
Phucbui duc phuc (3):
crypto: sun8i-ss - Usepm_runtime_resume_and_get()
crypto: ccree - Usepm_runtime_resume_and_get()
crypto: sl3516 - Usepm_runtime_resume_and_get()
Quoted 8 lines
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(-)Signature · 1 line
2.43.0
All applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt