[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=MfWD7XGuuiLd5_Sh1vODfE-v6suM3w=qdufxXPtkW+HVg@mail.gmail.com>
Date: Wed, 18 Jun 2025 19:00:17 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Marek Szyprowski <m.szyprowski@...sung.com>
Cc: Linus Walleij <linus.walleij@...aro.org>, Marek Behún <kabel@...nel.org>,
Conor Dooley <conor.dooley@...rochip.com>, Daire McNamara <daire.mcnamara@...rochip.com>,
Daniel Palmer <daniel@...ngy.jp>, Romain Perier <romain.perier@...il.com>,
Avi Fishman <avifishman70@...il.com>, Tomer Maimon <tmaimon77@...il.com>,
Tali Perry <tali.perry1@...il.com>, Patrick Venture <venture@...gle.com>,
Nancy Yuen <yuenn@...gle.com>, Benjamin Fair <benjaminfair@...gle.com>,
Grygorii Strashko <grygorii.strashko@...com>, Santosh Shilimkar <ssantosh@...nel.org>,
Kevin Hilman <khilman@...nel.org>, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, openbmc@...ts.ozlabs.org,
linux-omap@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH 01/12] gpio: mmio: use new GPIO line value setter callbacks
On Wed, Jun 18, 2025 at 6:43 PM Marek Szyprowski
<m.szyprowski@...sung.com> wrote:
>
> A few more changes are needed to avoid NULL pointer dereference
> (observed on RasbperrryPi5), because this driver calls ->set method
> internally:
>
> diff --git a/drivers/gpio/gpio-mmio.c b/drivers/gpio/gpio-mmio.c
> index 9169eccadb23..57622f45d33e 100644
> --- a/drivers/gpio/gpio-mmio.c
> +++ b/drivers/gpio/gpio-mmio.c
> @@ -362,7 +362,7 @@ static int bgpio_dir_out_err(struct gpio_chip *gc,
> unsigned int gpio,
> static int bgpio_simple_dir_out(struct gpio_chip *gc, unsigned int gpio,
> int val)
> {
> - gc->set(gc, gpio, val);
> + gc->set_rv(gc, gpio, val);
>
> return bgpio_dir_return(gc, gpio, true);
> }
> @@ -427,14 +427,14 @@ static int bgpio_dir_out_dir_first(struct
> gpio_chip *gc, unsigned int gpio,
> int val)
> {
> bgpio_dir_out(gc, gpio, val);
> - gc->set(gc, gpio, val);
> + gc->set_rv(gc, gpio, val);
> return bgpio_dir_return(gc, gpio, true);
> }
>
> static int bgpio_dir_out_val_first(struct gpio_chip *gc, unsigned int
> gpio,
> int val)
> {
> - gc->set(gc, gpio, val);
> + gc->set_rv(gc, gpio, val);
> bgpio_dir_out(gc, gpio, val);
> return bgpio_dir_return(gc, gpio, true);
> }
>
> Do You want a formal patch with the above changes, or will You just
> amend them to the updated patch?
>
Thanks, a patch[1] is already up for review. Please give it a try and
leave your Tested-by: if you can.
Bartosz
[1] https://lore.kernel.org/all/20250618-gpio-mmio-fix-setter-v1-2-2578ffb77019@linaro.org/
Powered by blists - more mailing lists