Re: [PATCH] bitops: Use volatile in generic atomic bitops.

From: Arnd Bergmann
Date: Wed Jul 27 2011 - 08:55:54 EST


On Wednesday 27 July 2011, Will Newton wrote:
> The generic atomic bitops currently explicitly cast away the
> volatile from the pointer passed to them. This will allow the
> access to the bitfield to happen outside of the critical section
> thus making the bitops no longer interrupt-safe. Remove this cast
> and add a volatile keyword to make sure all accesses to the
> bitfield happen inside the critical section.
>
> Signed-off-by: Will Newton <will.newton@xxxxxxxxxx>

Have you observed this behavior? The interrupt disable/enable should
always come with a barrier that should prevent the bitops from
leaking out, so I don't see how this causes problems in practice.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/