Skip to contentSkip to conversation

pci: fix a panic in pcie_aspm_init_link_state

PATCH In review Shaohua Li 2 participants 2 messages Mar 22, 2012 – Mar 23, 2012 PCI

lore
Share & tools
lore

Shaohua Li

author
#0 lore raw

PATCH 1/1 pci: fix a panic in pcie_aspm_init_link_state

My desktop always painc in pcie_aspm_init_link_state. Looks commit 4949be16822e92 causes it. The FADT declaims the system doesn't support ASPM. Below patch fixes the painc for me. I'm quite strange we still touch aspm registers even aspm_disabled.

drivers/pci/pcie/aspm.c +5 -4
index 24f049e..2e8eb86 100644
@@ -500,9 +500,6 @@ static int pcie_aspm_sanity_check(struct pci_dev *pdev)
 	int pos;
 	u32 reg32;
 
-	if (aspm_disabled)
-		return 0;
-
 	/*
 	 * Some functions in a slot might not all be PCIe functions,
 	 * very strange. Disable ASPM for the whole slot
@@ -566,7 +563,11 @@ static struct pcie_link_state *alloc_pcie_link_state(struct pci_dev *pdev)
 void pcie_aspm_init_link_state(struct pci_dev *pdev)
 {
 	struct pcie_link_state *link;
-	int blacklist = !!pcie_aspm_sanity_check(pdev);
+	int blacklist;
+
+	if (aspm_disabled)
+		return;
+	blacklist = !!pcie_aspm_sanity_check(pdev);
 
 	if (!pci_is_pcie(pdev) || pdev->link_state)
 		return;
#1 lore raw
Quoted 5 lines · Shaohua Li

My desktop always painc in pcie_aspm_init_link_state. Looks commit 4949be16822e92 causes it. The FADT declaims the system doesn't support ASPM. Below patch fixes the painc for me. I'm quite strange we still touch aspm registers even aspm_disabled.

If the device gives us ASPM control via _OSC and the FADT indicates that the system doesn't support ASPM, we want to clear the ASPM state - so we can't simply disable ASPM in that case. Can you get the actual backtrace?

Signature · 1 line
Matthew Garrett | [email protected]