[patch]pci: fix a panic in pcie_aspm_init_link_state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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.

Signed-off-by: Shaohua Li <shli@xxxxxxxxxx>

diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 24f049e..2e8eb86 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -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;
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux