mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Sverdlin, Alexander" <alexander.sverdlin@siemens.com>
To: "linusw@kernel.org" <linusw@kernel.org>,
	"ssantosh@kernel.org" <ssantosh@kernel.org>,
	"brgl@kernel.org" <brgl@kernel.org>,
	"khilman@kernel.org" <khilman@kernel.org>,
	"congnt264@gmail.com" <congnt264@gmail.com>,
	"grygorii.strashko@ti.com" <grygorii.strashko@ti.com>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"1298662399@qq.com" <1298662399@qq.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] gpio: omap: do not unprepare the debounce clock twice on probe failure
Date: Tue, 24 Nov 2026 09:33:09 +0000	[thread overview]
Message-ID: <de693e03c94d53c97bcbcf1e0c2ac7067cb27a19.camel@siemens.com> (raw)
In-Reply-To: <20261124085231.3696739-1-congnt264@gmail.com>

Hi Cong,

thanks for the fix!

On Tue, 2026-11-24 at 15:52 +0700, Cong Nguyen wrote:
> The debounce clock is now obtained with devm_clk_get_prepared(), so
> devres unprepares it when probe fails or the device is unbound. The error
> path added for a failing pm_runtime_resume_and_get() still calls
> clk_unprepare() on the same clock by hand.
> 
> When pm_runtime_resume_and_get() fails and a debounce clock is present,
> the clock is unprepared twice. The second clk_unprepare() warns that the
> clock is already unprepared.
> 
> Drop the manual clk_unprepare().
> 
> This issue was found by auditing the driver with an LLM coding assistant.
> 
> Fixes: 9df982f1f283 ("gpio: omap: handle debounce clock preparation failure")
> Signed-off-by: Cong Nguyen <congnt264@gmail.com>

looks correct to me,
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>

Looks like the issue crept in because of the tight merges of
05be1a99d6d68 ("gpio: omap: Propagate runtime PM failures in probe and request"),
present in v7.4-rc3 (next-20261104) and the following merge of 9df982f1f283
("gpio: omap: handle debounce clock preparation failure") into next-20261119,
which wasn't based on at least v7.4-rc3.

> ---
>  drivers/gpio/gpio-omap.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index 0da628ae77be..0af26c3f7197 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1463,8 +1463,6 @@ static int omap_gpio_probe(struct platform_device *pdev)
>  	ret = pm_runtime_resume_and_get(dev);
>  	if (ret < 0) {
>  		pm_runtime_disable(dev);
> -		if (bank->dbck_flag)
> -			clk_unprepare(bank->dbck);
>  		return ret;
>  	}
>  

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com

      parent reply	other threads:[~2026-11-24  9:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24  8:52 Cong Nguyen
2026-11-24  9:30 ` Andreas Kemnade
2026-11-24  9:33 ` Sverdlin, Alexander [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=de693e03c94d53c97bcbcf1e0c2ac7067cb27a19.camel@siemens.com \
    --to=alexander.sverdlin@siemens.com \
    --cc=1298662399@qq.com \
    --cc=brgl@kernel.org \
    --cc=congnt264@gmail.com \
    --cc=grygorii.strashko@ti.com \
    --cc=khilman@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=ssantosh@kernel.org \
    /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

all inboxes | Powered by JetHome®