Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Arnd Bergmann
On Tuesday 11 December 2012, Russell King - ARM Linux wrote: > > On Tue, Dec 11, 2012 at 04:15:02PM +, Arnd Bergmann wrote: > > On Tuesday 11 December 2012, Thomas Petazzoni wrote: > > > On Tue, 11 Dec 2012 10:43:49 +, Arnd Bergmann wrote: > > > > On Friday 07 December 2012, Thomas

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Arnd Bergmann
On Tuesday 11 December 2012, Alan Cox wrote: > > Plus, if you have IO space support, you must have some MMIO region for > > them to target - doing what many platforms have done to date and targetted > > ISA IO address 0 at virtual address 0 is just not on because as soon as > > you build a device

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Arnd Bergmann
On Tuesday 11 December 2012, Alan Cox wrote: > The "no I/O space" case really applies to things like the S/390 mainframe > which simply have no such concept on the system or the devices. In the > ARM case the bus has an I/O space and the bridge glues the processors > simpler model to the bridge

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 05:45:09PM +, Alan Cox wrote: > > The problem comes when you end up trying to deal with stuff which > > uses ioread{8,16} on ioport_map() cookies where it's assumed that > > adding N to the cookie is the same as adding N to the port address. > > It's a cookie - this

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Alan Cox
> The problem comes when you end up trying to deal with stuff which > uses ioread{8,16} on ioport_map() cookies where it's assumed that > adding N to the cookie is the same as adding N to the port address. It's a cookie - this isn't a problem, you can support it via the mapping approah. Whether

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 05:16:10PM +, Alan Cox wrote: > > Correct. If HAS_IOPORT is not selected then we are potentially missing > > the dependent functions (because the platform has no IOPORT support) _or_ > > it does have ISA/PCI IO spaces _but_ they're not mappable via the > > ioport_map()

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Alan Cox
> with it. It's very simple. The IO port space is for ISA/PCMCIA and > PCI IO port regions. It is nothing more than that. And on a lot of devices the LPC bus. > Plus, if you _have_ IO space support, you must have some MMIO region for > them to target - doing what many platforms have done to

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Alan Cox
> Could you enlighten my very naive understanding of things about PCI/ISA > IO space? On x86, I seem to understand this is the separate address > space accessed by the special in/out CPU instructions. Are there ARM > platforms with the same sort of things? An x86 processor has two address spaces

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Alan Cox
> Correct. If HAS_IOPORT is not selected then we are potentially missing > the dependent functions (because the platform has no IOPORT support) _or_ > it does have ISA/PCI IO spaces _but_ they're not mappable via the > ioport_map() mechanism due to some non-linearity involved in the >

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 05:30:13PM +0100, Thomas Petazzoni wrote: > arch/arm/mm/iomap.c is unconditionally compiled in all ARM kernels. And > in this file, ioport_map() and ioport_unmap() are implement as soon as > __io is defined. And basically, in arch/arm/include/asm/io.h, __io is > defined for

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 05:38:19PM +0100, Thomas Petazzoni wrote: > Russell, > > On Tue, 11 Dec 2012 16:23:25 +, Russell King - ARM Linux wrote: > > > > * ARCH_VEXPRESS should not select NO_IOPORT. It's generally wrong > > > to select this in combination with ARCH_MULTIPLATFORM, when some

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 05:30:13PM +0100, Thomas Petazzoni wrote: > arch/arm/mm/iomap.c is unconditionally compiled in all ARM kernels. And > in this file, ioport_map() and ioport_unmap() are implement as soon as > __io is defined. And basically, in arch/arm/include/asm/io.h, __io is > defined for

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Thomas Petazzoni
Russell, On Tue, 11 Dec 2012 16:23:25 +, Russell King - ARM Linux wrote: > > * ARCH_VEXPRESS should not select NO_IOPORT. It's generally wrong > > to select this in combination with ARCH_MULTIPLATFORM, when some > > of the other platforms you may enable actually have IOPORT mapping > >

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Thomas Petazzoni
Dear Arnd Bergmann, On Tue, 11 Dec 2012 16:15:02 +, Arnd Bergmann wrote: > What you describe here are probable two bugs, and we should fix both: > > * ARCH_VEXPRESS should not select NO_IOPORT. It's generally wrong > to select this in combination with ARCH_MULTIPLATFORM, when some > of

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 10:43:49AM +, Arnd Bergmann wrote: > On Friday 07 December 2012, Thomas Petazzoni wrote: > > The pcim_*() functions are used by the libata-sff subsystem, and this > > subsystem is used for many SATA drivers on ARM platforms that do not > > necessarily have I/O ports. >

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 04:15:02PM +, Arnd Bergmann wrote: > On Tuesday 11 December 2012, Thomas Petazzoni wrote: > > On Tue, 11 Dec 2012 10:43:49 +, Arnd Bergmann wrote: > > > On Friday 07 December 2012, Thomas Petazzoni wrote: > > > > The pcim_*() functions are used by the libata-sff

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Arnd Bergmann
On Tuesday 11 December 2012, Thomas Petazzoni wrote: > On Tue, 11 Dec 2012 10:43:49 +, Arnd Bergmann wrote: > > On Friday 07 December 2012, Thomas Petazzoni wrote: > > > The pcim_*() functions are used by the libata-sff subsystem, and this > > > subsystem is used for many SATA drivers on ARM

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Thomas Petazzoni
Dear Arnd Bergmann, On Tue, 11 Dec 2012 10:43:49 +, Arnd Bergmann wrote: > On Friday 07 December 2012, Thomas Petazzoni wrote: > > The pcim_*() functions are used by the libata-sff subsystem, and this > > subsystem is used for many SATA drivers on ARM platforms that do not > > necessarily

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Arnd Bergmann
On Friday 07 December 2012, Thomas Petazzoni wrote: > The pcim_*() functions are used by the libata-sff subsystem, and this > subsystem is used for many SATA drivers on ARM platforms that do not > necessarily have I/O ports. I think this one is wrong as the CONFIG_HAS_IOPORT does not refer to the

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Arnd Bergmann
On Friday 07 December 2012, Thomas Petazzoni wrote: The pcim_*() functions are used by the libata-sff subsystem, and this subsystem is used for many SATA drivers on ARM platforms that do not necessarily have I/O ports. I think this one is wrong as the CONFIG_HAS_IOPORT does not refer to the

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Thomas Petazzoni
Dear Arnd Bergmann, On Tue, 11 Dec 2012 10:43:49 +, Arnd Bergmann wrote: On Friday 07 December 2012, Thomas Petazzoni wrote: The pcim_*() functions are used by the libata-sff subsystem, and this subsystem is used for many SATA drivers on ARM platforms that do not necessarily have I/O

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Arnd Bergmann
On Tuesday 11 December 2012, Thomas Petazzoni wrote: On Tue, 11 Dec 2012 10:43:49 +, Arnd Bergmann wrote: On Friday 07 December 2012, Thomas Petazzoni wrote: The pcim_*() functions are used by the libata-sff subsystem, and this subsystem is used for many SATA drivers on ARM platforms

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 04:15:02PM +, Arnd Bergmann wrote: On Tuesday 11 December 2012, Thomas Petazzoni wrote: On Tue, 11 Dec 2012 10:43:49 +, Arnd Bergmann wrote: On Friday 07 December 2012, Thomas Petazzoni wrote: The pcim_*() functions are used by the libata-sff subsystem,

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 10:43:49AM +, Arnd Bergmann wrote: On Friday 07 December 2012, Thomas Petazzoni wrote: The pcim_*() functions are used by the libata-sff subsystem, and this subsystem is used for many SATA drivers on ARM platforms that do not necessarily have I/O ports. I

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Thomas Petazzoni
Dear Arnd Bergmann, On Tue, 11 Dec 2012 16:15:02 +, Arnd Bergmann wrote: What you describe here are probable two bugs, and we should fix both: * ARCH_VEXPRESS should not select NO_IOPORT. It's generally wrong to select this in combination with ARCH_MULTIPLATFORM, when some of the

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Thomas Petazzoni
Russell, On Tue, 11 Dec 2012 16:23:25 +, Russell King - ARM Linux wrote: * ARCH_VEXPRESS should not select NO_IOPORT. It's generally wrong to select this in combination with ARCH_MULTIPLATFORM, when some of the other platforms you may enable actually have IOPORT mapping

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 05:30:13PM +0100, Thomas Petazzoni wrote: arch/arm/mm/iomap.c is unconditionally compiled in all ARM kernels. And in this file, ioport_map() and ioport_unmap() are implement as soon as __io is defined. And basically, in arch/arm/include/asm/io.h, __io is defined for all

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 05:38:19PM +0100, Thomas Petazzoni wrote: Russell, On Tue, 11 Dec 2012 16:23:25 +, Russell King - ARM Linux wrote: * ARCH_VEXPRESS should not select NO_IOPORT. It's generally wrong to select this in combination with ARCH_MULTIPLATFORM, when some of

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 05:30:13PM +0100, Thomas Petazzoni wrote: arch/arm/mm/iomap.c is unconditionally compiled in all ARM kernels. And in this file, ioport_map() and ioport_unmap() are implement as soon as __io is defined. And basically, in arch/arm/include/asm/io.h, __io is defined for all

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Alan Cox
Correct. If HAS_IOPORT is not selected then we are potentially missing the dependent functions (because the platform has no IOPORT support) _or_ it does have ISA/PCI IO spaces _but_ they're not mappable via the ioport_map() mechanism due to some non-linearity involved in the translation.

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Alan Cox
Could you enlighten my very naive understanding of things about PCI/ISA IO space? On x86, I seem to understand this is the separate address space accessed by the special in/out CPU instructions. Are there ARM platforms with the same sort of things? An x86 processor has two address spaces A

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Alan Cox
with it. It's very simple. The IO port space is for ISA/PCMCIA and PCI IO port regions. It is nothing more than that. And on a lot of devices the LPC bus. Plus, if you _have_ IO space support, you must have some MMIO region for them to target - doing what many platforms have done to date

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 05:16:10PM +, Alan Cox wrote: Correct. If HAS_IOPORT is not selected then we are potentially missing the dependent functions (because the platform has no IOPORT support) _or_ it does have ISA/PCI IO spaces _but_ they're not mappable via the ioport_map()

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Alan Cox
The problem comes when you end up trying to deal with stuff which uses ioread{8,16} on ioport_map() cookies where it's assumed that adding N to the cookie is the same as adding N to the port address. It's a cookie - this isn't a problem, you can support it via the mapping approah. Whether you

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Russell King - ARM Linux
On Tue, Dec 11, 2012 at 05:45:09PM +, Alan Cox wrote: The problem comes when you end up trying to deal with stuff which uses ioread{8,16} on ioport_map() cookies where it's assumed that adding N to the cookie is the same as adding N to the port address. It's a cookie - this isn't a

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Arnd Bergmann
On Tuesday 11 December 2012, Alan Cox wrote: The no I/O space case really applies to things like the S/390 mainframe which simply have no such concept on the system or the devices. In the ARM case the bus has an I/O space and the bridge glues the processors simpler model to the bridge model.

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Arnd Bergmann
On Tuesday 11 December 2012, Alan Cox wrote: Plus, if you have IO space support, you must have some MMIO region for them to target - doing what many platforms have done to date and targetted ISA IO address 0 at virtual address 0 is just not on because as soon as you build a device driver

