Commit 7e485d98 authored by Matt Roper's avatar Matt Roper Committed by Rodrigo Vivi

drm/xe: Interrupts are delivered per-tile, not per-GT

IRQ delivery and handling needs to be handled on a per-tile basis.  Note
that this is true even for the "GT interrupts" relating to engines and
GuCs --- the interrupts relating to both GTs get raised through a single
set of registers in the tile's sgunit range.

On true multi-tile platforms, interrupts on remote tiles are internally
forwarded to the root tile; the first thing the top-level interrupt
handler should do is consult the root tile's instance of
DG1_MSTR_TILE_INTR to determine which tile(s) had interrupts.  This
register is also responsible for enabling/disabling top-level reporting
of any interrupts to the OS.  Although this register technically exists
on all tiles, it should only be used on the root tile.

The (mis)use of struct xe_gt as a target for MMIO operations in the
driver makes the code somewhat confusing since we wind up needing a GT
pointer to handle programming that's unrelated to the GT.  To mitigate
this confusion, all of the xe_gt structures used solely as an MMIO
target in interrupt code are renamed to 'mmio' so that it's clear that
the structure being passed does not necessarily relate to any specific
GT (primary or media) that we might be dealing with interrupts for.
Reworking the driver's MMIO handling to not be dependent on xe_gt is
planned as a future patch series.

Note that GT initialization code currently calls xe_gt_irq_postinstall()
in an attempt to enable the HWE interrupts for the GT being initialized.
Unfortunately xe_gt_irq_postinstall() doesn't really match its name and
does a bunch of other stuff unrelated to the GT interrupts (such as
enabling the top-level device interrupts).  That will be addressed in
future patches.

v2:
 - Clarify commit message with explanation of why DG1_MSTR_TILE_INTR is
   only used on the root tile, even though it's an sgunit register that
   is technically present in each tile's MMIO space.  (Aravind)
 - Also clarify that the xe_gt used as a target for MMIO operations may
   or may not relate to the GT we're dealing with for interrupts.
   (Lucas)

Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: default avatarAravind Iddamsetty <aravind.iddamsetty@intel.com>
Link: https://lore.kernel.org/r/20230601215244.678611-22-matthew.d.roper@intel.comSigned-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent e2682f61
...@@ -310,7 +310,7 @@ static int gt_fw_domain_init(struct xe_gt *gt) ...@@ -310,7 +310,7 @@ static int gt_fw_domain_init(struct xe_gt *gt)
gt->info.engine_mask = gt->info.__engine_mask; gt->info.engine_mask = gt->info.__engine_mask;
/* Enables per hw engine IRQs */ /* Enables per hw engine IRQs */
xe_gt_irq_postinstall(gt); xe_gt_irq_postinstall(gt_to_tile(gt));
/* Rerun MCR init as we now have hw engine list */ /* Rerun MCR init as we now have hw engine list */
xe_gt_mcr_init(gt); xe_gt_mcr_init(gt);
......
This diff is collapsed.
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
#define _XE_IRQ_H_ #define _XE_IRQ_H_
struct xe_device; struct xe_device;
struct xe_gt; struct xe_tile;
int xe_irq_install(struct xe_device *xe); int xe_irq_install(struct xe_device *xe);
void xe_gt_irq_postinstall(struct xe_gt *gt); void xe_gt_irq_postinstall(struct xe_tile *tile);
void xe_irq_shutdown(struct xe_device *xe); void xe_irq_shutdown(struct xe_device *xe);
void xe_irq_suspend(struct xe_device *xe); void xe_irq_suspend(struct xe_device *xe);
void xe_irq_resume(struct xe_device *xe); void xe_irq_resume(struct xe_device *xe);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment