Skip to content

Commit cfc0028

Browse files
committed
PCI/ASPM: Ignore L1 PM Substates if device lacks capability
187f91d ("PCI/ASPM: Remove struct aspm_register_info.l1ss_cap") inadvertently removed a check for existence of the L1 PM Substates (L1SS) Capability before reading it. If there is no L1SS Capability, this means we mistakenly read PCI_COMMAND and PCI_STATUS (config address 0x04) and interpret that as the PCI_L1SS_CAP register, so we may incorrectly configure L1SS. Make sure the L1SS Capability exists before trying to read it. Fixes: 187f91d ("PCI/ASPM: Remove struct aspm_register_info.l1ss_cap") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]>
1 parent 9e2a031 commit cfc0028

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/pci/pcie/aspm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,9 @@ static void aspm_l1ss_init(struct pcie_link_state *link)
560560
u32 parent_l1ss_cap, child_l1ss_cap;
561561
u32 parent_l1ss_ctl1 = 0, child_l1ss_ctl1 = 0;
562562

563+
if (!parent->l1ss || !child->l1ss)
564+
return;
565+
563566
/* Setup L1 substate */
564567
pci_read_config_dword(parent, parent->l1ss + PCI_L1SS_CAP,
565568
&parent_l1ss_cap);

0 commit comments

Comments
 (0)