lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdaS3oEyQjuHK2LVKKGws8CEdgzhWVGEfjJPY+a0ndt0-w@mail.gmail.com>
Date: Tue, 20 Feb 2024 09:41:21 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Emil Renner Berthing <emil.renner.berthing@...onical.com>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Bartosz Golaszewski <brgl@...ev.pl>, Jisheng Zhang <jszhang@...nel.org>, 
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, 
	Mika Westerberg <mika.westerberg@...ux.intel.com>
Subject: Re: [PATCH v1] gpiolib: Handle no pin_ranges in gpiochip_generic_config()

On Mon, Feb 19, 2024 at 6:25 PM Emil Renner Berthing
<emil.renner.berthing@...onical.com> wrote:

> Similar to gpiochip_generic_request() and gpiochip_generic_free() the
> gpiochip_generic_config() function needs to handle the case where there
> are no pinctrl pins mapped to the GPIOs, usually through the gpio-ranges
> device tree property.
>
> Commit f34fd6ee1be8 ("gpio: dwapb: Use generic request, free and
> set_config") set the .set_config callback to gpiochip_generic_config()
> in the dwapb GPIO driver so the GPIO API can set pinctrl configuration
> for the corresponding pins. Most boards using the dwapb driver do not
> set the gpio-ranges device tree property though, and in this case
> gpiochip_generic_config() would return -EPROPE_DEFER rather than the
> previous -ENOTSUPP return value. This in turn makes
> gpio_set_config_with_argument_optional() fail and propagate the error to
> any driver requesting GPIOs.
>
> Fixes: 2956b5d94a76 ("pinctrl / gpio: Introduce .set_config() callback for GPIO chips")
> Reported-by: Jisheng Zhang <jszhang@...nel.org>
> Closes: https://lore.kernel.org/linux-gpio/ZdC_g3U4l0CJIWzh@xhacker/
> Tested-by: Jisheng Zhang <jszhang@...nel.org>
> Signed-off-by: Emil Renner Berthing <emil.renner.berthing@...onical.com>

Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

> I didn't add your rb since I don't think
>   if (IS_ENABLED(CONFIG_PINCTRL) && list_empty(&gc->gpiodev->pin_ranges))
> will work when the pin_ranges member is only there then when
> CONFIG_PINCTRL is defined and it seemed like your rb was on the
> condition that I used that.

I was wrong about that!

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