linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch]pci: fix a panic in pcie_aspm_init_link_state
@ 2012-03-22  4:07 Shaohua Li
  2012-03-23 16:27 ` Matthew Garrett
  0 siblings, 1 reply; 2+ messages in thread
From: Shaohua Li @ 2012-03-22  4:07 UTC (permalink / raw)
  To: mjg, jbarnes; +Cc: linux-pci


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@kernel.org>

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch]pci: fix a panic in pcie_aspm_init_link_state
  2012-03-22  4:07 [patch]pci: fix a panic in pcie_aspm_init_link_state Shaohua Li
@ 2012-03-23 16:27 ` Matthew Garrett
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Garrett @ 2012-03-23 16:27 UTC (permalink / raw)
  To: Shaohua Li; +Cc: jbarnes, linux-pci

On Thu, Mar 22, 2012 at 12:07:34PM +0800, Shaohua Li wrote:
> 
> 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?

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-23 16:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-22  4:07 [patch]pci: fix a panic in pcie_aspm_init_link_state Shaohua Li
2012-03-23 16:27 ` Matthew Garrett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).