mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
PCI/portdrv: Enable Bandwidth Notification only if port supports it
commit00823dcbddupstream. Previously we assumed that all Root Ports and Switch Downstream Ports supported Link Bandwidth Notification. Per spec, this is only required for Ports supporting Links wider than x1 and/or multiple Link speeds (PCIe r5.0, sec 7.5.3.6). Because we assumed all Ports supported it, we tried to set up a Bandwidth Notification IRQ, which failed for devices that don't support IRQs at all, which meant pcieport didn't attach to the Port at all. Check the Link Bandwidth Notification Capability bit and enable the service only when the Port supports it. [bhelgaas: commit log] Fixes:e8303bb7a7("PCI/LINK: Report degraded links via link bandwidth notification") Link: https://lore.kernel.org/r/20210512213314.7778-1-stuart.w.hayes@gmail.com Signed-off-by: Stuart Hayes <stuart.w.hayes@gmail.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Lukas Wunner <lukas@wunner.de> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
74d6dfcb0f
commit
9302a3c00c
@@ -260,8 +260,13 @@ static int get_port_device_capability(struct pci_dev *dev)
|
|||||||
services |= PCIE_PORT_SERVICE_DPC;
|
services |= PCIE_PORT_SERVICE_DPC;
|
||||||
|
|
||||||
if (pci_pcie_type(dev) == PCI_EXP_TYPE_DOWNSTREAM ||
|
if (pci_pcie_type(dev) == PCI_EXP_TYPE_DOWNSTREAM ||
|
||||||
pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT)
|
pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) {
|
||||||
|
u32 linkcap;
|
||||||
|
|
||||||
|
pcie_capability_read_dword(dev, PCI_EXP_LNKCAP, &linkcap);
|
||||||
|
if (linkcap & PCI_EXP_LNKCAP_LBNC)
|
||||||
services |= PCIE_PORT_SERVICE_BWNOTIF;
|
services |= PCIE_PORT_SERVICE_BWNOTIF;
|
||||||
|
}
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user