lkml.org 
[lkml]   [2002]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How to write portable MMIO code?
In article <Pine.LNX.4.44.0204301112520.32217-100000@chaos.physics.uiowa.edu> you wrote:
>> - should one in general (i.e., assuming the worst case) do wmb() on
>> writes, and mb() on reads?

readl() and writel() are specified to contain the proper barriers already.


> I don't think mb() will help you. You're probably experiencing PCI posting
> problems - when a writel() has executed, that doesn't necessarily mean
> that the transaction has actually happened it may (and will) be buffered
> for a potentially long time.
>
> However, PCI won't reorder reads vs. writes, so you when you want to be
> sure that a write() actually reached the hardware, do a dummy read()
> afterwards, that'll flush the write buffer.

yup
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.042 / U:0.908 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site