Re: [RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-11 Thread Arnd Bergmann
On Tuesday 11 December 2012, Russell King - ARM Linux wrote: On Tue, Dec 11, 2012 at 04:15:02PM +, Arnd Bergmann wrote: On Tuesday 11 December 2012, Thomas Petazzoni wrote: On Tue, 11 Dec 2012 10:43:49 +, Arnd Bergmann wrote: On Friday 07 December 2012, Thomas Petazzoni wrote:

[RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-07 Thread Thomas Petazzoni
The pcim_*() functions are used by the libata-sff subsystem, and this subsystem is used for many SATA drivers on ARM platforms that do not necessarily have I/O ports. Signed-off-by: Thomas Petazzoni Cc: Paul Gortmaker Cc: Jesse Barnes Cc: Yinghai Lu Cc: linux-kernel@vger.kernel.org ---

[RFC v1 01/16] lib: devres: don't enclose pcim_*() functions in CONFIG_HAS_IOPORT

2012-12-07 Thread Thomas Petazzoni
The pcim_*() functions are used by the libata-sff subsystem, and this subsystem is used for many SATA drivers on ARM platforms that do not necessarily have I/O ports. Signed-off-by: Thomas Petazzoni thomas.petazz...@free-electrons.com Cc: Paul Gortmaker paul.gortma...@windriver.com Cc: Jesse