]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/query: Report hwconfig size as 0 if primary GT is disabled
authorMatt Roper <matthew.d.roper@intel.com>
Mon, 13 Oct 2025 20:09:53 +0000 (13:09 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Tue, 14 Oct 2025 14:44:58 +0000 (07:44 -0700)
The hwconfig table is part of the primary GT's GuC firmware.  If the
primary GT is disabled, the hwconfig is unavailable and should be
reported to userspace as having size 0.

Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Link: https://lore.kernel.org/r/20251013200944.2499947-35-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
drivers/gpu/drm/xe/xe_query.c

index 2e9ff33ed2fe2a25f5aa493853c4e114a001dff1..1c0915e2cc16ed8bdb035d0aac23f74474b51e06 100644 (file)
@@ -436,7 +436,7 @@ static int query_hwconfig(struct xe_device *xe,
                          struct drm_xe_device_query *query)
 {
        struct xe_gt *gt = xe_root_mmio_gt(xe);
-       size_t size = xe_guc_hwconfig_size(&gt->uc.guc);
+       size_t size = gt ? xe_guc_hwconfig_size(&gt->uc.guc) : 0;
        void __user *query_ptr = u64_to_user_ptr(query->data);
        void *hwconfig;