Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1172481

RE: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants

From Casey Leedom <leedom@chelsio.com>
Newsgroups linux.kernel
Subject RE: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants
Date 2015-06-25 23:50 +0200
Message-ID <pFnbY-4dP-13@gated-at.bofh.it> (permalink)
References <pDcNH-3Pi-3@gated-at.bofh.it> <pF2Ay-82Y-13@gated-at.bofh.it> <pFnbY-4dP-15@gated-at.bofh.it> <pFmpA-33W-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


| From: Arnd Bergmann [arnd@arndb.de]
| Sent: Thursday, June 25, 2015 1:44 PM
| 
| On Thursday 25 June 2015 15:01:56 Casey Leedom wrote:
| >
| >   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?
| 
| The interpretation is not consistent across architectures.
| 
| My best description would be that the __raw_*() accessors should
| only be used for accessing RAM areas that are known to have no
| side-effects and can be read in any size (8-bit to 64-bit wide),
| any alignment, and do not have a specific endianess.
| 
| If you are dealing with MMIO registers that have a fixed endianess
| and size, the correct accessor would be readl_relaxed(), which
| is like readl() but lacks the barriers on certain architectures.

Ah, thanks.  I see now that the __raw_*() APIs don't do any of the
Endian Swizzling.  Unfortunately the *_relaxed() APIs on PowerPC
are just defined as the normal *() routines.  From
arch/powerpc/include/asm/io.h:

    /*
     * We don't do relaxed operations yet, at least not with this semantic
     */
    #define readb_relaxed(addr)     readb(addr)
    #define readw_relaxed(addr)     readw(addr)
    #define readl_relaxed(addr)     readl(addr)
    #define readq_relaxed(addr)     readq(addr)
    #define writeb_relaxed(v, addr) writeb(v, addr)
    #define writew_relaxed(v, addr) writew(v, addr)
    #define writel_relaxed(v, addr) writel(v, addr)
    #define writeq_relaxed(v, addr) writeq(v, addr)

    (And in fact, this is true for most of the architectures.)

So we could go ahead and use these but for now there wouldn't be
any effect.

Hhmmm, so what do PowerPC Drivers do when they want to take
advantage of Write Combining?  Do their own Endian Swizzling
with the __raw_*() APIs?

Casey--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants "Luis R. Rodriguez" <mcgrof@suse.com> - 2015-06-25 00:30 +0200
  Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants Benjamin Herrenschmidt <benh@kernel.crashing.org> - 2015-06-25 01:50 +0200
    Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants "Luis R. Rodriguez" <mcgrof@suse.com> - 2015-06-25 02:10 +0200
      Re: [Xen-devel] [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants "Luis R. Rodriguez" <mcgrof@suse.com> - 2015-06-25 03:00 +0200
        Re: [Xen-devel] [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants Benjamin Herrenschmidt <benh@kernel.crashing.org> - 2015-06-25 03:20 +0200
      Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants Benjamin Herrenschmidt <benh@kernel.crashing.org> - 2015-06-25 03:00 +0200
    RE: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants Casey Leedom <leedom@chelsio.com> - 2015-06-25 23:50 +0200
      Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants Benjamin Herrenschmidt <benh@kernel.crashing.org> - 2015-06-26 01:00 +0200
        Re: [Xen-devel] [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants Benjamin Herrenschmidt <benh@kernel.crashing.org> - 2015-06-27 02:20 +0200
      Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants Benjamin Herrenschmidt <benh@kernel.crashing.org> - 2015-06-26 04:50 +0200
        Re: [PATCH v7 5/9] PCI: Add pci_iomap_wc() variants Casey Leedom <leedom@chelsio.com> - 2015-07-03 02:20 +0200

csiph-web