Linux PWM subsystem development
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <ukleinek@kernel.org>
To: Ruoyu Wang <ruoyuw560@gmail.com>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	 Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Axel Lin <axel.lin@ingics.com>,
	linux-pwm@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pwm: renesas-tpu: Fix runtime PM reference leak
Date: Sun, 16 Aug 2026 09:22:35 +0200	[thread overview]
Message-ID: <aoFj0SZppae0bAB_@monoceros> (raw)
In-Reply-To: <20260814134143.1388120-1-ruoyuw560@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1248 bytes --]

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@gmail.com>

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2026-08-16  7:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 13:41 [PATCH] pwm: renesas-tpu: Fix runtime PM reference leak Ruoyu Wang
2026-08-16  7:22 ` Uwe Kleine-König [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aoFj0SZppae0bAB_@monoceros \
    --to=ukleinek@kernel.org \
    --cc=axel.lin@ingics.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=ruoyuw560@gmail.com \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox