From dc78d7f8b04cd2d42b4b2f7fb02360589deedde7 Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Mon, 18 Jan 2010 14:26:25 +0100 Subject: [PATCH] Don't stay forever in the irq handler --- drivers/gpu/drm/radeon/r600.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index d0bd117..ca67344 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c @@ -2699,6 +2699,7 @@ int r600_irq_process(struct radeon_device *rdev) u32 ring_index, disp_int, disp_int_cont, disp_int_cont2; unsigned long flags; bool queue_hotplug = false; + u32 count = 0; DRM_DEBUG("r600_irq_process start: rptr %d, wptr %d\n", rptr, wptr); if (!rdev->ih.enabled) @@ -2725,6 +2726,7 @@ restart_ih: ring_index = rptr / 4; src_id = rdev->ih.ring[ring_index] & 0xff; src_data = rdev->ih.ring[ring_index + 1] & 0xfffffff; +//DRM_INFO("IH: rptr %08d wptr %08d | Vector: id %04d data 0x%08X\n", rptr, wptr, src_id, src_data); switch (src_id) { case 1: /* D1 vblank/vline */ @@ -2833,15 +2835,16 @@ restart_ih: /* wptr/rptr are in bytes! */ rptr += 16; rptr &= rdev->ih.ptr_mask; + count++; } + WREG32(IH_RB_RPTR, rdev->ih.rptr); /* make sure wptr hasn't changed while processing */ wptr = r600_get_ih_wptr(rdev); - if (wptr != rdev->ih.wptr) + if (wptr != rdev->ih.wptr && count < 128) goto restart_ih; if (queue_hotplug) queue_work(rdev->wq, &rdev->hotplug_work); rdev->ih.rptr = rptr; - WREG32(IH_RB_RPTR, rdev->ih.rptr); spin_unlock_irqrestore(&rdev->ih.lock, flags); return IRQ_HANDLED; } -- 1.6.5.2