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

From: Uwe Kleine-König

Date: Sun Aug 16 2026 - 03:22:46 EST


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 <ruoyuw560@xxxxxxxxx>

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

Attachment: signature.asc
Description: PGP signature