From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: linux-usb@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org,
Jesse Barnes <jbarnes@virtuousgeek.org>,
Ozan Caglayan <ozan@pardus.org.tr>
Subject: [PATCH 1/2] PCI/ACPI: Report ASPM support to BIOS if not disabled from command line
Date: Wed, 2 Mar 2011 23:32:46 +0100 [thread overview]
Message-ID: <201103022332.46791.rjw@sisk.pl> (raw)
In-Reply-To: <201103022330.49297.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
We need to distinguish the situation in which ASPM support is
disabled from the command line or through .config from the situation
in which it is disabled, because the hardware or BIOS can't handle
it. In the former case we should not report ASPM support to the BIOS
through ACPI _OSC, but in the latter case we should do that.
Introduce pcie_aspm_support_enabled() that can be used by
acpi_pci_root_add() to determine whether or not it should report ASPM
support to the BIOS through _OSC.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/acpi/pci_root.c | 2 +-
drivers/pci/pcie/aspm.c | 7 +++++++
include/linux/pci.h | 7 +++----
3 files changed, 11 insertions(+), 5 deletions(-)
Index: linux-2.6/drivers/pci/pcie/aspm.c
===================================================================
--- linux-2.6.orig/drivers/pci/pcie/aspm.c
+++ linux-2.6/drivers/pci/pcie/aspm.c
@@ -69,6 +69,7 @@ struct pcie_link_state {
};
static int aspm_disabled, aspm_force, aspm_clear_state;
+static bool aspm_support_enabled = true;
static DEFINE_MUTEX(aspm_lock);
static LIST_HEAD(link_list);
@@ -896,6 +897,7 @@ static int __init pcie_aspm_disable(char
{
if (!strcmp(str, "off")) {
aspm_disabled = 1;
+ aspm_support_enabled = false;
printk(KERN_INFO "PCIe ASPM is disabled\n");
} else if (!strcmp(str, "force")) {
aspm_force = 1;
@@ -930,3 +932,8 @@ int pcie_aspm_enabled(void)
}
EXPORT_SYMBOL(pcie_aspm_enabled);
+bool pcie_aspm_support_enabled(void)
+{
+ return aspm_support_enabled;
+}
+EXPORT_SYMBOL(pcie_aspm_support_enabled);
Index: linux-2.6/drivers/acpi/pci_root.c
===================================================================
--- linux-2.6.orig/drivers/acpi/pci_root.c
+++ linux-2.6/drivers/acpi/pci_root.c
@@ -564,7 +564,7 @@ static int __devinit acpi_pci_root_add(s
/* Indicate support for various _OSC capabilities. */
if (pci_ext_cfg_avail(root->bus->self))
flags |= OSC_EXT_PCI_CONFIG_SUPPORT;
- if (pcie_aspm_enabled())
+ if (pcie_aspm_support_enabled())
flags |= OSC_ACTIVE_STATE_PWR_SUPPORT |
OSC_CLOCK_PWR_CAPABILITY_SUPPORT;
if (pci_msi_enabled())
Index: linux-2.6/include/linux/pci.h
===================================================================
--- linux-2.6.orig/include/linux/pci.h
+++ linux-2.6/include/linux/pci.h
@@ -1002,12 +1002,11 @@ extern bool pcie_ports_auto;
#endif
#ifndef CONFIG_PCIEASPM
-static inline int pcie_aspm_enabled(void)
-{
- return 0;
-}
+static inline int pcie_aspm_enabled(void) { return 0; }
+static inline bool pcie_aspm_support_enabled(void) { return false; }
#else
extern int pcie_aspm_enabled(void);
+extern bool pcie_aspm_support_enabled(void);
#endif
#ifdef CONFIG_PCIEAER
next prev parent reply other threads:[~2011-03-02 22:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-28 1:42 2.6.38 regression caused by commit 415e12b Sarah Sharp
2011-02-28 5:34 ` Sarah Sharp
2011-02-28 20:29 ` Rafael J. Wysocki
2011-03-01 18:31 ` Sarah Sharp
2011-03-01 20:55 ` Rafael J. Wysocki
2011-03-01 22:51 ` Sarah Sharp
2011-03-01 23:30 ` Rafael J. Wysocki
2011-03-02 0:04 ` Sarah Sharp
2011-03-02 0:17 ` Rafael J. Wysocki
2011-03-02 3:42 ` Sarah Sharp
2011-03-02 11:21 ` Rafael J. Wysocki
2011-03-02 22:30 ` [PATCH 0/2] " Rafael J. Wysocki
2011-03-02 22:32 ` Rafael J. Wysocki [this message]
2011-03-02 22:33 ` [PATCH 2/2] PCI/ACPI: Report MSI support to BIOS if not disabled from command line Rafael J. Wysocki
2011-03-04 17:52 ` [PATCH 0/2] Re: 2.6.38 regression caused by commit 415e12b Sarah Sharp
2011-03-04 20:32 ` Rafael J. Wysocki
2011-03-14 23:56 ` Sarah Sharp
2011-03-15 0:02 ` 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=201103022332.46791.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=ozan@pardus.org.tr \
--cc=sarah.a.sharp@linux.intel.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