Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86/intel/vsec: Restore BAR fallback for header walk
@ 2026-05-29 18:31 David E. Box
  2026-05-29 18:38 ` ✓ CI.KUnit: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: David E. Box @ 2026-05-29 18:31 UTC (permalink / raw)
  To: ilpo.jarvinen, michael.j.ruhl, david.e.box
  Cc: matthew.brost, thomas.hellstrom, intel-xe, linux-kernel,
	platform-driver-x86

The base_addr refactor changed intel_vsec_walk_header() to pass
info->base_addr as the discovery-table base address. For the PCI VSEC
driver this info comes from driver_data, but exported callers may provide
their own static headers and leave base_addr unset.

For xe, this made the discovery-table base address zero instead of the BAR
selected by header->tbir, preventing PMT endpoints from being created.

Restore the previous behavior for the header-walk path by falling back to
pci_resource_start(pdev, header->tbir) when base_addr is not specified.
Keep explicit base_addr override behavior unchanged.

This preserves the refactor structure while fixing the functional
regression in manual-header users.

Fixes: 904b333fc51c ("platform/x86/intel/vsec: Refactor base_addr handling")
Assisted-by: Claude:claude-sonnet-4-6
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
---
 drivers/platform/x86/intel/vsec.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c
index 1657834fd275..3c6d8a1928c0 100644
--- a/drivers/platform/x86/intel/vsec.c
+++ b/drivers/platform/x86/intel/vsec.c
@@ -482,10 +482,25 @@ static int intel_vsec_walk_header(struct device *dev,
 				  const struct intel_vsec_platform_info *info)
 {
 	struct intel_vsec_header **header = info->headers;
+	u64 base_addr;
 	int ret;
 
 	for ( ; *header; header++) {
-		ret = intel_vsec_register_device(dev, *header, info, info->base_addr);
+		if (info->base_addr) {
+			base_addr = info->base_addr;
+		} else {
+			struct pci_dev *pdev;
+
+			if (!dev_is_pci(dev)) {
+				dev_err(dev, "non-PCI device without a base address\n");
+				return -EINVAL;
+			}
+
+			pdev = to_pci_dev(dev);
+			base_addr = pci_resource_start(pdev, (*header)->tbir);
+		}
+
+		ret = intel_vsec_register_device(dev, *header, info, base_addr);
 		if (ret)
 			return ret;
 	}

base-commit: a167ae8eace52dd6c80438b77d92450fe12cd4be
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-06-10 13:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-29 18:31 [PATCH] platform/x86/intel/vsec: Restore BAR fallback for header walk David E. Box
2026-05-29 18:38 ` ✓ CI.KUnit: success for " Patchwork
2026-05-29 19:20 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-29 22:22 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-06-03 18:32 ` [PATCH] " Ruhl, Michael J
2026-06-07 19:38   ` David Box
2026-06-08 14:05     ` Ruhl, Michael J
2026-06-09 10:19       ` Ilpo Järvinen
2026-06-09 12:43         ` Ruhl, Michael J
2026-06-09 16:31           ` David Box
2026-06-10 13:29 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox