Re: [PATCH] pwm: renesas-tpu: Fix runtime PM reference leak

Uwe Kleine-König <[email protected]>
Newsgroups org.kernel.vger.linux-pwm,org.kernel.vger.linux-kernel
Message-ID <aoFj0SZppae0bAB_@monoceros>
Hello,

On Fri, Aug 14, 2026 at 09:41:43PM +0800, Ruoyu Wang wrote:
> tpu_pwm_timer_start() used pm_runtime_get_sync() without checking its
> return value before touching the TPU clock.  A failed runtime resume was
> therefore ignored, and the callback continued into register access.
> 
> Use pm_runtime_resume_and_get() and propagate a failed resume.  Keep the
> matching put when clock preparation fails after a successful resume.
> 
> tpu_pwm_disable() also needs to propagate a failed start so that the PWM
> apply callback does not access registers while runtime PM is inactive.
> 
> This issue was found by a static analysis checker and confirmed by manual
> source review.
> 
> Fixes: 99b82abb0a35 ("pwm: Add Renesas TPU PWM driver")
> Signed-off-by: Ruoyu Wang <[email protected]>

Looks good to me. While it's a fix, I think it's not very urgent, we
lived with that since 13 years and is very unlikely to trigger.

So I applied it to

https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-nexxt

as 7.4-rc1 material. This branch isn't written in stone, so I'll still
take acks for the patch, and I will rebase it to 7.3-rc1 once that is
available.

Thanks for your contribution,
Uwe
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmqBZTgACgkQj4D7WH0S
/k49/ggAlHuqL+xin6L/iSiHBkkVaSROb/IrsOy80BuTIxg4TG79Bo6WmgkR6AaR
8uvDVjPBCr8s4vJQNjN294jivHcFhs6XwcGBjnU64eVkHgR8UqOB7vsQUF9fOJB/
Flp9wwUfFM0T2zIXokF4W4it0nsCoPihouRroGi2YnKDYyK2kliefqnuMa61+jEV
GGExJ39FOura+5jEnUgF3fQZHyHkMj1ICtQHGNa1NwqiXrjnPkkMoMI8+LecRroK
qu6vR0fiORsoNqZ3gyVVq4+xFySdxwqxkynPipoEmk8/WFaXgZH/SNlLXYFe1v0s
XMkVEF3FV8gKqc9GQr6GPKFG/W8D9g==
=Zz9y
-----END PGP SIGNATURE-----
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.