Skip to contentSkip to conversation

crypto: omap-sham: remove redundant pm_runtime_dont_use_autosuspend() calls

PATCH In review Joshua Crofts 2 participants 3 messages Nov 7 – Nov 8 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: omap-sham: remove redundant pm_runtime_dont_use_autosuspend() calls

Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"), driver core is now responsible for undoing any
pm_runtime_use_autosuspend() calls on driver exit.

Remove the redundant function calls.

---
 drivers/crypto/omap-sham.c | 2 --
 1 file changed, 2 deletions(-)
drivers/crypto/omap-sham.c +0 -2
index 5e739415a010..72182f190084 100644
@@ -2109,7 +2109,6 @@ static int omap_sham_probe(struct platform_device *pdev)
 	list_del(&dd->list);
 	spin_unlock_bh(&sham.lock);
 err_pm:
-	pm_runtime_dont_use_autosuspend(dev);
 	pm_runtime_disable(dev);
 	if (!dd->polling_mode)
 		dma_release_channel(dd->dma_lch);
@@ -2131,7 +2130,6 @@ static void omap_sham_remove(struct platform_device *pdev)
 	omap_sham_unregister_algs(dd->pdata);
 	crypto_engine_exit(dd->engine);
 	cancel_work_sync(&dd->done_task);
-	pm_runtime_dont_use_autosuspend(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 
 	if (!dd->polling_mode)

---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261107-crypto-dont-use-autosuspend-removal-32f8d54397b6

Best regards,

Signature · 1 line
Joshua Crofts
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] crypto: omap-sham: missing runtime suspend before pm_runtime_disable() --

Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [High] crypto: omap-sham: missing runtime suspend before pm_runtime_disable()
--

commit 3e6145ea4d9da519423f99c72ef5ab8b8512ee57
Author: Joshua Crofts <[email protected]>

crypto: omap-sham: remove redundant pm_runtime_dont_use_autosuspend() calls

This commit removes the pm_runtime_dont_use_autosuspend() calls from the probe error path and driver remove callback in omap-sham.

Quoted 13 lines
drivers/crypto/omap-sham.c +0 -1
index 5e739415a0102..72182f1900849 100644
@@ -2109,7 +2109,6 @@ static int omap_sham_probe(struct platform_device *pdev)
 	list_del(&dd->list);
 	spin_unlock_bh(&sham.lock);
 err_pm:
-	pm_runtime_dont_use_autosuspend(dev);
 	pm_runtime_disable(dev);
 	if (!dd->polling_mode)
 		dma_release_channel(dd->dma_lch);

drivers/crypto/omap-sham.c static void omap_sham_remove(struct platform_device *pdev) · line 2135

Quoted 7 lines
drivers/crypto/omap-sham.c +0 -1
@@ -2131,7 +2130,6 @@ static void omap_sham_remove(struct platform_device *pdev)
 	omap_sham_unregister_algs(dd->pdata);
 	crypto_engine_exit(dd->engine);
 	cancel_work_sync(&dd->done_task);
-	pm_runtime_dont_use_autosuspend(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 
 	if (!dd->polling_mode)

[Severity: High]
Does removing pm_runtime_dont_use_autosuspend() before pm_runtime_disable() prevent .runtime_suspend from running on probe failure and driver removal?

Because autosuspend is enabled with a 1000 ms delay, pm_runtime_put_sync() in omap_sham_probe() and in __device_release_driver() before omap_sham_remove() only arms the autosuspend timer and leaves the device in RPM_ACTIVE. Previously, calling pm_runtime_dont_use_autosuspend() while runtime PM was still enabled triggered a synchronous rpm_idle() -> rpm_suspend() transition before pm_runtime_disable().

Without it, pm_runtime_disable() cancels the pending autosuspend timer and disables runtime PM while the device is still active. When pm_runtime_reinit() later runs in device_unbind_cleanup(), runtime PM is already disabled, so it only resets the software status to RPM_SUSPENDED via pm_runtime_set_suspended() without invoking .runtime_suspend. This leaves hardware clocks and the power domain enabled, and on OMAP2/OMAP3 platforms using omap_device_pm_domain, probe failure leaves od->_state at OMAP_DEVICE_STATE_ENABLED while runtime_status is RPM_SUSPENDED, causing any subsequent probe to fail with -EINVAL in omap_device_enable().

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/20261107-crypto-dont-use-autosuspend-removal-v1-1-62696ad3ff0e@kernel.org?part=1
#2 lore raw
In reply to Joshua Crofts
Quoted 24 lines · On Sat, 07 Nov 2026 13:39:43 +0100 Joshua Crofts <[email protected]> wrote:

Since commit d1706f9da9f4 ("PM: runtime: call pm_runtime_dont_use_autosuspend() on reinit()"), driver core is now responsible for undoing any
pm_runtime_use_autosuspend() calls on driver exit.

Remove the redundant function calls.

---
 drivers/crypto/omap-sham.c | 2 --
 1 file changed, 2 deletions(-)
drivers/crypto/omap-sham.c +0 -1
index 5e739415a010..72182f190084 100644
@@ -2109,7 +2109,6 @@ static int omap_sham_probe(struct platform_device *pdev)
 	list_del(&dd->list);
 	spin_unlock_bh(&sham.lock);
 err_pm:
-	pm_runtime_dont_use_autosuspend(dev);
 	pm_runtime_disable(dev);
 	if (!dd->polling_mode)
 		dma_release_channel(dd->dma_lch);

drivers/crypto/omap-sham.c static void omap_sham_remove(struct platform_device *pdev) · line 2134

Quoted 4 lines
drivers/crypto/omap-sham.c +0 -1
@@ -2131,7 +2130,6 @@ static void omap_sham_remove(struct platform_device *pdev)
 	omap_sham_unregister_algs(dd->pdata);
 	crypto_engine_exit(dd->engine);
 	cancel_work_sync(&dd->done_task);
-	pm_runtime_dont_use_autosuspend(&pdev->dev);

Okay, drop this patch for the time being - the dont_use_autosuspend() ensures that the .runtime_suspend callback is executed.

Thanks.

--
Kind regards,
Joshua Crofts