linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: ACPI Devel Mailing List <linux-acpi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-pci@vger.kernel.org, Len Brown <lenb@kernel.org>,
	Wei Kong <wkong@novell.com>, Jean Delvare <jdelvare@suse.com>,
	Matthew Garrett <mjg59@srcf.ucam.org>
Subject: [PATCH] PCI / ACPI: Do not request control of ASPM if the BIOS has disabled it
Date: Thu, 24 May 2012 22:45:45 +0200	[thread overview]
Message-ID: <201205242245.45888.rjw@sisk.pl> (raw)

From: Rafael J. Wysocki <rjw@sisk.pl>

We want to report that the kernel supports ASPM to the BIOS even if
the BIOS signals us that it doesn't.  So, we need the flags to include
(OSC_ACTIVE_STATE_PWR_SUPPORT | OSC_CLOCK_PWR_CAPABILITY_SUPPORT)
before calling acpi_pci_osc_support(root, flags) in
acpi_pci_root_add() (unless there's a command line telling us that
ASPM is not to be supported).

However, knowing that the BIOS doesn't support ASPM, we shouldn't
request the control of it, so we should remove
(OSC_ACTIVE_STATE_PWR_SUPPORT | OSC_CLOCK_PWR_CAPABILITY_SUPPORT)
from the flags before calling acpi_pci_osc_control_set() in those
cases.  Failing to do so causes the evaluation of _OSC for the PCI
root bridge to return error codes on some systems where it should
work correctly.

Reported-and-tested-by: Wei Kong <wkong@novell.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---

-stable material, I think.

Thanks,
Rafael

---
 drivers/acpi/pci_root.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux/drivers/acpi/pci_root.c
===================================================================
--- linux.orig/drivers/acpi/pci_root.c
+++ linux/drivers/acpi/pci_root.c
@@ -574,6 +574,10 @@ static int __devinit acpi_pci_root_add(s
 	if (flags != base_flags)
 		acpi_pci_osc_support(root, flags);
 
+	if (!pcie_aspm_enabled())
+		flags &= ~(OSC_ACTIVE_STATE_PWR_SUPPORT |
+			OSC_CLOCK_PWR_CAPABILITY_SUPPORT);
+
 	if (!pcie_ports_disabled
 	    && (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) {
 		flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL

             reply	other threads:[~2012-05-24 20:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-24 20:45 Rafael J. Wysocki [this message]
2012-05-24 20:45 ` [PATCH] PCI / ACPI: Do not request control of ASPM if the BIOS has disabled it Matthew Garrett
2012-05-25 11:53   ` Jean Delvare
2012-08-15 19:47 ` Bjorn Helgaas
2012-08-15 20:03   ` Rafael J. Wysocki

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=201205242245.45888.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=bhelgaas@google.com \
    --cc=jdelvare@suse.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=wkong@novell.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).