Re: [PATCH v3 5/5] gpio: cdev: don't overwrite the whole flags field when configuring lines
From: Bartosz Golaszewski
Date: Fri Nov 13 2026 - 06:46:29 EST
On Fri, Nov 13, 2026 at 11:19:43AM +0800, Kent Gibson wrote:
> On Tue, Nov 10, 2026 at 02:47:05PM +0100, Bartosz Golaszewski wrote:
> > linehandle_flags_to_desc_flags() and
> > gpio_v2_line_config_flags_to_desc_flags() read the flags word with
> > READ_ONCE(), modify the local copy and write it back with WRITE_ONCE().
> >
> > The per-request config_mutex does not exclude sysfs, the irq core or
> > drivers touching the same descriptor, so bits they set or clear
> > concurrently can be lost.
> >
> > Build the mask of bits owned by the line configuration and their new
> > values locally and apply them with gpiod_update_flags(). The whole
> > group changes in a single atomic step.
> >
> > While at it: rename the functions whose semantics changed from
> > "conversion" to "flags update" accordingly.
> >
> > Cc: stable@xxxxxxxxxxxxxxx
> > Fixes: b7adfb6076ff ("gpio: cdev: update flags at once when reconfiguring from user-space")
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
> > ---
>
> Reviewed-by: Kent Gibson <warthog618@xxxxxxxxx>
>
> for the series.
>
If it's for the series, would you mind leaving the tag under the cover
letter so that b4 can pick it up automatically?
Thanks,
Bartosz