• Gustavo Sousa's avatar
    drm/xe/irq: Clear GFX_MSTR_IRQ as part of IRQ reset · 51a5d656
    Gustavo Sousa authored
    Starting with Xe_LP+, GFX_MSTR_IRQ contains status bits that have W1C
    behavior. If we do not properly reset them, we would miss delivery of
    interrupts if a pending bit is set when enabling IRQs.
    
    As an example, the display part of our probe routine contains paths
    where we wait for vblank interrupts. If a display interrupt was already
    pending when enabling IRQs, we would time out waiting for the vblank.
    
    That in fact happened recently when modprobing Xe on a Lunar Lake with a
    specific configuration; and that's how we found out we were missing this
    step in the IRQ enabling logic.
    
    Fix the issue by clearing GFX_MSTR_IRQ as part of the IRQ reset.
    
    v2:
      - Make resetting GFX_MSTR_IRQ be the last step to avoid bit
        re-latching. (Ville)
    v3:
      - Swap nesting order: guard loop with the IP version check instead of
        doing the check at each iteration. (Lucas)
    v4:
      - Add braces for the "if" statement guarding the loop to make the
        compiler happy. (Gustavo)
    
    BSpec: 50875, 54028, 62357
    Cc: Matt Roper <matthew.d.roper@intel.com>
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
    Link: https://lore.kernel.org/r/20230926221914.106843-2-gustavo.sousa@intel.comSigned-off-by: default avatarGustavo Sousa <gustavo.sousa@intel.com>
    Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
    51a5d656
xe_irq.c 16.6 KB