]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/xe: Defer gt->mmio initialization until after multi-tile setup
authorMatt Roper <matthew.d.roper@intel.com>
Tue, 17 Sep 2024 22:16:16 +0000 (15:16 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Wed, 18 Sep 2024 19:52:53 +0000 (12:52 -0700)
commit58548b91101f0a8772d1fe992cac7cd3226a471e
tree6b9aa4c2e685d140b54c26136e46f87d239967e6
parent1378c633a3fbfeb344c486ffda0e920a21e62712
drm/xe: Defer gt->mmio initialization until after multi-tile setup

With the recent xe_mmio redesign, tiles and GTs each have their own MMIO
accessor, with the GT inheriting some of the information (such as the
iomap pointer) from their containing tile.  Given that non-root tiles
get initialized later than the root tile (and currently after the point
at which GT MMIO is initialized for _all_ GTs), we wind up incorrectly
inheriting uninitialized pointers for the initialization of GT MMIO for
GTs that reside on non-root tiles.  This causes a driver crash on
multi-tile PVC platforms.

With the general xe_mmio redesign, it's now only necessary to do the
GT-level MMIO setup before the point we start reading/writing GT
registers.  Move initialization of gt->mmio out of xe_info_init (which
runs before non-root tiles are initialized) and to the beginning of
where we start actually accessing the GTs themselves.

The high-level initialization flow now boils down to:
 - General device init, software-only setup
 - (no register access possible yet)
 - Root tile initialization
 - (access to device/tile0 registers possible via xe_root_tile_mmio())
 - Initialization of non-root tiles
 - (access to any tile's registers possible via tile->mmio)
 - GT MMIO initialization, inheriting iomap from each GT's tile
 - (access to any GT's registers possible via gt->mmio)

Fixes: fa599b8c95a7 ("drm/xe: Populate GT's mmio iomap from tile during init")
Reported-by: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Sai Teja Pottumuttu <sai.teja.pottumuttu@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240917221615.875962-2-matthew.d.roper@intel.com
drivers/gpu/drm/xe/xe_device.c
drivers/gpu/drm/xe/xe_gt.c
drivers/gpu/drm/xe/xe_gt.h
drivers/gpu/drm/xe/xe_pci.c