drm/radeon: Add a rmb() in IH processing
Subsystems (2)
PATCH 4/6 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.
---
(resent adding dri-devel to the CC list to hit patchwork)
drivers/gpu/drm/radeon/r600.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/r600.c +3 -0
@@ -3312,6 +3312,9 @@ int r600_irq_process(struct radeon_device *rdev) } restart_ih: +/* Order reading of wptr vs. reading of IH ring data */ +wmb (); +/* display interrupts */ r600_irq_ack (rdev);
Quoted 9 lines · Benjamin Herrenschmidt
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.Signed-off-by Benjamin Herrenschmidt <[email protected]>
Quoted 25 lines
---
(resent adding dri-devel to the CC list to hit patchwork)
drivers/gpu/drm/radeon/r600.c| 3 +++1 files changed, 3 insertions(+), 0 deletions(-)drivers/gpu/drm/radeon/r600.c +0
-0@@ -3312,6 +3312,9 @@ int r600_irq_process(struct radeon_device *rdev) }restart_ih:
+ /* Order reading of wptr vs. reading of IH ring data */
+wmb();
+
/* display interrupts */
r600_irq_ack(rdev);
Quoted 6 lines · Alex Deucher
Quoted 4 lines · Benjamin Herrenschmidt
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).
Quoted 7 lines
Quoted 5 lines
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.Signed-off-by Benjamin Herrenschmidt <[email protected]>Reviewed-by Alex Deucher <[email protected]>
evergreen.c will need a similar fix.
Alex
Quoted 27 lines
Quoted 26 lines
---
(resent adding dri-devel to the CC list to hit patchwork)
drivers/gpu/drm/radeon/r600.c| 3 +++1 files changed, 3 insertions(+), 0 deletions(-)drivers/gpu/drm/radeon/r600.c +0
-0@@ -3312,6 +3312,9 @@ int r600_irq_process(struct radeon_device *rdev) }restart_ih:
+ /* Order reading of wptr vs. reading of IH ring data */
+wmb();
+
/* display interrupts */
r600_irq_ack(rdev);
A message that is not in the archive (sent off-list or not yet received): CADnq5_PooKO9NyKQz4euuykVpcZ7TXMqPXUAxKxX_LoKkrqj4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 11 lines · Alex Deucher
Quoted 10 lines · Alex Deucher
Quoted 8 lines · Benjamin Herrenschmidt
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.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Benjamin Herrenschmidt <[email protected]>Reviewed-by Alex Deucher <[email protected]>
evergreen.cwill need a similar fix.
Ok. I can do that.
Cheers,
Ben.
Quoted 29 lines
Alex
Quoted 27 lines
Quoted 26 lines
---
(resent adding dri-devel to the CC list to hit patchwork)
drivers/gpu/drm/radeon/r600.c| 3 +++1 files changed, 3 insertions(+), 0 deletions(-)drivers/gpu/drm/radeon/r600.c +3
-0@@ -3312,6 +3312,9 @@ int r600_irq_process(struct radeon_device *rdev) } restart_ih: +/* Order reading of wptr vs. reading of IH ring data */ +wmb (); +/* display interrupts */ r600_irq_ack (rdev);
Quoted 12 lines · Benjamin Herrenschmidt
Quoted 11 lines · Alex Deucher
Quoted 10 lines · Alex Deucher
Quoted 8 lines · Benjamin Herrenschmidt
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.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Benjamin Herrenschmidt <[email protected]>Reviewed-by Alex Deucher <[email protected]>
evergreen.cwill need a similar fix.Ok. I can do that.
Thanks!
Quoted 36 lines
Cheers,
Ben.Quoted 29 lines
Alex
Quoted 27 lines
Quoted 26 lines
---
(resent adding dri-devel to the CC list to hit patchwork)
drivers/gpu/drm/radeon/r600.c| 3 +++1 files changed, 3 insertions(+), 0 deletions(-)drivers/gpu/drm/radeon/r600.c +0
-0@@ -3312,6 +3312,9 @@ int r600_irq_process(struct radeon_device *rdev) }restart_ih:
+ /* Order reading of wptr vs. reading of IH ring data */
+wmb();
+
/* display interrupts */
r600_irq_ack(rdev);
Quoted 23 lines · Benjamin Herrenschmidt
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.Signed-off-by Benjamin Herrenschmidt <[email protected]>---
(resent adding dri-devel to the CC list to hit patchwork)
drivers/gpu/drm/radeon/r600.c| 3 +++1 files changed, 3 insertions(+), 0 deletions(-)drivers/gpu/drm/radeon/r600.c +0
-0@@ -3312,6 +3312,9 @@ int r600_irq_process(struct radeon_device *rdev) }
Quoted 6 lines
restart_ih:
+ /* Order reading of wptr vs. reading of IH ring data */
+wmb();
+
/* display interrupts */
r600_irq_ack(rdev);
The subject line says rmb(), but this says wmb(). Just want to verify what you have is correct.
Matt
Quoted 25 lines · Matt Turner
Quoted 23 lines · Benjamin Herrenschmidt
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.Signed-off-by Benjamin Herrenschmidt <[email protected]>---
(resent adding dri-devel to the CC list to hit patchwork)
drivers/gpu/drm/radeon/r600.c| 3 +++1 files changed, 3 insertions(+), 0 deletions(-)drivers/gpu/drm/radeon/r600.c +0
-0@@ -3312,6 +3312,9 @@ int r600_irq_process(struct radeon_device *rdev) }
Quoted 9 lines
drivers/gpu/drm/radeon/r600.c int r600_irq_process(struct radeon_device *rdev) · line 3319
Quoted 6 lines
drivers/gpu/drm/radeon/r600.c +3
-0restart_ih: +/* Order reading of wptr vs. reading of IH ring data */ +wmb (); +/* display interrupts */ r600_irq_ack (rdev);The subject line says
rmb(), but this sayswmb(). Just want to verify what you have is correct.
Nice spotting, it's a typo and should have been rmb(). I'll fix it and respin.
Cheers,
Ben