drm/radeon: fix irq ring buffer overflow handling
Subsystems (2)
PATCH 1/1 drm/radeon: fix irq ring buffer overflow handling
From: Christian König <[email protected]>
We must mask out the overflow bit as well, otherwise the wptr will never match the rptr again and the interrupt handler will loop forever.
--- drivers/gpu/drm/radeon/cik.c | 1 + drivers/gpu/drm/radeon/evergreen.c | 1 + drivers/gpu/drm/radeon/r600.c | 1 + drivers/gpu/drm/radeon/si.c | 1 + 4 files changed, 4 insertions(+)
drivers/gpu/drm/radeon/cik.c +1 -0
@@ -7376,6 +7376,7 @@ static inline u32 cik_get_ih_wptr(struct radeon_device *rdev) tmp =RREG32 (IH_RB_CNTL ); tmp |=IH_WPTR_OVERFLOW_CLEAR ;WREG32 (IH_RB_CNTL , tmp); + wptr &= ~RB_OVERFLOW ; }return (wptr & rdev->ih.ptr_mask); }
drivers/gpu/drm/radeon/evergreen.c +1 -0
@@ -4756,6 +4756,7 @@ static u32 evergreen_get_ih_wptr(struct radeon_device *rdev) tmp =RREG32 (IH_RB_CNTL ); tmp |=IH_WPTR_OVERFLOW_CLEAR ;WREG32 (IH_RB_CNTL , tmp); + wptr &= ~RB_OVERFLOW ; }return (wptr & rdev->ih.ptr_mask); }
drivers/gpu/drm/radeon/r600.c +1 -0
@@ -3795,6 +3795,7 @@ static u32 r600_get_ih_wptr(struct radeon_device *rdev) tmp =RREG32 (IH_RB_CNTL ); tmp |=IH_WPTR_OVERFLOW_CLEAR ;WREG32 (IH_RB_CNTL , tmp); + wptr &= ~RB_OVERFLOW ; }return (wptr & rdev->ih.ptr_mask); }
drivers/gpu/drm/radeon/si.c +1 -0
@@ -6103,6 +6103,7 @@ static inline u32 si_get_ih_wptr(struct radeon_device *rdev) tmp =RREG32 (IH_RB_CNTL ); tmp |=IH_WPTR_OVERFLOW_CLEAR ;WREG32 (IH_RB_CNTL , tmp); + wptr &= ~RB_OVERFLOW ; }return (wptr & rdev->ih.ptr_mask); }
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 7 lines · Christian König
From: Christian König <[email protected]>
We must mask out the overflow bit as well, otherwise the wptr will never match the rptr again and the interrupt handler will loop forever.
Signed-off-by Christian König <[email protected]>
Quoted 1 line
Not sure this is justified though. Were you able to reproduce the problem and verify the fix?
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Am 23.07.2014 11:07, schrieb Michel Dänzer:
Quoted 7 lines · Christian König
Quoted 6 lines
From: Christian König <[email protected]>
We must mask out the overflow bit as well, otherwise the wptr will never match the rptr again and the interrupt handler will loop forever.
Quoted 7 lines
Quoted 1 line
Signed-off-by Christian König <[email protected]>Reviewed-by Michel Dänzer <[email protected]>Quoted 1 line
Not sure this is justified though. Were you able to reproduce the problem and verify the fix?
Not yet, reproducing ring buffer overflows aren't easy to do. But I've had that multiple times with CIK and userptr support work and I can try if I can reproduce it once more.
From reading the code it looks like a rather fundamental problem to me and because of this I've added the stable Cc.
Christian.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Alex Deucher
AppliedQuoted 8 lines · Christian König
From: Christian König <[email protected]>
We must mask out the overflow bit as well, otherwise the wptr will never match the rptr again and the interrupt handler will loop forever.
Signed-off-by Christian König <[email protected]>
Applied to my 3.16 tree. Thanks!
Alex
Quoted 56 lines
--- drivers/gpu/drm/radeon/cik.c | 1 + drivers/gpu/drm/radeon/evergreen.c | 1 + drivers/gpu/drm/radeon/r600.c | 1 + drivers/gpu/drm/radeon/si.c | 1 + 4 files changed, 4 insertions(+)drivers/gpu/drm/radeon/cik.c +1
-0@@ -7376,6 +7376,7 @@ static inline u32 cik_get_ih_wptr(struct radeon_device *rdev) tmp =RREG32 (IH_RB_CNTL ); tmp |=IH_WPTR_OVERFLOW_CLEAR ;WREG32 (IH_RB_CNTL , tmp); + wptr &= ~RB_OVERFLOW ; }return (wptr & rdev->ih.ptr_mask); }drivers/gpu/drm/radeon/evergreen.c +1
-0@@ -4756,6 +4756,7 @@ static u32 evergreen_get_ih_wptr(struct radeon_device *rdev) tmp =RREG32 (IH_RB_CNTL ); tmp |=IH_WPTR_OVERFLOW_CLEAR ;WREG32 (IH_RB_CNTL , tmp); + wptr &= ~RB_OVERFLOW ; }return (wptr & rdev->ih.ptr_mask); }drivers/gpu/drm/radeon/r600.c +1
-0@@ -3795,6 +3795,7 @@ static u32 r600_get_ih_wptr(struct radeon_device *rdev) tmp =RREG32 (IH_RB_CNTL ); tmp |=IH_WPTR_OVERFLOW_CLEAR ;WREG32 (IH_RB_CNTL , tmp); + wptr &= ~RB_OVERFLOW ; }return (wptr & rdev->ih.ptr_mask); }drivers/gpu/drm/radeon/si.c +1
-1@@ -6103,6 +6103,7 @@ static inline u32 si_get_ih_wptr(struct radeon_device *rdev) tmp =RREG32 (IH_RB_CNTL ); tmp |=IH_WPTR_OVERFLOW_CLEAR ;WREG32 (IH_RB_CNTL , tmp); + wptr &= ~RB_OVERFLOW ; }return (wptr & rdev->ih.ptr_mask); } --
Quoted 2 lines
1.9.1
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel