[openib-general] Re: [PATCH 53 of 53] ipath - add memory barrier when waiting for writes

Bryan O'Sullivan bos at pathscale.com
Mon May 15 14:10:47 PDT 2006


On Mon, 2006-05-15 at 08:57 -0700, Roland Dreier wrote:
>  >  static void i2c_wait_for_writes(struct ipath_devdata *dd)
>  >  {
>  > +	mb();
>  >  	(void)ipath_read_kreg32(dd, dd->ipath_kregs->kr_scratch);
>  >  }
> 
> This needs a comment explaining why it's needed.  A memory barrier
> before a readl() looks very strange since readl() should be ordered anyway.

Yeah.  It's actually working around what appears to be a gcc bug if the
kernel is compiled with -Os.  Ralph knows the details; he can give a
more complete answer.

	<b




More information about the general mailing list