[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v1 05/47] pci: add pci_iomap_wc() variants
- To: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
- From: "Michael S. Tsirkin" <mst@xxxxxxxxxx>
- Date: Tue, 21 Apr 2015 21:25:05 +0200
- Cc: linux-fbdev@xxxxxxxxxxxxxxx, Daniel Vetter <daniel.vetter@xxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Suresh Siddha <suresh.b.siddha@xxxxxxxxx>, Tomi Valkeinen <tomi.valkeinen@xxxxxx>, "x86@xxxxxxxxxx" <x86@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxx>, Borislav Petkov <bp@xxxxxxx>, Jean-Christophe Plagniol-Villard <plagnioj@xxxxxxxxxxxx>, Antonino Daplas <adaplas@xxxxxxxxx>, "Luis R. Rodriguez" <mcgrof@xxxxxxxx>, Stefan Bader <stefan.bader@xxxxxxxxxxxxx>, Dave Airlie <airlied@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, jgross@xxxxxxxx, Toshi Kani <toshi.kani@xxxxxx>, "Luis R. Rodriguez" <mcgrof@xxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, David Vrabel <david.vrabel@xxxxxxxxxx>, venkatesh.pallipadi@xxxxxxxxx, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Tue, 21 Apr 2015 19:25:43 +0000
- List-id: Xen developer discussion <xen-devel.lists.xen.org>
On Mon, Mar 23, 2015 at 12:20:47PM -0500, Bjorn Helgaas wrote:
> pci_iomap_range() already makes a cacheable mapping if
> IORESOURCE_CACHEABLE; I'm guessing that you would like it to
> automatically use WC if the BAR if IORESOURCE_PREFETCH, e.g.,
>
> if (flags & IORESOURCE_CACHEABLE)
> return ioremap(start, len);
> if (flags & IORESOURCE_PREFETCH)
> return ioremap_wc(start, len);
> return ioremap_nocache(start, len);
>
> Is there a reason not to do that?
I think that's wrong and will break a bunch of things.
PCI prefetch bit merely means bridges can combine writes and prefetch
reads. Prefetch does not affect ordering rules and does not allow
writes to be collapsed.
WC is stronger: it allows collapsing and changes ordering rules.
WC can also hurt latency as small writes are buffered.
To summarise, driver needs to know what it's doing,
we can't set WC in the pci core automatically.
--
MST
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|