Subject: [PATCH v3 1/3] ARM: Introduce atomic MMIO modify

From: [email-masked] (Jason Gunthorpe)
Date: Fri, 6 Sep 2013 10:48:44 -0600

On Thu, Sep 05, 2013 at 10:08:42AM +0100, Will Deacon wrote:

> > I would like to make the things move on about this subject. Should it
> > be possible to merge this version of the patch set? Currently the
> > only users of this new API are drivers for ARM SoCs.
> 
> In the short term then, I'd keep this restricted to ARM. Without relaxed
> accessors available across all architectures, I don't think we can make this
> usefully generic (a readX/writeX version would be horribly slow on ARM).

Realistically though, the current use cases for this function have it
called only a few times during startup, so it 'horribly slow' isn't
really important at all.

So why not start with this in generic headers:

extern void atomic_io_modify(void __iomem *reg, u32 mask, u32 set);
#define atomic_io_modify_relaxed atomic_io_modify

And the relaxed optimization can come along in due course?

Jason