Re: [PATCH] crypto: sl3516: fix autosuspend cleanup during teardown

Linus Walleij <[email protected]>
Newsgroups org.kernel.vger.linux-crypto,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <CAD++jLkcpHW-YKscKfMYRdD_T483jcUBYjz4gbP3EbV0fVLATg@mail.gmail.com>
On Sat, Aug 8, 2026 at 11:26 AM Guangshuo Li <[email protected]> wrote:

> sl3516_ce_pm_init() calls pm_runtime_use_autosuspend(), but the
> autosuspend setting is not undone if pm_runtime_set_suspended() fails
> or when runtime PM is later torn down by sl3516_ce_pm_exit().
>
> If the autosuspend delay is set to a negative value while autosuspend
> is enabled, the runtime PM core increments usage_count to prevent
> runtime suspend. Without calling pm_runtime_dont_use_autosuspend()
> during cleanup, this reference is not dropped and usage_count remains
> unbalanced.
>
> Undo the autosuspend setting when pm_runtime_set_suspended() fails and
> in sl3516_ce_pm_exit() before disabling runtime PM.
>
> This issue was found by manual code inspection.
>
> Fixes: 46c5338db7bd ("crypto: sl3516 - Add sl3516 crypto engine")
> Cc: [email protected]
> Signed-off-by: Guangshuo Li <[email protected]>

Looks right to me!
Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.