• Daniel Vetter's avatar
    drm/i915: close tiny race in the ilk pcu even interrupt setup · 6005ce42
    Daniel Vetter authored
    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: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    6005ce42
i915_irq.c 103 KB