Re: [PATCH] gpio: sim: fix setting and getting multiple lines
From: Bartosz Golaszewski
Date: Wed Apr 13 2022 - 15:22:33 EST
On Wed, Apr 13, 2022 at 6:57 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> On Wed, Apr 13, 2022 at 04:01:32PM +0200, Bartosz Golaszewski wrote:
> > We need to take mask into account in the set/get_multiple() callbacks.
> > Use bitmap_replace() instead of bitmap_copy().
>
> Good catch!
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>
I've actually spent two days tracking this. I noticed that a single
test-case in libgpiod v2 fails sometimes (about 1 in 10 runs) and
suspected some race condition but couldn't find any. Turned out it was
triggered by not masking the bits but would only be triggered if the
memory which got passed to the callbacks got written over with some
other values than zeroes.
Bart