Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.12 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795103699; b=GlWREyWlM0eymho1ouSfgFUHhZPia7VzGooUizdeFHHikFfpYJoJtrpfDdCy0jEsPEAu aMJ0c7UNBhaKI1PwynVQHw43pyk1rzeEJK7vr+19OzgorJXCezka2j3MhHLnREiSl/DHq T6NDAN6ELb6mAwJvE2dXGpT4XxnJZFISIMTueD2YzpAMMvNRAkTb1sP4NGtlnZj4eqRHd etFIx97nkSCgCYZAIbRxTdli1/BBnH/jiuZLclBGuopsCK5tf6QwIwbzqfcAVguX88oGy VE8P59XUypjmi68b8Cv2Fsw2gXV8zP2ZHbx265631G7npQLi5cZe5GgHztaf4eSPCqg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795103699; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:To:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=L2Ik0Ny5XHs7QaR2GGO+Hd9Fbby9S3G/BaIlRBJlhaE=; b=g+tgs/JWs0fMF7xKosDURs6Uos09Axt2D37FI4rrliSHyUHcU31sw0FnxjVZe8bNTAKt aXUnK0nWUnnqqjCOXCEe8YYqVJ9L5D4/qnwaqgjP+rvVTgfIXlaYgWprqzs4dlD15NLy2 2Wyz+HzmkwiCUbH4adiSb/K4752V1YmWOgE5If60ewwPILtteWfKgRDJtw+X4lKWwbJK7 K8MDdy3T49LY84hvQhzT8mc070MFVLec8VQyey2fkdHTi7sIpD9HEfGJVH8JQmOYvTTAu q6c6mGvNFIoyBF5sBwXpSAEWxoGzIkhO5LMjUVvjacQPPqSaEenkbjSPD4rR4uCGV8g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=LTRTohdD; arc=none smtp.remote-ip=192.198.163.12 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE79F606A32C for ; Thu, 19 Nov 2026 15:54:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AE79F606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com 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=LTRTohdD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1795103698; x=1826639698; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=sNBZBhODUIN+kKI9C5cmSmwZHsUjWRmkortTjnqPaoo=; b=LTRTohdD62HlcnJsLpYSn3Z3L8uj38hcY9EXiOqXgjEhdImpjU2oR8eg 8lIQVoXzX0zqi90DETW36/9SDRLfn0JWtkWZMa6FicHbQu720RWp4qS/x 0/TkO67VvNeYSbUz/6sd+MdM2TDMkXSvqNNv0VKLsUzXq29NQeepLnpu+ Z33mkrAqKe8l1Waa4laH2xZpM150cC4eIL+aXfqUN2/BKZTh68fdnwukK SkzxA35t7qWWUPWNX734tj37LVjilBuKcWmVAhJSjJKLwhYsaL9bO8Skx IiVgEV0nTqEbnGXjOuroqSMMTwi1sKxIjXsRjUmzyByxuFR/XfZyojqa5 A==; X-CSE-ConnectionGUID: RQXUWuO+SWuKryViI0+i2Q== X-CSE-MsgGUID: qSPwExmtTr2+S9LT9y9afQ== X-IronPort-AV: E=McAfee;i="6800,10657,11971"; a="3849002" X-IronPort-AV: E=Sophos;i="6.27,221,1787036400"; d="scan'208";a="3849002" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2026 07:54:54 -0800 X-CSE-ConnectionGUID: sxSdNGKxThCz8mkhztBiAw== X-CSE-MsgGUID: v/y7LF/KSsePIX1+iBmgkA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,221,1787036400"; d="scan'208";a="10263418" Received: from mjruhl-vm.amr.corp.intel.com ([10.11.186.166]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2026 07:54:53 -0800 From: "Michael J. Ruhl" To: platform-driver-x86@vger.kernel.org, intel-xe@lists.freedesktop.org, hansg@kernel.org, ilpo.jarvinen@linux.intel.com, 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 v19 11/19] drm/xe/vsec: Add base_offset to allow for more flexibilty Date: Thu, 19 Nov 2026 07:54:49 -0800 Message-ID: <20261119155438.40762-32-michael.j.ruhl@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261119155438.40762-21-michael.j.ruhl@intel.com> References: <20261119155438.40762-21-michael.j.ruhl@intel.com> X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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