lkml.org 
[lkml]   [2008]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: MMIO and gcc re-ordering issue
Date
 > Um, OK, you've said write twice now ... I was assuming you meant read.
> Even on an x86, writes are posted, so there's no way a spin lock could
> serialise a write without an intervening read to flush the posting
> (that's why only reads have a relaxed version on altix). Or is there
> something else I'm missing?

Writes are posted yes, but not reordered arbitrarily. If I have code like:

spin_lock(&mmio_lock);
writel(val1, reg1);
writel(val2, reg2);
spin_unlock(&mmio_lock);

then I have a reasonable expectation that if two CPUs run this at the
same time, their writes to reg1/reg2 won't be interleaved with each
other (because the whole section is inside a spinlock). And Altix
violates that expectation.

- R.


\
 
 \ /
  Last update: 2008-05-27 20:09    [W:0.162 / U:0.904 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site