Re: [PATCH] pci: introduce common pci config space accessors

2015-01-06 Thread Arnd Bergmann
On Monday 05 January 2015 16:28:48 Rob Herring wrote: > On Mon, Jan 5, 2015 at 2:01 PM, Arnd Bergmann wrote: > > On Monday 05 January 2015 08:46:09 Rob Herring wrote: > >> Right, this is what I had in mind for CAM/ECAM. I didn't go this far > >> because a lot of the map_bus functions do various ch

Re: [PATCH] pci: introduce common pci config space accessors

2015-01-05 Thread Rob Herring
On Mon, Jan 5, 2015 at 2:01 PM, Arnd Bergmann wrote: > On Monday 05 January 2015 08:46:09 Rob Herring wrote: >> >> >> diff --git a/include/linux/pci.h b/include/linux/pci.h >> >> index 360a966..e7fd519 100644 >> >> --- a/include/linux/pci.h >> >> +++ b/include/linux/pci.h >> >> @@ -560,6 +560,7 @@

Re: [PATCH] pci: introduce common pci config space accessors

2015-01-05 Thread Arnd Bergmann
On Monday 05 January 2015 08:46:09 Rob Herring wrote: > > >> diff --git a/include/linux/pci.h b/include/linux/pci.h > >> index 360a966..e7fd519 100644 > >> --- a/include/linux/pci.h > >> +++ b/include/linux/pci.h > >> @@ -560,6 +560,7 @@ static inline int pcibios_err_to_errno(int err) > >> /* Low

Re: [PATCH] pci: introduce common pci config space accessors

2015-01-05 Thread Rob Herring
On Mon, Jan 5, 2015 at 12:48 PM, Andreas Mohr wrote: > Hi, > >> + if (size == 1) >> + *val = readb(addr); >> + else if (size == 2) >> + *val = readw(addr); >> + else >> + *val = readl(addr); > (pci_generic_config_read() and pci_generic_config_write()

Re: [PATCH] pci: introduce common pci config space accessors

2015-01-05 Thread Andreas Mohr
Hi, > + if (size == 1) > + *val = readb(addr); > + else if (size == 2) > + *val = readw(addr); > + else > + *val = readl(addr); (pci_generic_config_read() and pci_generic_config_write()) switch() default: WARN_ON(1); ? Thanks, Andreas Mohr -- To u

Re: [PATCH] pci: introduce common pci config space accessors

2015-01-05 Thread Rob Herring
On Mon, Jan 5, 2015 at 3:16 AM, Arnd Bergmann wrote: > On Sunday 04 January 2015 20:19:34 Rob Herring wrote: >> Many PCI controllers' configuration space accesses are memory mapped >> varying only in address calculation and access checks. There are 2 main >> access methods: a decoded address space

Re: [PATCH] pci: introduce common pci config space accessors

2015-01-05 Thread Arnd Bergmann
On Sunday 04 January 2015 20:19:34 Rob Herring wrote: > Many PCI controllers' configuration space accesses are memory mapped > varying only in address calculation and access checks. There are 2 main > access methods: a decoded address space such as ECAM or a single address > and data register simil