• Imre Deak's avatar
    drm/i915: fix HPD IRQ reenable work cancelation · 6323751d
    Imre Deak authored
    Atm, the HPD IRQ reenable timer can get rearmed right after it's
    canceled. Also to access the HPD IRQ mask registers we need to wake up
    the HW.
    
    Solve both issues by converting the reenable timer to a delayed work and
    grabbing a runtime PM reference in the work. By this we can also forgo
    canceling the timer during runtime suspend, since the only important
    thing there is that the HW is awake when we write the registers and
    that's ensured by the RPM ref. So do the cancelation only during driver
    unload time; this is also a requirement for an upcoming patch where we
    want to cancel all HPD related works only during system suspend and
    driver unload time, but not during runtime suspend.
    
    Note that there is still a race between the HPD IRQ reenable work and
    drm_irq_uninstall() during driver unload, where the work can reenable
    the HPD IRQs disabled by drm_irq_uninstall(). This isn't a problem since
    the HPD IRQs will still be effectively masked by the first level
    interrupt mask.
    
    v2-3:
    - unchanged
    v4:
    - use proper API for changing the expiration time for an already pending
      delayed work (Jani)
    Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
    Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v2)
    Cc: stable@vger.kernel.org (3.16+)
    Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
    6323751d
i915_irq.c 135 KB