drm/radeon/kms: r600 handle irq vector ring overflow
authorJerome Glisse <jglisse@redhat.com>
Fri, 15 Jan 2010 13:44:39 +0000 (14:44 +0100)
committerDave Airlie <airlied@linux.ie>
Wed, 20 Jan 2010 22:45:01 +0000 (08:45 +1000)
In some rare case i faced an irq overflow quickly followed by
a GPU lockup (hard hang) this patch try to deal with irq vector
ring overflow, so far haven't been able to reproduce it with
the patch.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/gpu/drm/radeon/r600.c

index 0f9a8c6788a35450c3fd32ff23fae28d6288a09f..bb9115bdc3a2f12f4ccb1804145a44c41f638fba 100644 (file)
@@ -2648,9 +2648,13 @@ static inline u32 r600_get_ih_wptr(struct radeon_device *rdev)
        wptr = RREG32(IH_RB_WPTR);
 
        if (wptr & RB_OVERFLOW) {
-               WARN_ON(1);
-               /* XXX deal with overflow */
-               DRM_ERROR("IH RB overflow\n");
+               /* When a ring buffer overflow happen start parsing interrupt
+                * from the last not overwritten vector (wptr + 16). Hopefully
+                * this should allow us to catchup.
+                */
+               dev_warn(rdev->dev, "IH ring buffer overflow (0x%08X, %d, %d)\n",
+                       wptr, rdev->ih.rptr, (wptr + 16) + rdev->ih.ptr_mask);
+               rdev->ih.rptr = (wptr + 16) & rdev->ih.ptr_mask;
                tmp = RREG32(IH_RB_CNTL);
                tmp |= IH_WPTR_OVERFLOW_CLEAR;
                WREG32(IH_RB_CNTL, tmp);