[openib-general] HP ZX1 and HP IB cards...

Grant Grundler iod00d at hp.com
Fri Dec 3 14:40:39 PST 2004


On Fri, Dec 03, 2004 at 02:26:12PM -0800, Roland Dreier wrote:
>     Grant> I tried but it worked with the patch. :^(
> 
> Of course it would ... :)

:^)

>     Grant> This doesn't feel very safe to me.  If write ordering is
>     Grant> required here, writel() or wmb() is necessary.  Let me look
>     Grant> over this code and see if the ordering is enforced
>     Grant> elsewhere.
> 
> I'm not positive but I think it should be OK.  doorbell is just a
> temporary variable that gets passed to mthca_write64(), which
> essentially does a __raw_writeq(*(u64 *) doorbell).  On ia64,
> __raw_writeq is #defined to be writeq, so ordering should be OK
> there.

Yes - I just went through the same code and came to the same conclusion.

The key bit here is in __writeq() where it add "volatile".
This makes sure all previous writes have completed...but...

> And surely ia64 ordering is strong enough that the CPU won't
> try to do the writeq before the writes to doorbell complete, right?

Yes - I believe it is.

> On the other hand, the fact that changing the timing with printks
> makes things work does make it look like there may be some sort of
> ordering problem...

Well, or other race. Ordering was just my first guess.
It's likely the race is not even here - but on the completion
side of things.

I'll play with this for a bit and see were it leads me.

thanks,
grant



More information about the general mailing list