]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: close tiny race in the ilk pcu even interrupt setup
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 27 Jun 2013 11:44:59 +0000 (13:44 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 1 Jul 2013 09:14:55 +0000 (11:14 +0200)
commit125526b70a002c7322bc8edd014f540a5d4ca4ae
tree6e57d18f44d5a929c76013d0c62aa9c8253843e9
parent01e5b5f79b24ce6188e0315c18337c1d4522c8f6
drm/i915: close tiny race in the ilk pcu even interrupt setup

By the time we write DEIER in the postinstall hook the interrupt
handler could run any time. And it does modify DEIER to handle
interrupts.

Hence the DEIER read-modify-write cycle for enabling the PCU event
source is racy. Close this races the same way we handle vblank
interrupts: Unconditionally enable the interrupt in the IER register,
but conditionally mask it in IMR. The later poses no such race since
the interrupt handler does not touch DEIMR.

Also update the comment, the clearing has already happened
unconditionally above.

v2: Actually shove the updated comment into the right train^W commit,
as spotted by Paulo.

Cc: Paulo Zanoni <przanoni@gmail.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_irq.c