• Rodrigo Vivi's avatar
    drm/xe: Fix an invalid locking wait context bug · f83a30f4
    Rodrigo Vivi authored
    We cannot have spin locks around xe_irq_reset, since it will
    call the intel_display_power_is_enabled() function, and
    that needs a mutex lock. Hence causing the undesired
    "[ BUG: Invalid wait context ]"
    
    We cannot convert i915's power domain lock to spin lock
    due to the nested dependency of non-atomic context waits.
    
    So, let's move the xe_irq_reset functions from the
    critical area, while still ensuring that we are protecting
    the irq.enabled and ensuring the right serialization
    in the irq handlers.
    
    v2: On the first version, I had missed the fact that
    irq.enabled is checked on the xe/display glue layer,
    and that i915 display code is actually using the irq
    spin lock properly. So, this got changed to a version
    suggested by Matthew Auld.
    
    v3: do not use lockdep_assert for display glue.
        do not save restore irq from inside IRQ or we can
        get bogus irq restore warnings
    
    Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/463Suggested-by: default avatarMatthew Auld <matthew.auld@intel.com>
    Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
    Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
    f83a30f4
xe_irq.c 14.9 KB