mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
platform/x86/intel/vsec: Restore BAR fallback for header walk
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: 904b333fc5 ("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>
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Link: https://patch.msgid.link/20260529183150.129744-1-david.e.box@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
6e9cab2247
commit
375bbbbd11
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user