[PATCH 1/2] arm/mach-imx: use endian-safe readl/readw/writel/writew

Johannes Berg johannes at sipsolutions.net
Mon Jan 25 02:43:38 PST 2016


On Sun, 2016-01-24 at 22:28 +0100, Arnd Bergmann wrote:
> 
> The patch looks fine to me, in the sense that we can safely assume
> that the behavior won't change for little-endian, and that it is
> fixing a bug for big-endian.
> 
> I would feel more comfortable with a patch using the non-relaxed()
> accessors though, as that can avoid a number of subtle bugs with
> I/O ordering.

I could easily generate this, obviously, the spatch was above :)

> Unfortunately, there is a nonzero overhead in the extra cache sync
> on the Cortex-A9 based platforms (most imx6), so this has to
> be done very carefully to avoid performance regressions. It's
> probably a good idea to keep the two changes as separate commits,
> but I'd also like to get both applied in the same merge window,
> as 'readl_relaxed' tends to say "I have proven that I don't need
> barriers", while the existing code just screams "I have no idea
> about what I'm doing here".

So does my patch, and I'm not sure I'm qualified to really judge which
ones need to be relaxed for performance reasons and which ones should
be changed.


johannes



More information about the linux-arm-kernel mailing list