Re: [PATCH v2] gpio: omap: handle debounce clock preparation failure

From: Linus Walleij

Date: Tue Nov 17 2026 - 09:04:49 EST


On Mon, Nov 9, 2026 at 2:42 PM Jiawen Liu <1298662399@xxxxxx> 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.
>
> 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@xxxxxxxxxxxx>
> Link: https://lore.kernel.org/r/tencent_B4F504456790E8BA3C4EAB80F4BFB6954E08@xxxxxx
> Link: https://lkml.rescloud.iu.edu/hypermail/linux/kernel/2412.2/00414.html
> Signed-off-by: Jiawen Liu <1298662399@xxxxxx>

Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij