Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2019-02-19 Thread Mikulas Patocka
On Tue, 21 Aug 2018, Arnd Bergmann wrote: > On Mon, Aug 20, 2018 at 11:42 PM Mikulas Patocka wrote: > > On Mon, 20 Aug 2018, Arnd Bergmann wrote: > > > > > On Mon, Aug 20, 2018 at 4:17 PM Mikulas Patocka > > > wrote: > > > > On Sun, 19 Aug 2018, ok...@codeaurora.org wrote: > > > > > > > > >

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-22 Thread Sinan Kaya
On 8/22/2018 3:56 PM, Mikulas Patocka wrote: On Wed, 22 Aug 2018, Sinan Kaya wrote: On 8/22/2018 1:47 PM, Mikulas Patocka wrote: If ARM guarantees that the accesses to a given device are not reordered - then the barriers in readl and writel are superfluous. It is not. ARM only guarantees

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-22 Thread Will Deacon
On Wed, Aug 22, 2018 at 03:56:28PM -0400, Mikulas Patocka wrote: > > > On Wed, 22 Aug 2018, Sinan Kaya wrote: > > > On 8/22/2018 1:47 PM, Mikulas Patocka wrote: > > > If ARM guarantees that the accesses to a given device are not reordered - > > > then the barriers in readl and writel are

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-22 Thread Mikulas Patocka
On Wed, 22 Aug 2018, Sinan Kaya wrote: > On 8/22/2018 1:47 PM, Mikulas Patocka wrote: > > If ARM guarantees that the accesses to a given device are not reordered - > > then the barriers in readl and writel are superfluous. > > It is not. ARM only guarantees ordering of read/write transactions

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-22 Thread Sinan Kaya
On 8/22/2018 1:47 PM, Mikulas Patocka wrote: If ARM guarantees that the accesses to a given device are not reordered - then the barriers in readl and writel are superfluous. It is not. ARM only guarantees ordering of read/write transactions targeting a device not memory. example: write

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-22 Thread Mikulas Patocka
On Wed, 22 Aug 2018, Arnd Bergmann wrote: > On Wed, Aug 22, 2018 at 5:50 PM Mikulas Patocka wrote: > > On Wed, 22 Aug 2018, Maciej W. Rozycki wrote: > > > On Wed, 22 Aug 2018, Sinan Kaya wrote: > > > > According to the Alpha handbook, non-overlapping accesses may be > > reordered. > > > > So

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-22 Thread Maciej W. Rozycki
On Wed, 22 Aug 2018, Arnd Bergmann wrote: > > According to the Alpha handbook, non-overlapping accesses may be > > reordered. I have had a notion of this since forever, however I have had troubles tracking down the exact reference in the architecture specification. > > So if someone does > >

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-22 Thread Arnd Bergmann
On Wed, Aug 22, 2018 at 5:50 PM Mikulas Patocka wrote: > On Wed, 22 Aug 2018, Maciej W. Rozycki wrote: > > On Wed, 22 Aug 2018, Sinan Kaya wrote: > > According to the Alpha handbook, non-overlapping accesses may be > reordered. > > So if someone does > writel(REG1); > readl(REG2); > > readl may

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-22 Thread Mikulas Patocka
On Wed, 22 Aug 2018, Maciej W. Rozycki wrote: > On Wed, 22 Aug 2018, Sinan Kaya wrote: > > > > It's hard to tell. The Alpha manual says that only overlapping accesses > > > are ordered. > > > > > > I did some tests on framebuffer and found out that "read+read+write+write" > > > is faster

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-22 Thread Maciej W. Rozycki
On Wed, 22 Aug 2018, Sinan Kaya wrote: > > It's hard to tell. The Alpha manual says that only overlapping accesses > > are ordered. > > > > I did some tests on framebuffer and found out that "read+read+write+write" > > is faster than "read+write+read+write" - that may suggest that the reads > >

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-22 Thread Sinan Kaya
On 8/22/2018 7:59 AM, Mikulas Patocka wrote: I did some tests on framebuffer and found out that "read+read+write+write" is faster than "read+write+read+write" - that may suggest that the reads flush the write queue. I think we are worried about correctness at this moment like a raw_read

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-22 Thread Mikulas Patocka
On Wed, 22 Aug 2018, Sinan Kaya wrote: > On 8/22/2018 7:59 AM, Mikulas Patocka wrote: > > > > > > On Tue, 21 Aug 2018, Arnd Bergmann wrote: > > > > > On Tue, Aug 21, 2018 at 3:40 PM Mikulas Patocka > > > wrote: > > > > On Tue, 21 Aug 2018, Arnd Bergmann wrote: > > > > > On Mon, Aug 20,

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-22 Thread Mikulas Patocka
On Tue, 21 Aug 2018, Arnd Bergmann wrote: > On Tue, Aug 21, 2018 at 3:40 PM Mikulas Patocka wrote: > > On Tue, 21 Aug 2018, Arnd Bergmann wrote: > > > On Mon, Aug 20, 2018 at 11:42 PM Mikulas Patocka > > > wrote: > > > > On Mon, 20 Aug 2018, Arnd Bergmann wrote: > > > > > On Mon, Aug 20,

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-21 Thread Arnd Bergmann
On Tue, Aug 21, 2018 at 3:40 PM Mikulas Patocka wrote: > On Tue, 21 Aug 2018, Arnd Bergmann wrote: > > On Mon, Aug 20, 2018 at 11:42 PM Mikulas Patocka > > wrote: > > > On Mon, 20 Aug 2018, Arnd Bergmann wrote: > > > > On Mon, Aug 20, 2018 at 4:17 PM Mikulas Patocka > > > > wrote: > > > > >

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-21 Thread Mikulas Patocka
On Tue, 21 Aug 2018, Arnd Bergmann wrote: > On Mon, Aug 20, 2018 at 11:42 PM Mikulas Patocka wrote: > > On Mon, 20 Aug 2018, Arnd Bergmann wrote: > > > > > On Mon, Aug 20, 2018 at 4:17 PM Mikulas Patocka > > > wrote: > > > > On Sun, 19 Aug 2018, ok...@codeaurora.org wrote: > > > > > > > > >

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-21 Thread okaya
On 2018-08-21 05:12, Maciej W. Rozycki wrote: On Mon, 20 Aug 2018, Sinan Kaya wrote: > Likewise see memory-barriers.txt throughout concerning `mmiowb' (which is > an obviously lighter weight barrier compared to `readX'). Here is a better reference from memory-barriers.txt (*) readX(),

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-21 Thread Maciej W. Rozycki
On Mon, 20 Aug 2018, Sinan Kaya wrote: > > Likewise see memory-barriers.txt throughout concerning `mmiowb' (which is > > an obviously lighter weight barrier compared to `readX'). > > Here is a better reference from memory-barriers.txt > > (*) readX(), writeX(): > > Whether these are

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Maciej W. Rozycki
On Mon, 20 Aug 2018, Sinan Kaya wrote: > > That is that the caller must not > > assume that writes issued by `writeX' calls will be observed in order on > > the external bus or specifically by the device addressed. > > Where do you see it? Right in the first paragraph of io_ordering.txt, and

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Maciej W. Rozycki
On Tue, 21 Aug 2018, Arnd Bergmann wrote: > > The lockup happens somewhere in the function autoconfig in > > drivers/tty/serial/8250/8250_port.c, but I don't know where exactly > > because serial console doesn't work while the port is being probed. > > > > When I use console on a graphics card,

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Sinan Kaya
On 8/20/2018 6:39 PM, Maciej W. Rozycki wrote: On Mon, 20 Aug 2018, Sinan Kaya wrote: That is that the caller must not assume that writes issued by `writeX' calls will be observed in order on the external bus or specifically by the device addressed. Where do you see it? Right in the

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Maciej W. Rozycki
On Mon, 20 Aug 2018, Mikulas Patocka wrote: > > > I observed that not every kernel with the patch > > > 92d7223a74235054f2aa7227d207d9c57f84dca0 fails, some of them get stuck > > > only at boot, some get stuck only at shutdown, some not at all. Although > > > all the kernels with this patch

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Sinan Kaya
On 8/20/2018 5:50 PM, Maciej W. Rozycki wrote: That is that the caller must not assume that writes issued by `writeX' calls will be observed in order on the external bus or specifically by the device addressed. Where do you see it? I interpret that two writeX() need to be observed in order

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Arnd Bergmann
On Mon, Aug 20, 2018 at 11:42 PM Mikulas Patocka wrote: > On Mon, 20 Aug 2018, Arnd Bergmann wrote: > > > On Mon, Aug 20, 2018 at 4:17 PM Mikulas Patocka wrote: > > > On Sun, 19 Aug 2018, ok...@codeaurora.org wrote: > > > > > > > +my new email > > > > > > > > On 2018-08-18 19:03, Arnd Bergmann

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Maciej W. Rozycki
On Mon, 20 Aug 2018, Mikulas Patocka wrote: > > A while ago I proposed a set of different MMIO barriers, that some > > systems may require, corresponding to the respective regular memory > > barriers, but in the I/O context. I never got to implementing that > > proposal, but I still think

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Maciej W. Rozycki
On Sun, 19 Aug 2018, ok...@codeaurora.org wrote: > >> There are a few architectures that define mmiowb to something other > >> than a nop: some ia64, some mips and sh in particular, plus also the > >> new riscv. > >> > >> It does make some sense that alpha might need a barrier between > >> an

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread okaya
On 2018-08-20 10:39, Arnd Bergmann wrote: On Mon, Aug 20, 2018 at 4:17 PM Mikulas Patocka wrote: On Sun, 19 Aug 2018, ok...@codeaurora.org wrote: > +my new email > > On 2018-08-18 19:03, Arnd Bergmann wrote: > > On Sat, Aug 18, 2018 at 12:05 AM Maciej W. Rozycki > I think we need to

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Arnd Bergmann
On Mon, Aug 20, 2018 at 4:17 PM Mikulas Patocka wrote: > On Sun, 19 Aug 2018, ok...@codeaurora.org wrote: > > > +my new email > > > > On 2018-08-18 19:03, Arnd Bergmann wrote: > > > On Sat, Aug 18, 2018 at 12:05 AM Maciej W. Rozycki > > I think we need to identify the driver that is failing. >

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Mikulas Patocka
On Sun, 19 Aug 2018, ok...@codeaurora.org wrote: > +my new email > > On 2018-08-18 19:03, Arnd Bergmann wrote: > > On Sat, Aug 18, 2018 at 12:05 AM Maciej W. Rozycki > > wrote: > > > > > > On Fri, 17 Aug 2018, Arnd Bergmann wrote: > > > > > > > - For outb()/outw()/outl(), we ought to

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Mikulas Patocka
On Fri, 17 Aug 2018, Maciej W. Rozycki wrote: > On Fri, 17 Aug 2018, Arnd Bergmann wrote: > > > - For outb()/outw()/outl(), we ought to provide stronger barriers than for > > writeb()/writew()/writel(), as PCI drivers should expect the store to have > > arrived at the device by the time

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Mikulas Patocka
On Fri, 17 Aug 2018, Arnd Bergmann wrote: > On Fri, Aug 17, 2018 at 9:10 PM Mikulas Patocka wrote: > > > > Hi > > > > The commit 9ce8654323d69273b4977f76f11c9e2d345ab130 breaks the Alpha > > Avanti platform. There is temporary 40-second hang during boot when > > detecting serial ports

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Michael Cree
On Mon, Aug 20, 2018 at 06:22:26AM -0400, Mikulas Patocka wrote: > Alpha already has a memory barrier inside arch_spin_unlock. > > > BTW. I think that arch_spinlock_t (and atomic_t) on alpha should be > 8-byte. See this case - writing the variable "x" performs > read-modify-write cycle on the

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-20 Thread Mikulas Patocka
On Sun, 19 Aug 2018, Arnd Bergmann wrote: > On Sun, Aug 19, 2018 at 5:12 PM wrote: > > On 2018-08-18 19:03, Arnd Bergmann wrote: > > > On Sat, Aug 18, 2018 at 12:05 AM Maciej W. Rozycki > > > > > >> A while ago I proposed a set of different MMIO barriers, that some > > >> systems may

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-19 Thread Sinan Kaya
On 8/19/2018 11:41 AM, Arnd Bergmann wrote: Sounds like we need a similar solution for all architectures that require mmiowb(). That depends on how expensive the barrier is on a given architecture. It's possible that doing adding the barrier every time is actually cheaper than keeping track of

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-19 Thread Maciej W. Rozycki
On Sun, 19 Aug 2018, Arnd Bergmann wrote: > > > My understanding for mmiowb() is that it should not be implied by > > > writel() itself but that it would be added between a writel() and a > > > spin_unlock(). Putting it into writel() itself would make it completely > > > pointless as an

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-19 Thread Arnd Bergmann
On Sun, Aug 19, 2018 at 5:28 PM Sinan Kaya wrote: > > On 8/19/2018 11:21 AM, Arnd Bergmann wrote: > >> This matches my understanding of mmiowb. In fact, mmiowb is a powerpc > >> thing. All other architectures stub out. > > There are a few architectures that define mmiowb to something other > >

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-19 Thread Sinan Kaya
On 8/19/2018 11:21 AM, Arnd Bergmann wrote: This matches my understanding of mmiowb. In fact, mmiowb is a powerpc thing. All other architectures stub out. There are a few architectures that define mmiowb to something other than a nop: some ia64, some mips and sh in particular, plus also the new

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-19 Thread Arnd Bergmann
On Sun, Aug 19, 2018 at 5:12 PM wrote: > On 2018-08-18 19:03, Arnd Bergmann wrote: > > On Sat, Aug 18, 2018 at 12:05 AM Maciej W. Rozycki > > > >> A while ago I proposed a set of different MMIO barriers, that some > >> systems may require, corresponding to the respective regular memory > >>

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-19 Thread okaya
+my new email On 2018-08-18 19:03, Arnd Bergmann wrote: On Sat, Aug 18, 2018 at 12:05 AM Maciej W. Rozycki wrote: On Fri, 17 Aug 2018, Arnd Bergmann wrote: > - For outb()/outw()/outl(), we ought to provide stronger barriers than for > writeb()/writew()/writel(), as PCI drivers should

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-18 Thread Arnd Bergmann
On Sat, Aug 18, 2018 at 12:05 AM Maciej W. Rozycki wrote: > > On Fri, 17 Aug 2018, Arnd Bergmann wrote: > > > - For outb()/outw()/outl(), we ought to provide stronger barriers than for > > writeb()/writew()/writel(), as PCI drivers should expect the store to have > > arrived at the device by

Re: Alpha Avanti broken by 9ce8654323d69273b4977f76f11c9e2d345ab130

2018-08-17 Thread Arnd Bergmann
On Fri, Aug 17, 2018 at 9:10 PM Mikulas Patocka wrote: > > Hi > > The commit 9ce8654323d69273b4977f76f11c9e2d345ab130 breaks the Alpha > Avanti platform. There is temporary 40-second hang during boot when > detecting serial ports (although the hang eventually resolves and the > machine boots) and