Skip to content

Commit 42adbdc

Browse files
maciej-w-rozyckibjorn-helgaas
authored andcommitted
PCI: Initialize dev->link_active_reporting earlier
Determine whether Data Link Layer Link Active Reporting is available before calling any fixups so that the cached value can be used there and later on. [bhelgaas: move to set_pcie_port_type() where other PCIe init is done] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maciej W. Rozycki <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent c6f54cf commit 42adbdc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/pci/probe.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,6 @@ static void pci_set_bus_speed(struct pci_bus *bus)
820820

821821
pcie_capability_read_dword(bridge, PCI_EXP_LNKCAP, &linkcap);
822822
bus->max_bus_speed = pcie_link_speed[linkcap & PCI_EXP_LNKCAP_SLS];
823-
bridge->link_active_reporting = !!(linkcap & PCI_EXP_LNKCAP_DLLLARC);
824823

825824
pcie_capability_read_word(bridge, PCI_EXP_LNKSTA, &linksta);
826825
pcie_update_link_speed(bus, linksta);
@@ -1527,6 +1526,7 @@ void set_pcie_port_type(struct pci_dev *pdev)
15271526
{
15281527
int pos;
15291528
u16 reg16;
1529+
u32 reg32;
15301530
int type;
15311531
struct pci_dev *parent;
15321532

@@ -1540,6 +1540,10 @@ void set_pcie_port_type(struct pci_dev *pdev)
15401540
pci_read_config_dword(pdev, pos + PCI_EXP_DEVCAP, &pdev->devcap);
15411541
pdev->pcie_mpss = FIELD_GET(PCI_EXP_DEVCAP_PAYLOAD, pdev->devcap);
15421542

1543+
pcie_capability_read_dword(pdev, PCI_EXP_LNKCAP, &reg32);
1544+
if (reg32 & PCI_EXP_LNKCAP_DLLLARC)
1545+
pdev->link_active_reporting = 1;
1546+
15431547
parent = pci_upstream_bridge(pdev);
15441548
if (!parent)
15451549
return;

0 commit comments

Comments
 (0)