[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4985EFDD773FCB459EF7915D2A3621ADC02F10@nice.asicdesigners.com>
Date: Thu, 25 Jun 2015 15:01:56 +0000
From: Casey Leedom <leedom@...lsio.com>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
"Luis R. Rodriguez" <mcgrof@...e.com>
CC: "Michael S. Tsirkin" <mst@...hat.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Toshi Kani <toshi.kani@...com>,
Andy Lutomirski <luto@...capital.net>,
Juergen Gross <jgross@...e.com>,
Tomi Valkeinen <tomi.valkeinen@...com>,
Arnd Bergmann <arnd@...db.de>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"xen-devel@...ts.xensource.com" <xen-devel@...ts.xensource.com>,
linux-fbdev <linux-fbdev@...r.kernel.org>,
Suresh Siddha <sbsiddha@...il.com>,
"Ingo Molnar" <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Dave Airlie <airlied@...hat.com>,
Antonino Daplas <adaplas@...il.com>,
Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"venkatesh.pallipadi@...el.com" <venkatesh.pallipadi@...el.com>,
Stefan Bader <stefan.bader@...onical.com>,
Ville Syrjälä <syrjala@....fi>,
Mel Gorman <mgorman@...e.de>, Vlastimil Babka <vbabka@...e.cz>,
Borislav Petkov <bp@...e.de>, Davidlohr Bueso <dbueso@...e.de>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Ville Syrjälä <ville.syrjala@...ux.intel.com>,
"David Vrabel" <david.vrabel@...rix.com>,
Jan Beulich <jbeulich@...e.com>,
Roger Pau Monné <roger.pau@...rix.com>
Subject: RE: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants
/ From: Benjamin Herrenschmidt [benh@...nel.crashing.org]
| Sent: Wednesday, June 24, 2015 4:38 PM
|
| It is to be noted that on powerpc at least, writel() and co will never
| combine due to the memory barriers in them. Only "normal" stores (or
\ __raw_writel) will.
/ From: Benjamin Herrenschmidt [benh@...nel.crashing.org]
| Sent: Wednesday, June 24, 2015 5:52 PM
|
| Right, and as I mentioned, on some archs like powerpc (and possibly
\ more), writel() and co contains an implicit mb()
Hhmmm, interesting. I definitely hadn't known that. In our network
drivers we explicitly manage all of our own memory barrier semantics.
(wmb() between writes to DMA Queues and writes to Device Registers
informing hardware of new data available to be DMA'ed, etc.) And we
do have code to take advantage of Write Combining Mappings using
writeq(). It looks like this is implemented eventually as out_be64()
in arch/powerpc/include/asm/io.h for PPC-BE:
#define DEF_MMIO_OUT_D(name, size, insn) \
static inline void name(volatile u##size __iomem *addr, u##size val) \
{ \
__asm__ __volatile__("sync;"#insn"%U0%X0 %1,%0" \
: "=m" (*addr) : "r" (val) : "memory"); \
IO_SET_SYNC_FLAG(); \
}
DEF_MMIO_OUT_D(out_be64, 64, std);
So, if understand your notes and the source correctly, all of
our code to do register reads/writes are getting SYNC instructions,
as are the 64-bit writeq()s we're attempting to use for our Write
Combining code on PowerPC. Hhmmm indeed ...
Is there a reference I can read on this so I can understand
when and where we can use the __raw_*() APIs? Can these
Raw Read/Write operations be reordered with respect to
each other or are the use of the various flavors of SYNC
instructions just to maintain order between Cached Memory
Accesses and I/O Instructions?
Casey--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists