staging: mrst: Fix BUG_ON() triggering in drm_vblank_put()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 22 Dec 2011 17:06:20 +0000 (19:06 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 3 Jul 2012 09:29:16 +0000 (12:29 +0300)
We're calling drm_vblank_get() too late. It must be done before the
xchg() to avoid psb_flip_complete() from calling drm_vblank_put() before
drm_vblank_get(). This could trigger a a BUG_ON() in drm_vblank_get().

Earlier the pvr sync callbacks were usually executed with interrupts
disabled, which made the problem extremely unlikely to happen.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/staging/mrst/drv/psb_page_flip.c

index ccc6b80..08a56ad 100644 (file)
@@ -175,10 +175,10 @@ sync_callback(struct pvr_pending_sync *pending_sync)
 
        write_scanout_regs(pending_flip, pending_flip->offset);
 
-       pending_flip = xchg(&psb_intel_crtc->pending_flip, pending_flip);
-
        drm_vblank_get(dev, psb_intel_crtc->pipe);
 
+       pending_flip = xchg(&psb_intel_crtc->pending_flip, pending_flip);
+
        psb_intel_flip_complete(pending_flip);
 }