Re: [PATCH v2 1/4] drivers/net/b44: Change to non-atomic bit operations
From: Peter Zijlstra
Date: Wed Dec 04 2019 - 10:20:02 EST
On Tue, Nov 26, 2019 at 09:49:08AM +0000, David Laight wrote:
> > memset(ppattern + offset, 0xff, magicsync);
> > for (j = 0; j < magicsync; j++)
> > - set_bit(len++, (unsigned long *) pmask);
> > + __set_bit(len++, (unsigned long *)pmask);
>
> While this stops the misaligned locks, the code is still horribly borked on BE systems.
Quite so.
> The way pmask is used definitely wanst a u32[] not a u64[] one.
Not sure, the code seems fairly consistent in using u8[].
And I suppose we can write the above like:
pmask[len >> 3] |= BIT(len & 7); len++;
instead.