dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/drivers/gpu/drm/i915
Daniel Vetter a9e2641dee drm/i915: close PM interrupt masking races in the rps work func
This patch closes the following race:

We get a PM interrupt A, mask it, set dev_priv->iir = PM_A and kick of the
work item. Scheduler isn't grumpy, so the work queue takes rps_lock,
grabs pm_iir = dev_priv->pm_iir and pm_imr = READ(PMIMR). Note that
pm_imr == pm_iir because we've just masked the interrupt we've got.

Now hw sends out PM interrupt B (not masked), we process it and mask
it.  Later on the irq handler also clears PMIIR.

Then the work item proceeds and at the end clears PMIMR. Because
(local) pm_imr == pm_iir we have
        pm_imr & ~pm_iir == 0
so all interrupts are enabled.

Hardware is still interrupt-happy, and sends out a new PM interrupt B.
PMIMR doesn't mask B (it does not mask anything), PMIIR is cleared, so
we get it and hit the WARN in the interrupt handler (because
dev_priv->pm_iir == PM_B).

That's why I've moved the
        WRITE(PMIMR, 0)
up under the protection of the rps_lock. And write an uncoditional 0
to PMIMR, because that's what we'll do anyway.

This races looks much more likely because we can arbitrarily extend
the window by grabing dev->struct mutex right after the irq handler
has processed the first PM_B interrupt.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 14:11:17 -07:00
..
Makefile drm/i915: Split i915_gem_execbuffer into its own file. 2010-11-25 21:19:25 +00:00
dvo.h drm/i915: Subclass intel_encoder. 2010-08-09 11:24:28 -07:00
dvo_ch7xxx.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo_ch7017.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo_ivch.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo_sil164.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
dvo_tfp410.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
i915_debugfs.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
i915_dma.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
i915_drv.c Merge branch 'fix-pch-refclk' into foo 2011-10-20 14:10:43 -07:00
i915_drv.h drm/i915: Remove "i2c_speed" nonsense from child device table 2011-10-20 14:11:15 -07:00
i915_gem.c Merge branch 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux into drm-next 2011-09-20 09:36:22 +01:00
i915_gem_debug.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
i915_gem_evict.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
i915_gem_execbuffer.c drm/i915: Dumb down the semaphore logic 2011-09-21 14:52:41 -07:00
i915_gem_gtt.c drm/i915: Add an interface to dynamically change the cache level 2011-06-09 21:51:16 -07:00
i915_gem_tiling.c drm/i915: Fix unfenced alignment on pre-G33 hardware 2011-07-18 14:02:06 -07:00
i915_ioc32.c drm: convert drm_ioctl to unlocked_ioctl 2009-12-18 11:22:31 +10:00
i915_irq.c drm/i915: close PM interrupt masking races in the rps work func 2011-10-20 14:11:17 -07:00
i915_mem.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
i915_reg.h Merge branch 'edp-training-fixes' into drm-intel-next 2011-10-20 14:10:07 -07:00
i915_suspend.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
i915_trace.h Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
i915_trace_points.c drm/i915: Add tracepoints 2009-09-23 01:05:21 +01:00
intel_acpi.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
intel_bios.c drm/i915: Remove "i2c_speed" nonsense from child device table 2011-10-20 14:11:15 -07:00
intel_bios.h drm/i915: Remove "i2c_speed" nonsense from child device table 2011-10-20 14:11:15 -07:00
intel_crt.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
intel_display.c Merge branch 'fix-pch-refclk' into foo 2011-10-20 14:10:43 -07:00
intel_dp.c Merge branch 'edp-training-fixes' into drm-intel-next 2011-10-20 14:10:07 -07:00
intel_drv.h Merge branch 'drm-intel-fixes' into drm-intel-next 2011-09-28 14:44:38 -07:00
intel_dvo.c drm/i915: cleanup per-pipe reg usage 2011-02-07 21:17:15 +00:00
intel_fb.c drm/i915: restore only the mode of this driver on lastclose (v2) 2011-04-27 17:51:59 +10:00
intel_hdmi.c drm/i915: pass ELD to HDMI/DP audio driver 2011-09-21 14:52:41 -07:00
intel_i2c.c drm/i915: Remove redundant bit shifting from intel_gmbus_set_speed 2011-10-20 14:11:16 -07:00
intel_lvds.c Not all systems expose a firmware or platform mechanism for changing the backlight intensity on i915, so add native driver support. 2011-08-15 12:10:25 -07:00
intel_modes.c drm/i915: pass ELD to HDMI/DP audio driver 2011-09-21 14:52:41 -07:00
intel_opregion.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
intel_overlay.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
intel_panel.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
intel_ringbuffer.c drm/i915: Dumb down the semaphore logic 2011-09-21 14:52:41 -07:00
intel_ringbuffer.h drm/i915: Dumb down the semaphore logic 2011-09-21 14:52:41 -07:00
intel_sdvo.c drm/i915: Remove redundant bit shifting from intel_gmbus_set_speed 2011-10-20 14:11:16 -07:00
intel_sdvo_regs.h Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00
intel_tv.c Drivers: i915: Fix all space related issues. 2011-09-19 18:01:47 -07:00