From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) (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 791942E8DFC; Fri, 22 May 2026 02:22:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779416522; cv=none; b=oe/TIkSGF4tnRRtW5Rjzd4Dmxa+B5O74gx4arcQYXbkwpTc0FHFt5UH0CL5drcsmq+mgNacfsRutoNl2U9UOeUAFboYZWvf9iFoch6R249QgA9xuIJF04fXgtng+qaMu3dgoJy8j4UPPmB7mxUl3Jfx2IE+tPBYL+1dIws0Eb7Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779416522; c=relaxed/simple; bh=UkU81TlLVP15SShmfrmA+bWgGik7ABAMjs1Rum0u5wo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JVwOnyB0GkNSSpkaOyN0JodfE+M2lhMN5CAR80U5d87OwqEyPygmBg29RM1qUVRaea3dUNOpw22lahd1T464RjcNYVWa41vBHLB0hoxsbIvbsc1rAzptS5res3VGGNCsIyZn0Io91sOopqO5cOM4niE7+RWw6AATR6ogfAb3YEM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=krbSjs+7; arc=none smtp.client-ip=198.175.65.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="krbSjs+7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1779416521; x=1810952521; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UkU81TlLVP15SShmfrmA+bWgGik7ABAMjs1Rum0u5wo=; b=krbSjs+7Uib8wbrczKgnAjUjQX3b/uXgX4w5h4nVCLXQ3WPAQssfc/NP 5UEkpr7mqKMRbIcsBij6Cw2YZJQlUP0VrAuYLb7yNzlAu1UkzjqJ+5pbm iLk8+3m03kyyqf1Q0VMFR76EY2qIGQeoSW8zvNFJ5z2gO4t0eyAApaL5s QcHxQZk+g5VcDsszrdlWzWhT2EbIgbPPXdft2ducHLooGj2czUCK+nigt bNPtM7QIcAOwfqnHGD+6EnWa0EgNSKvDsdSJz/Z94xL/Tb0wQyj6SitkY 8WGbqLVqVEb1l51yaR+YcfKuWqk9SHPEPMLsvkqhcNEMAOW1L7sSpQfsi A==; X-CSE-ConnectionGUID: PSVegJvpRDSCVgzIWtCqIQ== X-CSE-MsgGUID: nGChMR0LRKSQhySqr3xNeg== X-IronPort-AV: E=McAfee;i="6800,10657,11793"; a="80400524" X-IronPort-AV: E=Sophos;i="6.24,161,1774335600"; d="scan'208";a="80400524" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2026 19:21:59 -0700 X-CSE-ConnectionGUID: o/vvf2YcQWu7OGEgj68d2A== X-CSE-MsgGUID: 9P+ZQDAERxSdxnY41MtwJg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,161,1774335600"; d="scan'208";a="236335370" Received: from debox1-desk4.jf.intel.com ([10.88.27.138]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2026 19:21:58 -0700 From: "David E. Box" To: Rajneesh Bhardwaj , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Hans de Goede Cc: "David E. Box" , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Xi Pardee , Srinivas Pandruvada Subject: [PATCH v5 04/16] platform/x86/intel/pmt: Pass discovery index instead of resource Date: Thu, 21 May 2026 19:21:34 -0700 Message-ID: <20260522022147.4137494-5-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260522022147.4137494-1-david.e.box@linux.intel.com> References: <20260522022147.4137494-1-david.e.box@linux.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: quoted-printable Change PMT class code to pass a discovery index rather than a direct struct resource when creating entries. This allows the class to identify the discovery source generically without assuming PCI BAR resources. For PCI devices, the index still resolves to a resource in the intel_vsec_device. Other discovery sources, such as ACPI, can use the same index without needing a struct resource. Signed-off-by: David E. Box --- V5 - No changes V4 - No changes V3 changes: - Rebased after dropping the previous "Move header decode into common helper" patch - Adjusted the intel_pmt_populate_entry() call path to match the restored intel_pmt_dev_create() flow - Did not apply Ilpo V2 signoff due to these changes. V2 - No changes drivers/platform/x86/intel/pmt/class.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/intel/pmt/class.c b/drivers/platform/x86/= intel/pmt/class.c index 9b315334a69b..7da8279b54f8 100644 --- a/drivers/platform/x86/intel/pmt/class.c +++ b/drivers/platform/x86/intel/pmt/class.c @@ -206,11 +206,12 @@ EXPORT_SYMBOL_GPL(intel_pmt_class); =20 static int intel_pmt_populate_entry(struct intel_pmt_entry *entry, struct intel_vsec_device *ivdev, - struct resource *disc_res) + int idx) { struct pci_dev *pci_dev =3D to_pci_dev(ivdev->dev); struct device *dev =3D &ivdev->auxdev.dev; struct intel_pmt_header *header =3D &entry->header; + struct resource *disc_res; u8 bir; =20 /* @@ -235,6 +236,7 @@ static int intel_pmt_populate_entry(struct intel_pmt_en= try *entry, * For access_type LOCAL, the base address is as follows: * base address =3D end of discovery region + base offset */ + disc_res =3D &ivdev->resource[idx]; entry->base_addr =3D disc_res->end + 1 + header->base_offset; =20 /* @@ -397,7 +399,7 @@ int intel_pmt_dev_create(struct intel_pmt_entry *entry,= struct intel_pmt_namespa return ret; } =20 - ret =3D intel_pmt_populate_entry(entry, intel_vsec_dev, disc_res); + ret =3D intel_pmt_populate_entry(entry, intel_vsec_dev, idx); if (ret) return ret; =20 --=20 2.43.0