mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Sverdlin, Alexander" <alexander.sverdlin@siemens.com>
To: "1298662399@qq.com" <1298662399@qq.com>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH v2] gpio: omap: handle debounce clock preparation failure
Date: Tue, 10 Nov 2026 13:02:46 +0000	[thread overview]
Message-ID: <1ccf55859a5a2df75587274f70c7ae591d5b4d1e.camel@siemens.com> (raw)
In-Reply-To: <tencent_D8A4B6EE90931660EB6F586543FD58110E06@qq.com>

Hi Jiawen,

thank you for the patch!

On Mon, 2026-11-09 at 17:42 +0400, Jiawen Liu wrote:
> omap_gpio_probe() ignores the return value of clk_prepare() for the
> debounce clock. If preparation fails, the driver still treats debounce as
> available and may use or unprepare a clock that was not prepared.
> 
> Use devm_clk_get_prepared() and disable debounce if the clock cannot be
> obtained or prepared. This keeps the existing behavior for clock lookup
> failures. Remove both manual clk_unprepare() calls because the managed
> clock is released on probe failure and device removal.

The development history below could probably go below "---" so that
it doesn't appear in git history?

> An earlier managed-clock conversion was dropped after a reported boot
> failure. A follow-up removing the two manual unprepare calls was reported
> to restore boot. This change also removes those calls.
> Built gpio-omap.o with ARM multi_v7_defconfig and Clang 19; the current
> patch has not been tested on OMAP hardware.
> 
> The original report was generated using BMC-Agent; source review and
> maintainer feedback informed this revision.
> 
> Fixes: 5d9452e7c52a ("gpio: omap: fix clk_prepare/unprepare usage")
> Suggested-by: Andreas Kemnade <andreas@kemnade.info>
> Link: https://lore.kernel.org/r/tencent_B4F504456790E8BA3C4EAB80F4BFB6954E08@qq.com
> Link: https://lkml.rescloud.iu.edu/hypermail/linux/kernel/2412.2/00414.html
> Signed-off-by: Jiawen Liu <1298662399@qq.com>

other than above,
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>

The patch causes no regression on our AM335x HW deploying gpio-omap driver,
Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>

> ---
> Changes in v2:
> - Use devm_clk_get_prepared() and remove both manual unprepare calls.
> - Disable debounce on prepare failure, retaining clock-get failure behavior.
> - Add the Fixes tag and describe the earlier managed-clock attempt.
> 
> Built with ARCH=arm, LLVM=-19, multi_v7_defconfig, W=1 and
> CONFIG_GPIO_OMAP=y. No OMAP hardware test or current reproducer is available.
> 
>  drivers/gpio/gpio-omap.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index a9734b2a1..314bbb48e 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com

      reply	other threads:[~2026-11-10 13:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18 13:08 [PATCH] gpio: omap: handle clk_prepare failure in probe Jiawen Liu
2026-08-20  9:19 ` Markus Elfring
2026-08-20  9:48   ` Andreas Kemnade
2026-08-20 10:47     ` Markus Elfring
2026-08-20 13:43       ` Andreas Kemnade
2026-11-08 17:22         ` [PATCH] " Jiawen Liu
2026-11-09  5:47           ` Dan Carpenter
2026-11-09  9:08             ` Bartosz Golaszewski
2026-11-09  9:18               ` Markus Elfring
2026-08-20 12:25 ` [PATCH] " Andreas Kemnade
2026-11-09 13:42 ` [PATCH v2] gpio: omap: handle debounce clock preparation failure Jiawen Liu
2026-11-10 13:02   ` 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=1ccf55859a5a2df75587274f70c7ae591d5b4d1e.camel@siemens.com \
    --to=alexander.sverdlin@siemens.com \
    --cc=1298662399@qq.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.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®