[PATCH v3 02/30] ARM: provide runtime hook for ioremap/iounmap

Rob Herring robherring2 at gmail.com
Mon Mar 5 23:07:37 EST 2012


On 03/05/2012 03:11 PM, Nicolas Pitre wrote:
> On Mon, 5 Mar 2012, Arnd Bergmann wrote:
> 
>> On Monday 05 March 2012, Nicolas Pitre wrote:
>>> Given that the majority of existing platforms don't need the 
>>> indirection, should we make this indirection conditional on 
>>> CONFIG_NEED_IOREMAP_HOOK and let those who need it select it?  Or maybe 
>>> this isn't performance critical and we just don't care?  In any case I'd 
>>> like to see such reasoning captured in the commit log.
>>
>> It's certainly not performance critical, but there may be some space overhead
>> in the .text section of the kernel that we could avoid by adding another
>> indirection.
> 
> Of course the size issue can be mitigated significantly by replacing:
> 
> extern void __iomem * (*arch_ioremap)(unsigned long, size_t, unsigned int);
> extern void (*arch_iounmap)(volatile void __iomem *);
> 
> #define __arch_ioremap                 arch_ioremap
> #define __arch_iounmap                 arch_iounmap
> 
> by:
> 
> extern void __iomem * (*arch_ioremap)(unsigned long, size_t, unsigned int);
> extern void (*arch_iounmap)(volatile void __iomem *);
> 
> extern void __iomem * __arch_ioremap(unsigned long, size_t, unsigned int);
> extern void __arch_iounmap(volatile void __iomem *);
> 
> and out of line:
> 
> void __iomem *__arch_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
> {
> 	return arch_ioremap(phys_addr, size, mtype);
> }
> 
> void __arch_iounmap(volatile void __iomem *io_addr)
> {
> 	arch_iounmap(io_addr);
> }

This doesn't quite work if we keep the compile time option, but I came
up with something that accomplishes the same thing.

There's not much point in converting ixp4xx and ebsa110 to runtime hooks
as they still have other io.h needs.

Rob



More information about the linux-arm-kernel mailing list