Re: [PATCH v2] gpiolib: cdev: don't set GPIOD_FLAG_IS_OUT
From: Bartosz Golaszewski
Date: Mon Oct 19 2026 - 04:05:18 EST
On Fri, 16 Oct 2026 12:22:58 +0300, Adrian Ambrozewicz wrote:
> When a line is requested or reconfigured through the v2 uAPI,
> gpio_v2_line_config_flags_to_desc_flags() copies the requested
> configuration into the descriptor flags, GPIOD_FLAG_IS_OUT included,
> before gpiod_direction_input_nonotify() or
> gpiod_direction_output_nonotify() asks the driver for the direction.
> If the driver refuses, for instance with -EOPNOTSUPP from
> .direction_input() for a line that can only be an output, the ioctl
> fails but the flag keeps the refused direction. gpiod_free_commit()
> does not touch GPIOD_FLAG_IS_OUT, so this outlives the failed request,
> and GPIO_V2_GET_LINEINFO_IOCTL reports the line as an input while the
> hardware still drives it, until a request without direction flags
> makes gpiod_request_commit() read the direction back from the driver:
>
> [...]
Applied, thanks!
[1/1] gpiolib: cdev: don't set GPIOD_FLAG_IS_OUT
https://git.kernel.org/brgl/c/974d2712cb15014019595799b3ed68fef5fe9695
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>