Commit a50d8d98 authored by Logan Gunthorpe's avatar Logan Gunthorpe Committed by Linus Torvalds
Browse files

mm/memremap: set caching mode for PCI P2PDMA memory to WC

PCI BAR IO memory should never be mapped as WB, however prior to this
the PAT bits were set WB and it was typically overridden by MTRR
registers set by the firmware.

Set PCI P2PDMA memory to be UC as this is what it currently, typically,
ends up being mapped as on x86 after the MTRR registers override the
cache setting.

Future use-cases may need to generalize this by adding flags to select
the caching type, as some P2PDMA cases may not want UC.  However, those
use-cases are not upstream yet and this can be changed when they arrive.
Signed-off-by: default avatarLogan Gunthorpe <>
Signed-off-by: default avatarAndrew Morton <>
Reviewed-by: default avatarDan Williams <>
Cc: Christoph Hellwig <>
Cc: Jason Gunthorpe <>
Cc: Andy Lutomirski <>
Cc: Benjamin Herrenschmidt <>
Cc: Borislav Petkov <>
Cc: Catalin Marinas <>
Cc: Dave Hansen <>
Cc: David Hildenbrand <>
Cc: Eric Badger <>
Cc: "H. Peter Anvin" <>
Cc: Ingo Molnar <>
Cc: Michael Ellerman <>
Cc: Michal Hocko <>
Cc: Paul Mackerras <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>
Cc: Will Deacon <>

Signed-off-by: default avatarLinus Torvalds <>
parent bfeb022f
......@@ -217,7 +217,10 @@ void *memremap_pages(struct dev_pagemap *pgmap, int nid)
need_devmap_managed = false;
params.pgprot = pgprot_noncached(params.pgprot);
need_devmap_managed = false;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment