From: Matthew Garrett <matthew.garrett@nebula.com>
To: rjw@rjwysocki.net
Cc: lenb@kernel.org, robert.moore@intel.com, lv.zheng@intel.com,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, bhelgaas@google.com,
Matthew Garrett <matthew.garrett@nebula.com>
Subject: [PATCH 2/4] ACPI: Don't call PCI OSC on Apple hardware when claiming to be Darwin
Date: Sun, 1 Jun 2014 12:33:54 -0400 [thread overview]
Message-ID: <1401640436-1947-3-git-send-email-matthew.garrett@nebula.com> (raw)
In-Reply-To: <1401640436-1947-1-git-send-email-matthew.garrett@nebula.com>
The Apple PCI _OSC method has the following code:
if (LEqual (0x01, OSDW ()))
if (LAnd (LEqual (Arg0, GUID), NEXP)
(do stuff)
else
(fail)
NEXP is a value in high memory and is presumably under the control of the
firmware. No methods set it. The methods that are called in the "do stuff"
path are dummies. Unless there's some additional firmware call in early boot,
there's no way for this call to succeed - and even if it does, it doesn't do
anything.
The easiest way to handle this is simply to ignore it. We know which flags
would be set, so just set them by hand if the platform is running in Darwin
mode.
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
---
drivers/acpi/pci_root.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index d388f13..f04b6b9 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -430,6 +430,17 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm,
acpi_handle handle = device->handle;
/*
+ * Apple always return failure on _OSC calls when _OSI("Darwin") has
+ * been called successfully. We know the feature set supported by the
+ * platform, so avoid calling _OSC at all
+ */
+
+ if (acpi_gbl_osi_data == ACPI_OSI_DARWIN) {
+ root->osc_control_set = ~OSC_PCI_EXPRESS_PME_CONTROL;
+ return;
+ }
+
+ /*
* All supported architectures that use ACPI have support for
* PCI domains, so we indicate this in _OSC support capabilities.
*/
--
1.8.5.3
next prev parent reply other threads:[~2014-06-01 16:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-01 16:33 ACPI: Improve behaviour on Apple hardware Matthew Garrett
2014-06-01 16:33 ` [PATCH 1/4] ACPI: Support _OSI("Darwin") correctly Matthew Garrett
2014-06-17 12:11 ` Rafael J. Wysocki
2014-06-17 14:46 ` Matthew Garrett
2014-06-18 5:26 ` Matthew Garrett
2014-06-18 23:42 ` Rafael J. Wysocki
2014-06-01 16:33 ` Matthew Garrett [this message]
2014-06-01 16:33 ` [PATCH 3/4] ACPI: Don't assume the existence of an SBS charger Matthew Garrett
2014-06-01 16:33 ` [PATCH 4/4] ACPI: Disable smart battery manager on Apple 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=1401640436-1947-3-git-send-email-matthew.garrett@nebula.com \
--to=matthew.garrett@nebula.com \
--cc=bhelgaas@google.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=rjw@rjwysocki.net \
--cc=robert.moore@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
all inboxes | Powered by JetHome®