Re: [PATCH v5 0/2] Fix Nvidia BlueField-3 GPIO access

From: Linus Walleij
Date: Mon Aug 21 2023 - 03:31:30 EST


On Fri, Aug 18, 2023 at 6:43 PM Asmaa Mnebhi <asmaa@xxxxxxxxxx> wrote:

> Fix Nvidia BlueField-3 GPIO access via libgpiod gpioset tool.
> gpioset tool fails to modify the GPIO value due to the following:
> 1) the pinctrl-mlxbf3 driver defines mlxbf3_gpio_request_enable()
> to enable software to take control over a gpio. Only then can
> the gpio-mlxbf3 driver modify the direction and value of the
> gpio. mlxbf3_gpio_disable_free() gives control back to hardware
> and is called when the "gpioset" command is invoked.
> This cancels out the effort to change the GPIO value and
> direction. So mlxbf3_gpio_disable_free() needs to be removed.
> 2) the gpio-mlxbf3 driver calls gpiochip_generic_request() which
> calls mlxbf3_gpio_request_enable(). "pin_ranges" needs not to be
> empty for mlxbf3_gpio_request_enable() to be invoked. So
> gpio-mlxbf3 needs to populate "pin_ranges".

This patch set looks good to me!
Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Yours,
Linus Walleij