aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-01-26 05:47:10 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-28 04:15:28 -0500
commit983d308cb8f602d1920a8c40196eb2ab6cc07bd2 (patch)
tree65aabb0a9ed28409e13e1ebde7a5584ea89a4577 /drivers/char
parentcea3bf81af625ce0d40b2f615f10fe5bc921b2c1 (diff)
agp/intel: Serialise after GTT updates
An interesting bug occurs on Pineview through which the root cause is that the writes of the PTE values into the GTT is not serialised with subsequent memory access through the GTT (when using WC updates of the PTE values). This is despite there being a posting read after the GTT update. However, by changing the address of the posting read, the memory access is indeed serialised correctly. Whilst we are manipulating the memory barriers, we can remove the compiler :memory restraint on the intermediate PTE writes knowing that we explicitly perform a posting read afterwards. v2: Replace posting reads with explicit write memory barriers - in particular this is advantages in case of single page objects. Update comments to mention this issue is only with WC writes. Testcase: igt/gem_exec_big #pnv Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88191 Tested-by: huax.lu@intel.com (v1) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/agp/intel-gtt.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 92aa43fa8d70..0b4188b9af7c 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -225,7 +225,7 @@ static int i810_insert_dcache_entries(struct agp_memory *mem, off_t pg_start,
225 intel_private.driver->write_entry(addr, 225 intel_private.driver->write_entry(addr,
226 i, type); 226 i, type);
227 } 227 }
228 readl(intel_private.gtt+i-1); 228 wmb();
229 229
230 return 0; 230 return 0;
231} 231}
@@ -329,7 +329,7 @@ static void i810_write_entry(dma_addr_t addr, unsigned int entry,
329 break; 329 break;
330 } 330 }
331 331
332 writel(addr | pte_flags, intel_private.gtt + entry); 332 writel_relaxed(addr | pte_flags, intel_private.gtt + entry);
333} 333}
334 334
335static const struct aper_size_info_fixed intel_fake_agp_sizes[] = { 335static const struct aper_size_info_fixed intel_fake_agp_sizes[] = {
@@ -735,7 +735,7 @@ static void i830_write_entry(dma_addr_t addr, unsigned int entry,
735 if (flags == AGP_USER_CACHED_MEMORY) 735 if (flags == AGP_USER_CACHED_MEMORY)
736 pte_flags |= I830_PTE_SYSTEM_CACHED; 736 pte_flags |= I830_PTE_SYSTEM_CACHED;
737 737
738 writel(addr | pte_flags, intel_private.gtt + entry); 738 writel_relaxed(addr | pte_flags, intel_private.gtt + entry);
739} 739}
740 740
741bool intel_enable_gtt(void) 741bool intel_enable_gtt(void)
@@ -858,7 +858,7 @@ void intel_gtt_insert_sg_entries(struct sg_table *st,
858 j++; 858 j++;
859 } 859 }
860 } 860 }
861 readl(intel_private.gtt+j-1); 861 wmb();
862} 862}
863EXPORT_SYMBOL(intel_gtt_insert_sg_entries); 863EXPORT_SYMBOL(intel_gtt_insert_sg_entries);
864 864
@@ -875,7 +875,7 @@ static void intel_gtt_insert_pages(unsigned int first_entry,
875 intel_private.driver->write_entry(addr, 875 intel_private.driver->write_entry(addr,
876 j, flags); 876 j, flags);
877 } 877 }
878 readl(intel_private.gtt+j-1); 878 wmb();
879} 879}
880 880
881static int intel_fake_agp_insert_entries(struct agp_memory *mem, 881static int intel_fake_agp_insert_entries(struct agp_memory *mem,
@@ -938,7 +938,7 @@ void intel_gtt_clear_range(unsigned int first_entry, unsigned int num_entries)
938 intel_private.driver->write_entry(intel_private.scratch_page_dma, 938 intel_private.driver->write_entry(intel_private.scratch_page_dma,
939 i, 0); 939 i, 0);
940 } 940 }
941 readl(intel_private.gtt+i-1); 941 wmb();
942} 942}
943EXPORT_SYMBOL(intel_gtt_clear_range); 943EXPORT_SYMBOL(intel_gtt_clear_range);
944 944
@@ -1106,7 +1106,7 @@ static void i965_write_entry(dma_addr_t addr,
1106 1106
1107 /* Shift high bits down */ 1107 /* Shift high bits down */
1108 addr |= (addr >> 28) & 0xf0; 1108 addr |= (addr >> 28) & 0xf0;
1109 writel(addr | pte_flags, intel_private.gtt + entry); 1109 writel_relaxed(addr | pte_flags, intel_private.gtt + entry);
1110} 1110}
1111 1111
1112static int i9xx_setup(void) 1112static int i9xx_setup(void)