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


Groups > linux.kernel > #1172567

Re: [PATCH v8 0/9] pci: add pci_iomap_wc() and pci_ioremap_wc_bar()

From Benjamin Herrenschmidt <benh@kernel.crashing.org>
Newsgroups linux.kernel
Subject Re: [PATCH v8 0/9] pci: add pci_iomap_wc() and pci_ioremap_wc_bar()
Date 2015-06-26 04:40 +0200
Message-ID <pFrIB-2l0-5@gated-at.bofh.it> (permalink)
References <pF49k-1X5-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 2015-06-24 at 18:22 -0700, Luis R. Rodriguez wrote:
> Although I had test compiled this before just to be safe I went ahead and
> successfully test-compiled this set with allmodconfig, specially since I've now
> removed the exports for the devres routines.  Please let me know if these might
> be able to go through you or if there are any questions. I will note the recent
> discussion with Benjamin over the v7 series concluded that the ideas we both
> were alluding to, on automating instead the WC effects for devices seems a bit
> too idealistic for PCI / PCIE for now, but perhaps we should at least consider
> this in the future for userspace mmap() calls [4].

So I've been trying to figure out how to make this practically work for us (powerpc).

writel() will never write combine for us, it uses too heavy barriers.

writel_relaxed() today is identical to writel() but we can change it.

The problem is that switching to G=0 mappings (which is what provides us with write
combining) also architecturally enables prefetch and speculative loads... and again
architecturally (the implementations may differ), kills the effect of the lightweight
io barrier eieio which we would have to use in readl_relaxed() and writel_relaxed()
to provide their normal semantics.

So it boils down to: Can we modify the documentation of readl_relaxed() and writel_relaxed()
to define them as being even further relaxed when using a "wc" mapping ?

Otherwise, the only way out I see for us on powerpc is to bias massively writel_relaxed()
against real_relaxed() by putting heavy barriers around the load in the latter so we can
keep them completely out of the former and still enable wc.

Ben.

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

[PATCH v8 0/9] pci: add pci_iomap_wc() and pci_ioremap_wc_bar() "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-06-25 03:30 +0200
  [PATCH v8 2/9] video: fbdev: i740fb: use arch_phys_wc_add() and pci_ioremap_wc_bar() "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-06-25 03:30 +0200
  [PATCH v8 3/9] video: fbdev: kyrofb: use arch_phys_wc_add() and pci_ioremap_wc_bar() "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-06-25 03:40 +0200
  [PATCH v8 5/9] PCI: Add pci_iomap_wc() variants "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-06-25 03:40 +0200
  [PATCH v8 6/9] lib: devres: add pcim_iomap_wc() variants "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-06-25 03:40 +0200
  [PATCH v8 4/9] video: fbdev: gxt4500: use pci_ioremap_wc_bar() for framebuffer "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-06-25 03:40 +0200
  [PATCH v8 7/9] video: fbdev: arkfb: use arch_phys_wc_add() and pci_iomap_wc() "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-06-25 03:50 +0200
  [PATCH v8 8/9] video: fbdev: s3fb: use arch_phys_wc_add() and pci_iomap_wc() "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-06-25 03:50 +0200
  [PATCH v8 9/9] video: fbdev: vt8623fb: use arch_phys_wc_add() and pci_iomap_wc() "Luis R. Rodriguez" <mcgrof@do-not-panic.com> - 2015-06-25 03:50 +0200
  Re: [PATCH v8 0/9] pci: add pci_iomap_wc() and pci_ioremap_wc_bar() Benjamin Herrenschmidt <benh@kernel.crashing.org> - 2015-06-26 04:40 +0200
    Re: [PATCH v8 0/9] pci: add pci_iomap_wc() and pci_ioremap_wc_bar() "Luis R. Rodriguez" <mcgrof@suse.com> - 2015-07-07 18:20 +0200

csiph-web