summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorGustavo Sousa <gustavo.sousa@intel.com>2026-06-09 17:17:40 -0300
committerGustavo Sousa <gustavo.sousa@intel.com>2026-07-02 18:41:55 -0300
commit723c3407fb8b4d3a31ddb56cd52ef5194d7684fd (patch)
tree0c35849b975d9395a36608dc24ad49d0f241dbd0 /drivers/gpu
parent13bebc7171e6fd47ad7b28989c08283508fb4389 (diff)
downloadlinux-next-723c3407fb8b4d3a31ddb56cd52ef5194d7684fd.tar.gz
linux-next-723c3407fb8b4d3a31ddb56cd52ef5194d7684fd.zip
drm/xe: Don't initialize tile_count in xe_info_init_early()
The value of xe->info.tile_count is only really valid after xe_info_probe_tile_count(). Any use of tile_count before that point is invalid and, consequently, initializing it in xe_info_init_early() is pointless. Move the initialization to xe_info_probe_tile_count(). Reviewed-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com> Reviewed-by: Violet Monti <violet.monti@intel.com> Link: https://patch.msgid.link/20260609-xe-probe-info-v1-8-21e83e188e60@intel.com Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/xe/tests/xe_pci.c5
-rw-r--r--drivers/gpu/drm/xe/xe_pci.c10
2 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/drm/xe/tests/xe_pci.c b/drivers/gpu/drm/xe/tests/xe_pci.c
index cd64b1d614c8..31ec41aa997d 100644
--- a/drivers/gpu/drm/xe/tests/xe_pci.c
+++ b/drivers/gpu/drm/xe/tests/xe_pci.c
@@ -311,9 +311,10 @@ const void *xe_pci_id_gen_param(struct kunit *test, const void *prev, char *desc
}
EXPORT_SYMBOL_IF_KUNIT(xe_pci_id_gen_param);
-static void fake_xe_info_probe_tile_count(struct xe_device *xe)
+static void fake_xe_info_probe_tile_count(struct xe_device *xe,
+ const struct xe_device_desc *desc)
{
- /* Nothing to do, just use the statically defined value. */
+ xe->info.tile_count = 1 + desc->max_remote_tiles;
}
static int fake_probe_info(struct xe_device *xe,
diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index ec1967e3e064..674948f55d51 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -813,7 +813,6 @@ static int xe_info_init_early(struct xe_device *xe,
xe_assert(xe, desc->max_gt_per_tile > 0);
xe_assert(xe, desc->max_gt_per_tile <= XE_MAX_GT_PER_TILE);
xe->info.max_gt_per_tile = desc->max_gt_per_tile;
- xe->info.tile_count = 1 + desc->max_remote_tiles;
err = xe_tile_init_early(xe_device_get_root_tile(xe), xe, 0);
if (err)
@@ -825,13 +824,16 @@ static int xe_info_init_early(struct xe_device *xe,
/*
* Possibly override number of tile based on configuration register.
*/
-static void xe_info_probe_tile_count(struct xe_device *xe)
+static void xe_info_probe_tile_count(struct xe_device *xe,
+ const struct xe_device_desc *desc)
{
struct xe_mmio *mmio;
u8 tile_count;
u32 mtcfg;
- KUNIT_STATIC_STUB_REDIRECT(xe_info_probe_tile_count, xe);
+ KUNIT_STATIC_STUB_REDIRECT(xe_info_probe_tile_count, xe, desc);
+
+ xe->info.tile_count = 1 + desc->max_remote_tiles;
/*
* Probe for tile count only for platforms that support multiple
@@ -1037,7 +1039,7 @@ static int xe_info_init(struct xe_device *xe,
xe->info.has_soc_remapper_telem = 0;
}
- xe_info_probe_tile_count(xe);
+ xe_info_probe_tile_count(xe, desc);
for_each_remote_tile(tile, xe, id) {
int err;