linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: mjg@redhat.com, jbarnes@virtuousgeek.org
Cc: linux-pci@vger.kernel.org
Subject: [patch]pci: fix a panic in pcie_aspm_init_link_state
Date: Thu, 22 Mar 2012 12:07:34 +0800	[thread overview]
Message-ID: <4F6AA586.70403@kernel.org> (raw)


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;

             reply	other threads:[~2012-03-22  4:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22  4:07 Shaohua Li [this message]
2012-03-23 16:27 ` [patch]pci: fix a panic in pcie_aspm_init_link_state Matthew Garrett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F6AA586.70403@kernel.org \
    --to=shli@kernel.org \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mjg@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).