linux-mips
[Top] [All Lists]

Re: Patch: ATI Xilleon port 2/11 net/e100 Memory barriers and write flus

To: Jesse Brandeburg <jesse.brandeburg@gmail.com>
Subject: Re: Patch: ATI Xilleon port 2/11 net/e100 Memory barriers and write flushing
From: Ralf Baechle <ralf@linux-mips.org>
Date: Fri, 21 Oct 2005 09:36:53 +0100
Cc: ddaney@avtrex.com, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
In-reply-to: <4807377b0510201201i685efd46qf4c548da34b996cb@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <17239.12568.110253.404667@dl2.hq2.avtrex.com> <4807377b0510201201i685efd46qf4c548da34b996cb@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.1i
On Thu, Oct 20, 2005 at 12:01:01PM -0700, Jesse Brandeburg wrote:

> > @@ -584,6 +584,7 @@ static inline void e100_write_flush(stru
> >  {
> >         /* Flush previous PCI writes through intermediate bridges
> >          * by doing a benign read */
> > +       wmb();
> >         (void)readb(&nic->csr->scb.status);
> >  }
> 
> I find it odd that this is needed, the readb is meant to flush all
> posted writes on the pci bus, if your bus is conforming to pci
> specifications, this must succeed.  wmb is for host side (processor
> memory) writes to complete, and since we're usually only try to force
> a writeX command to execute immediately with the readb (otherwise lazy
> writes work okay) we shouldn't need a wmb *here*.  not to say it might
> not be missing somewhere else.

wmb is defined as a sync instruction which will only complete once the
write has actually left the CPU, that is citing the spec "has become
globally visible".  Uncached stores such as writeX() may be held in a
writeback buffers potencially infinitely, until this buffer is needed
by another write operation.  The real surprise is to see such behaviour
in a modern piece of silicon; the only that I knew of were the R3000-class
processors and that era has ended over a decade ago, so ATI seems to have
done something funny here.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>