agp/intel: fix cache control for sandybridge
PATCH 1/2 agp/intel: fix cache control for sandybridge
This is broken from 97ef1bdd0bc75bce7b2058e9c432b6c277dcf4d3. Let's set the correct bit for LLC+MLC and LLC only.
Signed-off-by Zhenyu Wang <[email protected]>
--- drivers/char/agp/intel-gtt.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/char/agp/intel-gtt.c +2 -2
@@ -1213,11 +1213,11 @@ static void gen6_write_entry(dma_addr_t addr, unsigned int entry,if (type_mask ==AGP_USER_UNCACHED_MEMORY ) pte_flags =GEN6_PTE_UNCACHED |I810_PTE_VALID ;else if (type_mask ==AGP_USER_CACHED_MEMORY_LLC_MLC ) { - pte_flags =GEN6_PTE_LLC |I810_PTE_VALID ; + pte_flags =GEN6_PTE_LLC_MLC |I810_PTE_VALID ;if (gfdt) pte_flags |=GEN6_PTE_GFDT ; }else {/* set 'normal'/'cached' to LLC by default */ - pte_flags =GEN6_PTE_LLC_MLC |I810_PTE_VALID ; + pte_flags =GEN6_PTE_LLC |I810_PTE_VALID ;if (gfdt) pte_flags |=GEN6_PTE_GFDT ; }
Signature · 1 line
1.7.1
PATCH 2/2 agp/intel: restore cache behavior on sandybridge
This restores cache behavior for default AGP_USER_MEMORY as uncached, and leave default AGP_USER_CACHED_MEMORY as LLC only. I've seen different cache behavior on one sandybridge desktop CPU vs. another mobile CPU. Until we figure out how to detect the real cache config, restore back to the original behavior now.
Signed-off-by Zhenyu Wang <[email protected]>
--- drivers/char/agp/intel-gtt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/agp/intel-gtt.c +1 -1
@@ -1210,7 +1210,7 @@ static void gen6_write_entry(dma_addr_t addr, unsigned int entry,unsigned int gfdt = flags &AGP_USER_CACHED_MEMORY_GFDT ;u32 pte_flags; -if (type_mask ==AGP_USER_UNCACHED_MEMORY ) +if (type_mask ==AGP_USER_MEMORY ) pte_flags =GEN6_PTE_UNCACHED |I810_PTE_VALID ;else if (type_mask ==AGP_USER_CACHED_MEMORY_LLC_MLC ) { pte_flags =GEN6_PTE_LLC_MLC |I810_PTE_VALID ;
Signature · 1 line
1.7.1
Chris Wilson
AppliedRe: [PATCH 2/2] agp/intel: restore cache behavior on sandybridge
Applied both to -next, thanks.
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre