Re: [PATCH v2 07/11] bitmap: Introduce bitmap_replace() helper

From: Andy Shevchenko
Date: Wed Jan 08 2020 - 13:10:36 EST


On Thu, Dec 26, 2019 at 08:15:59AM -0800, Guenter Roeck wrote:
> Hi,
>
> On Tue, Oct 22, 2019 at 08:29:18PM +0300, Andy Shevchenko wrote:
> > In some drivers we want to have a single operation over bitmap which is
> > an equivalent to:
> >
> > *dst = (*old & ~(*mask)) | (*new & *mask)
> >
> > Introduce bitmap_replace() helper for this.
> >
> > Cc: Yury Norov <ynorov@xxxxxxxxxxx>
> > Cc: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>
> This patch results in the following boot log messages on various architectures.
> I have seen it on arm and mipsel, but others may be affected as well.

Thanks for report. I can reproduce on x86_32, and not on x86_64.
I'll look at it.

>
> test_bitmap: [lib/test_bitmap.c:282] bitmaps contents differ: expected "0-1,4-5,8,12-13,16,20-21,24,28,32-33,36-37,40-41,44-45,48-49,52-53,56-57,60-61", got "0-2,4-5,8,12-13,16,20-21,24,28,32-33,36-37,40-41,44-45,48-49,52-53,55-57,60-61"
> test_bitmap: [lib/test_bitmap.c:286] bitmaps contents differ: expected "0,4,8-9,12,16-17,20,24-25,28-29,32-34,36-38,40-42,44-46,48-50,52-54,56-58,60-62", got "0,4,6,8-10,12,14,16-18,20,22,24-26,28-30,32-54,56-63"
> test_bitmap: [lib/test_bitmap.c:290] bitmaps contents differ: expected "0-1,4-5,8,12-13,16,20-21,24,28,32-33,36-37,40-41,44-45,48-49,52-53,56-57,60-61", got "0-2,4-5,8,12-13,16,20-21,24,28,32-33,36-37,40-41,44-45,48-49,52-53,55-57,60-61"
> test_bitmap: [lib/test_bitmap.c:294] bitmaps contents differ: expected "0,4,8-9,12,16-17,20,24-25,28-29,32-34,36-38,40-42,44-46,48-50,52-54,56-58,60-62", got "0,4,6,8-10,12,14,16-18,20,22,24-26,28-30,32-54,56-63"
>
> Guenter

--
With Best Regards,
Andy Shevchenko