From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D02D5C5CFDB for ; Wed, 12 Aug 2026 19:37:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 76A8B10E459; Wed, 12 Aug 2026 19:37:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="m4ed8sXb"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id A416510E459 for ; Wed, 12 Aug 2026 19:37:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786563478; x=1818099478; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=IDb6Ixz9/y5Puin5GHNA6oNcgYp9d0JoawAmDv8Dzak=; b=m4ed8sXbakeoR1hZ4ZcZfjDCAhZNhdSWU6K0VXAMNBUGmsHy5ounmo5Q 9json06XMXoilnZUjv9uW7ixGJ4mlPZUXu5sh9uh1Kvxz9a3/haRU60Ra DD+TJGzGkTmL5LiGzQo+/HJhpc/X6h0NREsTEo8AqEwT5dDquVfAb10Dy 5hopwY+mdLwbqrMUgg5ZuPQWn7GqK4NuH2fapyseBaPBAFfrF0mQ2rjY7 bV1iSTgKpOTyz8tRlA10qYyUl9bi8pJKTVBDg6HlhMAO4tnYY7S+CXMEZ j8Q8hGXjMA05lzhDYAa4y+OC9NmdPd4pde0hmGpX730Gdd25Ue1AE4Poy g==; X-CSE-ConnectionGUID: gickVh+FQP66ELL50TVwdQ== X-CSE-MsgGUID: WMkocNADRhuaUnOIzz/ajA== X-IronPort-AV: E=McAfee;i="6800,10657,11873"; a="104515377" X-IronPort-AV: E=Sophos;i="6.25,220,1779174000"; d="scan'208";a="104515377" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2026 12:37:58 -0700 X-CSE-ConnectionGUID: oZxlQbQTQgybQh0B/Axzhw== X-CSE-MsgGUID: 6KhLng/MT8+TTxLJMdSfmQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,220,1779174000"; d="scan'208";a="263779922" Received: from mjruhl-vm.amr.corp.intel.com ([10.11.186.166]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2026 12:37:57 -0700 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 v2 03/10] drm/xe/vsec: Protect against missing config Date: Wed, 12 Aug 2026 12:37:44 -0700 Message-ID: <20260812193742.2170188-15-michael.j.ruhl@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260812193742.2170188-12-michael.j.ruhl@intel.com> References: <20260812193742.2170188-12-michael.j.ruhl@intel.com> 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-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" Some init paths (VF) will not provide soc-remapper callbacks. BMG PMT access requires the soc-remapper. If the soc-remapper is not configured, do not register for PMT, and block read access. Signed-off-by: Michael J. Ruhl --- drivers/gpu/drm/xe/xe_vsec.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c index a9baf0bfe572..bd83a33aef6c 100644 --- a/drivers/gpu/drm/xe/xe_vsec.c +++ b/drivers/gpu/drm/xe/xe_vsec.c @@ -149,6 +149,9 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse u32 offset; int ret; + if (!xe->soc_remapper.set_telem_region) + return -ENODEV; + ret = xe_guid_decode(guid, &mem_region, &offset); if (ret) return ret; @@ -157,9 +160,6 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse guard(mutex)(&xe->pmt.lock); - if (!xe->soc_remapper.set_telem_region) - return -ENODEV; - /* indicate that we are not at an appropriate power level */ if (!xe_pm_runtime_get_if_active(xe)) return -ENODATA; @@ -210,6 +210,8 @@ void xe_vsec_init(struct xe_device *xe) switch (platform) { case XE_VSEC_BMG: + if (!xe->soc_remapper.set_telem_region) + return; info->priv_data = &xe_pmt_cb; break; default: -- 2.43.0