[PATCH 13/15] ARM: make mach/io.h include optional

Russell King - ARM Linux linux at arm.linux.org.uk
Tue Feb 14 12:40:35 EST 2012


On Tue, Feb 14, 2012 at 05:16:26PM +0000, Arnd Bergmann wrote:
> On Tuesday 14 February 2012, Rob Herring wrote:
> > On 02/14/2012 02:04 AM, Arnd Bergmann wrote:
> > > On Tuesday 14 February 2012, Rob Herring wrote:
> > > 
> > >> If we use CONFIG_PCI, then we have to move over all PCI enabled
> > >> platforms at once. With a separate kconfig option, then we can move
> > >> platforms one by one. Some are legacy and we may not want to move. This
> > >> also helped with omap, but Tony has now fixed it.
> > > 
> > > We could also generalize the implementation from tegra, which seems
> > > reasonable as a start:
> > > 
> > > 
> > > #define IO_SPACE_LIMIT 0xffff
> > > 
> > > #if defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
> > > #include <mach/io.h>
> > > #elif defined(CONFIG_PCI)
> > > extern void __iomem *pci_io_base;
> > > 
> > > static inline void __iomem *__io(unsigned long addr)
> > > {
> > >         return pci_io_base + (addr & IO_SPACE_LIMIT);
> > 
> > But don't we want a constant pci_io_base? This would certainly be a
> > quicker conversion, but I don't think we want to do it twice.
> 
> Yes, at least in the long run. Note that this should make no difference
> at all from a performance point of view, but it does impact code size a bit.

That depends whether the additional reloads of pci_io_base can be properly
scheduled by the compiler, and experience shows that you tend to end up
with the load delay slot _not_ being filled on older processors.

Not only that, but the compiler _will_ evaluate the entire:

	pci_io_base + (addr & IO_SPACE_LIMIT)

thing every time.  With a 64K mask, that will include _reloading_ the
mask every single access.

So, we'll probably end up with about three additional loads per IO
operation, none of which would be scheduled particularly well.

"Yuck" and "not in my kernel" comes to mind.



More information about the linux-arm-kernel mailing list