Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C6D2606CDE9 for ; Fri, 13 Nov 2026 16:52:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=H0A4hozC Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3902610EC6E; Fri, 13 Nov 2026 16:52:00 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 273E610E176 for ; Fri, 13 Nov 2026 16:51:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1794588712; x=1826124712; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=sNBZBhODUIN+kKI9C5cmSmwZHsUjWRmkortTjnqPaoo=; b=H0A4hozCqCqIHrkjrNw1FPi5y/32qwpbgC9gR6rhbGb1sY7NciRI4xA/ Ecv5aK7FRc76dgkG0h5+lDZl9MXda2WO/s/HFAwvkOkX6ggJLPrbHk423 7UqziJl1LHvwBWgDeo2ftFTyHM19OegU2jzCEuO3qQd24uzsUoYi7Lajv 3eNHJ3k5VzDqS59ofYFc+vtGC0bnrOLP+APgsHCYSuid6UG/Axd5BaEEG gYMlM+YfvJQ6M0QqjELMSUOfydN0VIJed5Pipe2fuJ4bPxbpxMRxU8cpe Ord+PCjrIvZbOSwELuOn4tXbq5HuAU6Dr/qkGqwjLrSClf2CVd+UGRkGq w==; X-CSE-ConnectionGUID: Lpmsa/exS/uscaHkbq7Z2Q== X-CSE-MsgGUID: 02TLlBx7R2S7s9JV6i+xWQ== X-IronPort-AV: E=McAfee;i="6800,10657,11965"; a="3392145" X-IronPort-AV: E=Sophos;i="6.27,212,1787036400"; d="scan'208";a="3392145" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2026 08:51:37 -0800 X-CSE-ConnectionGUID: d1FXYp7CSH+7uh3gpJjqIw== X-CSE-MsgGUID: e55lE/52TOG9RYlZwTabkA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,212,1787036400"; d="scan'208";a="9230807" Received: from mjruhl-vm.amr.corp.intel.com ([10.11.186.166]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2026 08:51:37 -0800 From: "Michael J. Ruhl" To: intel-xe@lists.freedesktop.org, matthew.brost@intel.com, rodrigo.vivi@intel.com, thomas.hellstrom@linux.intel.com, airlied@gmail.com, simona@ffwll.ch, david.e.box@linux.intel.com, anoop.c.vijay@intel.com, badal.nilawar@intel.com, matthew.d.roper@intel.com, james.ausmus@intel.com Subject: [PATCH v15 09/17] drm/xe/vsec: Add base_offset to allow for more flexibilty Date: Fri, 13 Nov 2026 08:51:35 -0800 Message-ID: <20261113165127.1989471-28-michael.j.ruhl@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261113165127.1989471-19-michael.j.ruhl@intel.com> References: <20261113165127.1989471-19-michael.j.ruhl@intel.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Intel-xe" X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Current pmt_telem_read() usage is a fixed (for BMG) offset. In order to support other devices this must be settable. Add a base offset for more flexibility. Add a check to verify that it has been set before allowing device access. Reviewed-by: Rodrigo Vivi Signed-off-by: Michael J. Ruhl --- drivers/gpu/drm/xe/xe_device_types.h | 2 ++ drivers/gpu/drm/xe/xe_vsec.c | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h index 8f2a31949073..28b1669a14d8 100644 --- a/drivers/gpu/drm/xe/xe_device_types.h +++ b/drivers/gpu/drm/xe/xe_device_types.h @@ -485,6 +485,8 @@ struct xe_device { struct { /** @pmt.lock: protect access for telemetry data */ struct mutex lock; + /** @pmt.base_offset: device specific base offset */ + u64 base_offset; } pmt; /** @soc_remapper: SoC remapper object */ diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c index ebe56c85bc05..04aec1e5c15c 100644 --- a/drivers/gpu/drm/xe/xe_vsec.c +++ b/drivers/gpu/drm/xe/xe_vsec.c @@ -172,6 +172,7 @@ static int xe_guid_decode(u32 guid, int *index, u32 *offset) * * Return: * * -ENODEV device is not available (hotplug) + * * -EAGAIN base_offset has not been set, so init path has not yet been done. * * -ENODATA for incorrect power state * * -EINVAL for unsupported PMT feature * * count number of bytes read on success @@ -180,8 +181,8 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse u32 count) { struct xe_device *xe = kdev_to_xe_device(dev); - void __iomem *telem_addr = xe->mmio.regs + BMG_TELEMETRY_OFFSET; u32 cap_type = FIELD_GET(GUID_CAP_TYPE, guid); + void __iomem *telem_addr = xe->mmio.regs + xe->pmt.base_offset; u32 mem_region; u32 offset; int ret = 0; @@ -192,6 +193,11 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse if (!drm_dev_enter(&xe->drm, &idx)) return -ENODEV; + if (!xe->pmt.base_offset) { + ret = -EAGAIN; + goto dev_exit; + } + ret = xe_guid_decode(guid, &mem_region, &offset); if (ret) goto dev_exit; @@ -269,6 +275,7 @@ void xe_vsec_init(struct xe_device *xe) switch (platform) { case XE_VSEC_BMG: + xe->pmt.base_offset = BMG_TELEMETRY_OFFSET; info->priv_data = &xe_pmt_cb; break; default: -- 2.43.0