All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>, linux-mips@linux-mips.org
Subject: Re: [PATCH] Fix mmiowb() for MIPS I
Date: Wed, 21 Feb 2007 18:10:37 +0000	[thread overview]
Message-ID: <20070221181037.GB4157@linux-mips.org> (raw)
In-Reply-To: <Pine.LNX.4.64N.0702211727530.29504@blysk.ds.pg.gda.pl>

On Wed, Feb 21, 2007 at 05:46:18PM +0000, Maciej W. Rozycki wrote:

> > diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
> > index 92ec261..855c304 100644
> > --- a/include/asm-mips/io.h
> > +++ b/include/asm-mips/io.h
> > @@ -502,8 +502,7 @@ BUILDSTRING(q, u64)
> >  #endif
> >  
> >  
> > -/* Depends on MIPS II instruction set */
> > -#define mmiowb() asm volatile ("sync" ::: "memory")
> > +#define mmiowb() __sync()
> >  
> >  static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count)
> >  {
> 
>  That's still not correct -- it should probably be defined like mb() 
> currently is as the write-back buffer may defeat strong ordering (IIRC, 
> the R2020 can do byte merging).  Also the semantics of mmiowb() does not 
> seem to be well specified -- I gather a sequence of:
> 
> 	writeb(mmioreg, val);
> 	mmiowb();
> 	readb(mmioreg);
> 
> should guarantee "val" has reached the register (mmiowb() replacing 
> incorrect mb() used in many places like this), but with either definition 
> of mmiowb() and a MIPS-I-style external write-back buffer it will not 
> work.

Does a read from the same device suffice to provide the necessary flushing
the same way as it does on PCI?

I'm not opposed to allowing platform specific definitions for operations
like mmiowbb() but I think we really should get rid of the special MIPS
iob() operation.

  Ralf

  reply	other threads:[~2007-02-21 18:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-21 17:10 [PATCH] Fix mmiowb() for MIPS I Atsushi Nemoto
2007-02-21 17:46 ` Maciej W. Rozycki
2007-02-21 18:10   ` Ralf Baechle [this message]
2007-02-22 15:28     ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070221181037.GB4157@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=linux-mips@linux-mips.org \
    --cc=macro@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.