From: Matt Roper Date: Mon, 13 Oct 2025 20:09:53 +0000 (-0700) Subject: drm/xe/query: Report hwconfig size as 0 if primary GT is disabled X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=090e7fc422a5810b0267d2e83859e05b53007563;p=thirdparty%2Fkernel%2Flinux.git drm/xe/query: Report hwconfig size as 0 if primary GT is disabled 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 Link: https://lore.kernel.org/r/20251013200944.2499947-35-matthew.d.roper@intel.com Signed-off-by: Matt Roper --- diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c index 2e9ff33ed2fe2..1c0915e2cc16e 100644 --- a/drivers/gpu/drm/xe/xe_query.c +++ b/drivers/gpu/drm/xe/xe_query.c @@ -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(>->uc.guc); + size_t size = gt ? xe_guc_hwconfig_size(>->uc.guc) : 0; void __user *query_ptr = u64_to_user_ptr(query->data); void *hwconfig;