OSDN Git Service

clear interrupt status before install irq
authorHong Liu <hong.liu@intel.com>
Fri, 18 Apr 2008 08:49:23 +0000 (16:49 +0800)
committerJesse Barnes <jbarnes@jbarnes-t61.(none)>
Wed, 23 Apr 2008 01:34:11 +0000 (18:34 -0700)
On my 865G machine, it seems the CPU will receive interrupt before
irq_postinstall is called. This will cause kernel oops because vblank is not
inited at that time. Clear interrupt status before install seems fixing this
problem.

Signed-off-by: Hong Liu <hong.liu@intel.com>
shared-core/i915_irq.c

index 8f136c8..422e81e 100644 (file)
@@ -1217,14 +1217,25 @@ int i915_vblank_swap(struct drm_device *dev, void *data,
 void i915_driver_irq_preinstall(struct drm_device * dev)
 {
        struct drm_i915_private *dev_priv = (struct drm_i915_private *) dev->dev_private;
+       u32 tmp;
+
+       tmp = I915_READ(I915REG_PIPEASTAT);
+       I915_WRITE(I915REG_PIPEASTAT, tmp);
+       tmp = I915_READ(I915REG_PIPEBSTAT);
+       I915_WRITE(I915REG_PIPEBSTAT, tmp);
+
 
        I915_WRITE16(I915REG_HWSTAM, 0xeffe);
        if (IS_I9XX(dev) && !IS_I915G(dev) && !IS_I915GM(dev)) {
                I915_WRITE(I915REG_INT_MASK_R, 0x0);
                I915_WRITE(I915REG_INT_ENABLE_R, 0x0);
+               tmp = I915_READ(I915REG_INT_IDENTITY_R);
+               I915_WRITE(I915REG_INT_IDENTITY_R, tmp);
        } else {
                I915_WRITE16(I915REG_INT_MASK_R, 0x0);
                I915_WRITE16(I915REG_INT_ENABLE_R, 0x0);
+               tmp = I915_READ16(I915REG_INT_IDENTITY_R);
+               I915_WRITE16(I915REG_INT_IDENTITY_R, tmp);
        }
 
 }