Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-20 Thread Robert Jarzmik
Arnd Bergmann writes: > Coming back to the specific pxa25x_udc case: using __raw_* accessors > in the driver would possibly end up breaking the PXA25x machines in > the (very unlikely) case that someone wants to make it work with > big-endian kernels, assuming it does not have the

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-20 Thread Robert Jarzmik
Arnd Bergmann writes: > Coming back to the specific pxa25x_udc case: using __raw_* accessors > in the driver would possibly end up breaking the PXA25x machines in > the (very unlikely) case that someone wants to make it work with > big-endian kernels, assuming it does not have the same hardware

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-17 Thread Krzysztof Hałasa
Arnd Bergmann writes: > Ok, so I guess what this means is that ixp4xx (or xscale in general) > implements its big-endian mode by adding a byteswap on its DRAM > and PCI interfaces in be32 mode, rather than by changing the behavior of > the load/store operations (as be8 mode does)

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-17 Thread Krzysztof Hałasa
Arnd Bergmann writes: > Ok, so I guess what this means is that ixp4xx (or xscale in general) > implements its big-endian mode by adding a byteswap on its DRAM > and PCI interfaces in be32 mode, rather than by changing the behavior of > the load/store operations (as be8 mode does) or by having

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-17 Thread Arnd Bergmann
On Wednesday 17 February 2016 09:36:37 Krzysztof Hałasa wrote: > Arnd Bergmann writes: > > > ixp4xx is really special in that it performs hardware swapping for > > internal devices based on CPU endianess but not on PCI devices. > > Again, IXP4xx does not perform hardware (nor any

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-17 Thread Arnd Bergmann
On Wednesday 17 February 2016 09:36:37 Krzysztof Hałasa wrote: > Arnd Bergmann writes: > > > ixp4xx is really special in that it performs hardware swapping for > > internal devices based on CPU endianess but not on PCI devices. > > Again, IXP4xx does not perform hardware (nor any other)

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-17 Thread Krzysztof Hałasa
Arnd Bergmann writes: > ixp4xx is really special in that it performs hardware swapping for > internal devices based on CPU endianess but not on PCI devices. Again, IXP4xx does not perform hardware (nor any other) swapping for registers of on-chip devices. The registers are

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-17 Thread Krzysztof Hałasa
Arnd Bergmann writes: > ixp4xx is really special in that it performs hardware swapping for > internal devices based on CPU endianess but not on PCI devices. Again, IXP4xx does not perform hardware (nor any other) swapping for registers of on-chip devices. The registers are connected 1:1, bit 0

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-16 Thread Arnd Bergmann
On Tuesday 16 February 2016 14:24:10 Krzysztof Hałasa wrote: > Arnd Bergmann writes: > > > Both writes leave the CPU core within the spinlock but are not serialized > > with anything else, so there is no ordering between the CPUs when they > > enter the shared bus, other than

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-16 Thread Arnd Bergmann
On Tuesday 16 February 2016 14:24:10 Krzysztof Hałasa wrote: > Arnd Bergmann writes: > > > Both writes leave the CPU core within the spinlock but are not serialized > > with anything else, so there is no ordering between the CPUs when they > > enter the shared bus, other than having address

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-16 Thread Krzysztof Hałasa
Arnd Bergmann writes: > Both writes leave the CPU core within the spinlock but are not serialized > with anything else, so there is no ordering between the CPUs when they > enter the shared bus, other than having address before data. You'd > expect to see address0, data0,

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-16 Thread Krzysztof Hałasa
Arnd Bergmann writes: > Both writes leave the CPU core within the spinlock but are not serialized > with anything else, so there is no ordering between the CPUs when they > enter the shared bus, other than having address before data. You'd > expect to see address0, data0, address1, data1, but it

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-16 Thread Arnd Bergmann
On Tuesday 16 February 2016 10:26:14 Krzysztof Hałasa wrote: > Arnd Bergmann writes: > > > The barriers on a spinlock synchronize between CPUs but not an external > > bus, so (on some architectures) a spinlock protecting an MMIO register > > does not guarantee that two CPUs doing

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-16 Thread Arnd Bergmann
On Tuesday 16 February 2016 10:26:14 Krzysztof Hałasa wrote: > Arnd Bergmann writes: > > > The barriers on a spinlock synchronize between CPUs but not an external > > bus, so (on some architectures) a spinlock protecting an MMIO register > > does not guarantee that two CPUs doing > > > >

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-16 Thread Krzysztof Hałasa
Arnd Bergmann writes: > The barriers on a spinlock synchronize between CPUs but not an external > bus, so (on some architectures) a spinlock protecting an MMIO register > does not guarantee that two CPUs doing > > spin_lock(); > __raw_writel(address); >

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-16 Thread Krzysztof Hałasa
Arnd Bergmann writes: > The barriers on a spinlock synchronize between CPUs but not an external > bus, so (on some architectures) a spinlock protecting an MMIO register > does not guarantee that two CPUs doing > > spin_lock(); > __raw_writel(address); > __raw_writel(data); >

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-15 Thread Arnd Bergmann
On Monday 15 February 2016 14:51:13 Krzysztof Hałasa wrote: > Arnd Bergmann writes: > > > I consider the use of __raw_* accessors a bug, I don't think we should > > ever do that because it hides how the hardware actually works, it doesn't > > work with spinlocks, and it can lead

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-15 Thread Arnd Bergmann
On Monday 15 February 2016 14:51:13 Krzysztof Hałasa wrote: > Arnd Bergmann writes: > > > I consider the use of __raw_* accessors a bug, I don't think we should > > ever do that because it hides how the hardware actually works, it doesn't > > work with spinlocks, and it can lead to the compiler

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-15 Thread Krzysztof Hałasa
Arnd Bergmann writes: > I consider the use of __raw_* accessors a bug, I don't think we should > ever do that because it hides how the hardware actually works, it doesn't > work with spinlocks, and it can lead to the compiler splitting up accesses > into byte sized ones (not on

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-15 Thread Krzysztof Hałasa
Arnd Bergmann writes: > I consider the use of __raw_* accessors a bug, I don't think we should > ever do that because it hides how the hardware actually works, it doesn't > work with spinlocks, and it can lead to the compiler splitting up accesses > into byte sized ones (not on ARM with the

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-15 Thread Arnd Bergmann
On Monday 15 February 2016 08:33:37 Krzysztof Hałasa wrote: > Arnd Bergmann writes: > > >> Anyway, I think readl()/writel() do the right thing: in BE mode they > >> swap PCI accesses and don't swap normal registers, in LE mode nothing is > >> swapped. > > > > This seems to be true

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-15 Thread Arnd Bergmann
On Monday 15 February 2016 08:33:37 Krzysztof Hałasa wrote: > Arnd Bergmann writes: > > >> Anyway, I think readl()/writel() do the right thing: in BE mode they > >> swap PCI accesses and don't swap normal registers, in LE mode nothing is > >> swapped. > > > > This seems to be true when

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-14 Thread Krzysztof Hałasa
Arnd Bergmann writes: >> Anyway, I think readl()/writel() do the right thing: in BE mode they >> swap PCI accesses and don't swap normal registers, in LE mode nothing is >> swapped. > > This seems to be true when CONFIG_IXP4XX_INDIRECT_PCI is set, but > not otherwise. For the

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-02-14 Thread Krzysztof Hałasa
Arnd Bergmann writes: >> Anyway, I think readl()/writel() do the right thing: in BE mode they >> swap PCI accesses and don't swap normal registers, in LE mode nothing is >> swapped. > > This seems to be true when CONFIG_IXP4XX_INDIRECT_PCI is set, but > not otherwise. For the indirect variant,

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-01-29 Thread Arnd Bergmann
On Friday 29 January 2016 21:03:40 Sergei Shtylyov wrote: > On 01/29/2016 07:18 PM, Krzysztof Hałasa wrote: > > >> The unclear part here is for IXP4xx, which supports both big-endian > >> and little-endian configurations. So far, the driver has done > >> no byteswap in either case. I suspect that

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-01-29 Thread Sergei Shtylyov
Hello. On 01/29/2016 07:18 PM, Krzysztof Hałasa wrote: The unclear part here is for IXP4xx, which supports both big-endian and little-endian configurations. So far, the driver has done no byteswap in either case. I suspect that is wrong and it would actually need to swap in one or the other

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-01-29 Thread Arnd Bergmann
On Friday 29 January 2016 17:18:09 Krzysztof Hałasa wrote: > Arnd Bergmann writes: > > > The unclear part here is for IXP4xx, which supports both big-endian > > and little-endian configurations. So far, the driver has done > > no byteswap in either case. I suspect that is wrong and it would > >

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-01-29 Thread Krzysztof Hałasa
Arnd Bergmann writes: > The unclear part here is for IXP4xx, which supports both big-endian > and little-endian configurations. So far, the driver has done > no byteswap in either case. I suspect that is wrong and it would > actually need to swap in one or the other case, but I don't know >

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-01-29 Thread Robert Jarzmik
Arnd Bergmann writes: > This converts the pxa25x udc driver to use readl/writel as normal > driver should do, rather than dereferencing __iomem pointers > themselves. > > Based on the earlier preparation work, we can now also pass > the register start in the device pointer so we no longer need >

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-01-29 Thread Robert Jarzmik
Arnd Bergmann writes: > This converts the pxa25x udc driver to use readl/writel as normal > driver should do, rather than dereferencing __iomem pointers > themselves. > > Based on the earlier preparation work, we can now also pass > the register start in the device pointer so we

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-01-29 Thread Krzysztof Hałasa
Arnd Bergmann writes: > The unclear part here is for IXP4xx, which supports both big-endian > and little-endian configurations. So far, the driver has done > no byteswap in either case. I suspect that is wrong and it would > actually need to swap in one or the other case, but I

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-01-29 Thread Sergei Shtylyov
Hello. On 01/29/2016 07:18 PM, Krzysztof Hałasa wrote: The unclear part here is for IXP4xx, which supports both big-endian and little-endian configurations. So far, the driver has done no byteswap in either case. I suspect that is wrong and it would actually need to swap in one or the other

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-01-29 Thread Arnd Bergmann
On Friday 29 January 2016 17:18:09 Krzysztof Hałasa wrote: > Arnd Bergmann writes: > > > The unclear part here is for IXP4xx, which supports both big-endian > > and little-endian configurations. So far, the driver has done > > no byteswap in either case. I suspect that is wrong

Re: [PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-01-29 Thread Arnd Bergmann
On Friday 29 January 2016 21:03:40 Sergei Shtylyov wrote: > On 01/29/2016 07:18 PM, Krzysztof Hałasa wrote: > > >> The unclear part here is for IXP4xx, which supports both big-endian > >> and little-endian configurations. So far, the driver has done > >> no byteswap in either case. I suspect that

[PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-01-28 Thread Arnd Bergmann
This converts the pxa25x udc driver to use readl/writel as normal driver should do, rather than dereferencing __iomem pointers themselves. Based on the earlier preparation work, we can now also pass the register start in the device pointer so we no longer need the global variable. The unclear

[PATCH 3/7] usb: gadget: pxa25x_udc: use readl/writel for mmio

2016-01-28 Thread Arnd Bergmann
This converts the pxa25x udc driver to use readl/writel as normal driver should do, rather than dereferencing __iomem pointers themselves. Based on the earlier preparation work, we can now also pass the register start in the device pointer so we no longer need the global variable. The unclear