aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-07-13 02:28:19 -0400
committerDave Airlie <airlied@redhat.com>2011-07-25 07:42:39 -0400
commit964f664520a4c6a247e2c9ff8b4481631cf746df (patch)
tree11bbb5e5f82b7ca236c0d40b76fd11f6efed634d /drivers/gpu
parentf1bece7fde9820a99c14d4db46ef071000e4ba47 (diff)
drm/radeon: Add a rmb() in IH processing
We should have a read memory barrier between reading the WPTR from memory and reading ring entries based on that value (ie, we need to ensure both loads are done in order by the CPU). It could be argued that the MMIO reads in r600_ack_irq() might be enough to get that barrier but I prefer keeping an explicit one just in case. [airlied: fix evergreen + r/w mixup] Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/evergreen.c3
-rw-r--r--drivers/gpu/drm/radeon/r600.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 37dd6449f46f..bcd55917c7cc 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -2759,6 +2759,9 @@ int evergreen_irq_process(struct radeon_device *rdev)
2759 return IRQ_NONE; 2759 return IRQ_NONE;
2760 } 2760 }
2761restart_ih: 2761restart_ih:
2762 /* Order reading of wptr vs. reading of IH ring data */
2763 rmb();
2764
2762 /* display interrupts */ 2765 /* display interrupts */
2763 evergreen_irq_ack(rdev); 2766 evergreen_irq_ack(rdev);
2764 2767
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index f56e65579835..aa5571b73aa0 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -3318,6 +3318,9 @@ int r600_irq_process(struct radeon_device *rdev)
3318 } 3318 }
3319 3319
3320restart_ih: 3320restart_ih:
3321 /* Order reading of wptr vs. reading of IH ring data */
3322 rmb();
3323
3321 /* display interrupts */ 3324 /* display interrupts */
3322 r600_irq_ack(rdev); 3325 r600_irq_ack(rdev);
3323 3326