diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2021-09-02 14:56:42 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-09-02 14:56:42 -0500 |
commit | 34627f4dcd0f4fefab9e0eb88a45aad4178064f7 (patch) | |
tree | 8f6e38891f6831aa515ec57e903a81d3797e8cf2 /drivers/pci | |
parent | 03816e7f7887747548fc2ced59933cd421bf0cf8 (diff) | |
parent | 00823dcbdd415c868390feaca16f0265101efab4 (diff) |
Merge branch 'pci/portdrv'
- Enable Bandwidth Notification only if port supports it (Stuart Hayes)
* pci/portdrv:
PCI/portdrv: Enable Bandwidth Notification only if port supports it
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pcie/portdrv_core.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index e1fed6649c41..3ee63968deaa 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -257,8 +257,13 @@ static int get_port_device_capability(struct pci_dev *dev) services |= PCIE_PORT_SERVICE_DPC; if (pci_pcie_type(dev) == PCI_EXP_TYPE_DOWNSTREAM || - pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) - services |= PCIE_PORT_SERVICE_BWNOTIF; + 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; + } return services; } |