From patchwork Sun Jun 1 16:33:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Garrett X-Patchwork-Id: 4278821 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 037159F1D6 for ; Sun, 1 Jun 2014 16:35:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2BF7F201ED for ; Sun, 1 Jun 2014 16:35:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4CEFD201C7 for ; Sun, 1 Jun 2014 16:35:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738AbaFAQeV (ORCPT ); Sun, 1 Jun 2014 12:34:21 -0400 Received: from cavan.codon.org.uk ([93.93.128.6]:59917 "EHLO cavan.codon.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752540AbaFAQeU (ORCPT ); Sun, 1 Jun 2014 12:34:20 -0400 Received: from 209-6-207-143.c3-0.smr-ubr2.sbo-smr.ma.cable.rcn.com ([209.6.207.143] helo=localhost.lan) by cavan.codon.org.uk with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wr8i4-0005vY-Oe; Sun, 01 Jun 2014 17:34:14 +0100 From: Matthew Garrett 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 Date: Sun, 1 Jun 2014 12:33:54 -0400 Message-Id: <1401640436-1947-3-git-send-email-matthew.garrett@nebula.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1401640436-1947-1-git-send-email-matthew.garrett@nebula.com> References: <1401640436-1947-1-git-send-email-matthew.garrett@nebula.com> X-SA-Do-Not-Run: Yes X-SA-Exim-Connect-IP: 209.6.207.143 X-SA-Exim-Mail-From: matthew.garrett@nebula.com X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-ASN: Subject: [PATCH 2/4] ACPI: Don't call PCI OSC on Apple hardware when claiming to be Darwin X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:54:46 +0000) X-SA-Exim-Scanned: Yes (on cavan.codon.org.uk) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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. */