Skip to contentSkip to conversation

agp/intel: fix cache control for sandybridge

PATCH Applied Zhenyu Wang 2 participants 3 messages Nov 2, 2010 Agpgart driver

lore
Share & tools
lore
#0 lore raw

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.

---
 drivers/char/agp/intel-gtt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/char/agp/intel-gtt.c +2 -2
index 6b6760e..125cd0b 100644
@@ -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
#1 lore raw

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.

---
 drivers/char/agp/intel-gtt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/agp/intel-gtt.c +1 -1
index 125cd0b..9272c38 100644
@@ -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
Applied
#2 lore raw

Re: [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