]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf/dwc_pcie: Qualify RAS DES VSEC Capability by Vendor, Revision
authorBjorn Helgaas <bhelgaas@google.com>
Mon, 9 Dec 2024 22:29:38 +0000 (16:29 -0600)
committerWill Deacon <will@kernel.org>
Wed, 11 Dec 2024 21:46:36 +0000 (21:46 +0000)
commitb34d605d120f09303cf8d9e25ad3e17a4997c3a1
tree60125c007c8d808a5763d9477661d243145cbc10
parentf03241fbebdf47b9b435752f7e72d3f1e96e4529
perf/dwc_pcie: Qualify RAS DES VSEC Capability by Vendor, Revision

PCI Vendor-Specific (VSEC) Capabilities are defined by each vendor.
Devices from different vendors may advertise a VSEC Capability with the DWC
RAS DES functionality, but the vendors may assign different VSEC IDs.

Search for the DWC RAS DES Capability using the VSEC ID and VSEC Rev
chosen by the vendor.

This does not fix a current problem because Alibaba, Ampere, and Qualcomm
all assigned the same VSEC ID and VSEC Rev for the DWC RAS DES Capability.

The potential issue is that we may add support for a device from another
vendor, where the vendor has already assigned DWC_PCIE_VSEC_RAS_DES_ID
(0x02) for an unrelated VSEC.  In that event, dwc_pcie_des_cap() would find
the unrelated VSEC and mistakenly assume it was a DWC RAS DES Capability.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-and-tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Reviewed-and-tested-by: Shuai Xue <xueshuai@linux.alibaba.com>
Link: https://lore.kernel.org/r/20241209222938.3219364-1-helgaas@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/dwc_pcie_pmu.c