public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* readl/writel and memory barriers
@ 2002-02-19  1:45 Dan Maas
  2002-02-19  9:31 ` Alan Cox
  2002-02-19 17:10 ` David Mosberger
  0 siblings, 2 replies; 13+ messages in thread
From: Dan Maas @ 2002-02-19  1:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: Benjamin Herrenschmidt, Ben Collins

Are the PCI memory access functions like readl() and writel() supposed to
enforce ordering without explicit memory barriers?

I've heard inconsistent reports - Benjamin Herrenschmidt pointed out that on
PPC, the definitions of readl() and writel() include memory barriers. But
the code example on page 229 of Rubini and Corbet's "Linux Device Drivers"
2nd ed. suggests that an explicit wmb() is needed to preserve ordering of
writel()s.

In a quick survey of architectures that need explicit memory barriers to
enforce ordering of PCI accesses, it seems that alpha and PPC include memory
barriers inside readl() and writel(), whereas MIPS, sparc64, ia64, and s390
do not include them. (I'm not intimately familiar with these architectures
so forgive me if I got some wrong...). What is the official story here?

Regards,
Dan


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-02-25 16:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-19  1:45 readl/writel and memory barriers Dan Maas
2002-02-19  9:31 ` Alan Cox
2002-02-19 17:10 ` David Mosberger
2002-02-19 18:35   ` Jesse Barnes
2002-02-19 19:33     ` David Mosberger
2002-02-19 19:42       ` Jesse Barnes
2002-02-19 20:11     ` Dan Maas
2002-02-19 20:23       ` Jesse Barnes
2002-02-19 22:05     ` Keith Owens
2002-02-19 22:17       ` Jesse Barnes
2002-02-21  0:29       ` Randy.Dunlap
2002-02-23  4:48         ` Daniel Phillips
2002-02-25 16:19           ` Randy.Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox