From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCADC51354E for ; Thu, 3 Sep 2026 20:10:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788466242; cv=none; b=GakboHPLIWDmoXI9fIADiGbGOR4EMAYM6ytTAfSSEmuRlGdfzRrj429q7GgRMr8T4FvvarSym+B2DVW7mShRnSUsbghmCKAo1CEdxSRcM6h3n6HfJe29s3V+t3qfogApRsM5L6hV4OU4y6+lytcXVUDx0cOSlaWfg6TqTXlEqFg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788466242; c=relaxed/simple; bh=TX+/5Wo4wtf6WTAbSoVWd2ZJerpeXwwrH+ylaorbFJk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mqX0MNoVPdlrPSINFx142JBFjhZJcdLo0wKWNJhLxtsDOtOX2hXoL50sYkfU/CaW+OwS1X5rLMzgfhyNT9US+37EklkUyTrtk+wq6Su3yAMRwJF2AxjV/jmAHCL54+iM/9vL+t3rAUa81aOff9Hf9diu+rt1ZtdG5IT207YUTt8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=KGElO9CM; arc=none smtp.client-ip=198.175.65.17 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.b="KGElO9CM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1788466236; x=1820002236; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=TX+/5Wo4wtf6WTAbSoVWd2ZJerpeXwwrH+ylaorbFJk=; b=KGElO9CMpSp4ANy9lY0PTwTExboHTr6hdmS+mPs9zyBso4GMZE1eqXXB N888KaAp+4xeTU3KFjNef8vRPdPImylphcmYIDwxSaoe43Dj5paHpROF4 LVIGRwJF8pC/Snjko2ne2B0wY3ctbeu+f/oQIxDm1yh2N2tfvQDXv0Zkx hIRCuK/gBS1twO4QZstqGd+ehhA8DzLPJVpKPDv7h8u6Qch9sNVI9JSb3 33rePgrw4wo9C/mvJGalz/I/U9LwwitigtxJN+nLb1r3quf56ivXXBqUH bdDx4xrYW3XeBP2Xn1JF1mKcj6IChEYyiq5Ij6BP6dYrpLJ6Wf3/Y804r Q==; X-CSE-ConnectionGUID: PbHisDuTTHGNcG/rpo1iRA== X-CSE-MsgGUID: Jd4wuXkJQWGrRobDAbiWvw== X-IronPort-AV: E=McAfee;i="6800,10657,11895"; a="88994573" X-IronPort-AV: E=Sophos;i="6.25,260,1779174000"; d="scan'208";a="88994573" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2026 13:10:21 -0700 X-CSE-ConnectionGUID: H/eWNqoQQbe2nd7VDHwDpg== X-CSE-MsgGUID: o2RFkbwwT7GHag30oB5QRg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,260,1779174000"; d="scan'208";a="273348056" Received: from mjruhl-vm.amr.corp.intel.com ([10.11.186.166]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2026 13:10:20 -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, karthik.poosa@intel.com Subject: [PATCH v5 05/18] platform/x86/intel/pmt: Do not remap when using callbacks Date: Thu, 3 Sep 2026 13:10:07 -0700 Message-ID: <20260903201002.1064889-25-michael.j.ruhl@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260903201002.1064889-20-michael.j.ruhl@intel.com> References: <20260903201002.1064889-20-michael.j.ruhl@intel.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit A callback indicates that the parent driver is responsible for accessing the data area. Creating a PMT memory remap is redundant. If a read_telem callback has been provided, do not create a remap. Signed-off-by: Michael J. Ruhl --- drivers/platform/x86/intel/pmt/class.c | 21 +++++++++++++-------- drivers/platform/x86/intel/pmt/class.h | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/platform/x86/intel/pmt/class.c b/drivers/platform/x86/intel/pmt/class.c index 402d51df834a..1c7a372b4fc4 100644 --- a/drivers/platform/x86/intel/pmt/class.c +++ b/drivers/platform/x86/intel/pmt/class.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -373,7 +374,6 @@ static int intel_pmt_dev_register(struct intel_pmt_entry *entry, struct device *parent) { struct intel_vsec_device *ivdev = dev_to_ivdev(parent); - struct resource res = {0}; struct device *dev; int ret; @@ -403,14 +403,19 @@ static int intel_pmt_dev_register(struct intel_pmt_entry *entry, if (!entry->size) return 0; - res.start = entry->base_addr; - res.end = res.start + entry->size - 1; - res.flags = IORESOURCE_MEM; + /* + * The read_telem callback is responsible for this mapping, and may have + * different requirements for use. If the callback is present do not + * create the map. + */ + if (!(entry->cb && entry->cb->read_telem)) { + struct resource res = DEFINE_RES_MEM(entry->base_addr, entry->size); - entry->base = devm_ioremap_resource(dev, &res); - if (IS_ERR(entry->base)) { - ret = PTR_ERR(entry->base); - goto fail_ioremap; + entry->base = devm_ioremap_resource(dev, &res); + if (IS_ERR(entry->base)) { + ret = PTR_ERR(entry->base); + goto fail_ioremap; + } } sysfs_bin_attr_init(&entry->pmt_bin_attr); diff --git a/drivers/platform/x86/intel/pmt/class.h b/drivers/platform/x86/intel/pmt/class.h index 258cb460e61c..aeb04afb67cf 100644 --- a/drivers/platform/x86/intel/pmt/class.h +++ b/drivers/platform/x86/intel/pmt/class.h @@ -48,7 +48,7 @@ struct intel_pmt_entry { const struct attribute_group *attr_grp; struct kobject *kobj; void __iomem *disc_table; - void __iomem *base; + void __iomem *base; /* unused if cb->read_telem is in use */ struct pmt_callbacks *cb; unsigned long base_addr; size_t size; -- 2.43.0