Skip to content

Commit d6fc451

Browse files
Hans Zhangbjorn-helgaas
authored andcommitted
PCI: cadence: Search for MSI Capability with correct ID
907912c ("PCI: cadence: Use cdns_pcie_find_*capability() to avoid hardcoding offsets") incorrectly searched for the MSI-X Capability ID instead of the MSI Capability ID in cdns_pcie_ep_get_msi(). Search for PCI_CAP_ID_MSI, not PCI_CAP_ID_MSIX, to fix this problem. Fixes: 907912c ("PCI: cadence: Use cdns_pcie_find_*capability() to avoid hardcoding offsets") Reported-by: Sasha Levin <sashal@kernel.org> Closes: https://lore.kernel.org/r/aOfMk9BW8BH2P30V@laps/ Signed-off-by: Hans Zhang <18255117159@163.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20251010144307.12979-1-18255117159@163.com
1 parent 3a86608 commit d6fc451

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/controller/cadence/pcie-cadence-ep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static int cdns_pcie_ep_get_msi(struct pci_epc *epc, u8 fn, u8 vfn)
255255
u16 flags, mme;
256256
u8 cap;
257257

258-
cap = cdns_pcie_find_capability(pcie, PCI_CAP_ID_MSIX);
258+
cap = cdns_pcie_find_capability(pcie, PCI_CAP_ID_MSI);
259259
fn = cdns_pcie_get_fn_from_vfn(pcie, fn, vfn);
260260

261261
/* Validate that the MSI feature is actually enabled. */

0 commit comments

Comments
 (0)