drm/radeon: Clear RB_OVERFLOW bit earlier
Subsystems (2)
PATCH 1/1 drm/radeon: Clear RB_OVERFLOW bit earlier
From: Michel Dänzer <[email protected]>
Otherwise the bit remains set in rdev->ih.rptr, so the wptr can never match that and we still have an infinite loop.
This fix allows me to successfully recover from an IH ring buffer overflow.
--- drivers/gpu/drm/radeon/cik.c | 2 +- drivers/gpu/drm/radeon/evergreen.c | 2 +- drivers/gpu/drm/radeon/r600.c | 2 +- drivers/gpu/drm/radeon/si.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/radeon/cik.c +1 -1
@@ -7751,6 +7751,7 @@ static inline u32 cik_get_ih_wptr(struct radeon_device *rdev) wptr =RREG32 (IH_RB_WPTR );if (wptr &RB_OVERFLOW ) { + wptr &= ~RB_OVERFLOW ;/* When a ring buffer overflow happen start parsing interrupt * from the last not overwritten vector (wptr + 16). Hopefully * this should allow us to catchup.
@@ -7761,7 +7762,6 @@ 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 -1
@@ -4749,6 +4749,7 @@ static u32 evergreen_get_ih_wptr(struct radeon_device *rdev) wptr =RREG32 (IH_RB_WPTR );if (wptr &RB_OVERFLOW ) { + wptr &= ~RB_OVERFLOW ;/* When a ring buffer overflow happen start parsing interrupt * from the last not overwritten vector (wptr + 16). Hopefully * this should allow us to catchup.
@@ -4759,7 +4760,6 @@ 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 -1
@@ -3802,6 +3802,7 @@ static u32 r600_get_ih_wptr(struct radeon_device *rdev) wptr =RREG32 (IH_RB_WPTR );if (wptr &RB_OVERFLOW ) { + wptr &= ~RB_OVERFLOW ;/* When a ring buffer overflow happen start parsing interrupt * from the last not overwritten vector (wptr + 16). Hopefully * this should allow us to catchup.
@@ -3812,7 +3813,6 @@ 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
@@ -6317,6 +6317,7 @@ static inline u32 si_get_ih_wptr(struct radeon_device *rdev) wptr =RREG32 (IH_RB_WPTR );if (wptr &RB_OVERFLOW ) { + wptr &= ~RB_OVERFLOW ;/* When a ring buffer overflow happen start parsing interrupt * from the last not overwritten vector (wptr + 16). Hopefully * this should allow us to catchup.
@@ -6327,7 +6328,6 @@ 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
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 9 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
Otherwise the bit remains set in
rdev->ih.rptr, so the wptr can never match that and we still have an infinite loop.This fix allows me to successfully recover from an IH ring buffer overflow.
Signed-off-by Michel Dänzer <[email protected]>
All three patches applied to my -fixes tree. Thanks!
Alex
Quoted 90 lines
--- drivers/gpu/drm/radeon/cik.c | 2 +- drivers/gpu/drm/radeon/evergreen.c | 2 +- drivers/gpu/drm/radeon/r600.c | 2 +- drivers/gpu/drm/radeon/si.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/radeon/cik.c +1
-1@@ -7751,6 +7751,7 @@ static inline u32 cik_get_ih_wptr(struct radeon_device *rdev) wptr =RREG32 (IH_RB_WPTR );if (wptr &RB_OVERFLOW ) { + wptr &= ~RB_OVERFLOW ;/* When a ring buffer overflow happen start parsing interrupt * from the last not overwritten vector (wptr + 16). Hopefully * this should allow us to catchup. @@ -7761,7 +7762,6 @@ 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
-1@@ -4749,6 +4749,7 @@ static u32 evergreen_get_ih_wptr(struct radeon_device *rdev) wptr =RREG32 (IH_RB_WPTR );if (wptr &RB_OVERFLOW ) { + wptr &= ~RB_OVERFLOW ;/* When a ring buffer overflow happen start parsing interrupt * from the last not overwritten vector (wptr + 16). Hopefully * this should allow us to catchup. @@ -4759,7 +4760,6 @@ 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
-1@@ -3802,6 +3802,7 @@ static u32 r600_get_ih_wptr(struct radeon_device *rdev) wptr =RREG32 (IH_RB_WPTR );if (wptr &RB_OVERFLOW ) { + wptr &= ~RB_OVERFLOW ;/* When a ring buffer overflow happen start parsing interrupt * from the last not overwritten vector (wptr + 16). Hopefully * this should allow us to catchup. @@ -3812,7 +3813,6 @@ 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
-2@@ -6317,6 +6317,7 @@ static inline u32 si_get_ih_wptr(struct radeon_device *rdev) wptr =RREG32 (IH_RB_WPTR );if (wptr &RB_OVERFLOW ) { + wptr &= ~RB_OVERFLOW ;/* When a ring buffer overflow happen start parsing interrupt * from the last not overwritten vector (wptr + 16). Hopefully * this should allow us to catchup. @@ -6327,7 +6328,6 @@ 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); } --2.1.0
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel