From patchwork Thu Jan 5 14:20:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 9499079 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1549B606B5 for ; Thu, 5 Jan 2017 14:25:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05EDA283EB for ; Thu, 5 Jan 2017 14:25:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC758283F9; Thu, 5 Jan 2017 14:24:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C9C4283EB for ; Thu, 5 Jan 2017 14:24:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161572AbdAEOY6 (ORCPT ); Thu, 5 Jan 2017 09:24:58 -0500 Received: from mga14.intel.com ([192.55.52.115]:43911 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161551AbdAEOY5 (ORCPT ); Thu, 5 Jan 2017 09:24:57 -0500 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 05 Jan 2017 06:24:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,321,1477983600"; d="scan'208";a="805454507" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by FMSMGA003.fm.intel.com with SMTP; 05 Jan 2017 06:24:53 -0800 Received: by lahna (sSMTP sendmail emulation); Thu, 05 Jan 2017 16:20:29 +0200 Date: Thu, 5 Jan 2017 16:20:29 +0200 From: Mika Westerberg To: "Rafael J. Wysocki" Cc: Peter Wu , Lukas Wunner , Bjorn Helgaas , Kilian Singer , linux-pci , Alex Deucher , Dave Airlie Subject: Re: PCI: Revert "PCI: Add runtime PM support for PCIe ports" Message-ID: <20170105142029.GF3353@lahna.fi.intel.com> References: <20161228161816.GA19653@bhelgaas-glaptop.roam.corp.google.com> <20170104081639.GA21076@wunner.de> <20170104210954.GA11946@al> <59349185.1aqio7kYFn@aspire.rjw.lan> <20170105104940.GA3353@lahna.fi.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170105104940.GA3353@lahna.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.7.1 (2016-10-04) 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 On Thu, Jan 05, 2017 at 12:49:40PM +0200, Mika Westerberg wrote: > On Wed, Jan 04, 2017 at 10:58:10PM +0100, Rafael J. Wysocki wrote: > > I would rather add a quirk to the ACPI core to prevent the power resources in > > question from being enumerated. Or even to prevent ACPI PM from being > > used for the port in question. > > If we are going to add a quirk, I agree that it should be put to the > ACPI core. > > However, Windows seems to be able to use _PR3 just fine. So there is > something that we are missing or do not implement properly which causes > all the troubles. IMHO we should try to find out what that difference is > and fix that if possible. Here is one idea. The _OSC method is used as a handshake between OS and the BIOS to enable/disable certain features. One of those features is _PR3 support (ACPI specification 6.1 p.328): This bit is set if OSPM supports reading _PR3and using power resources to switch power. Note this handshake translates to an operating model that the platform and OSPM supports both the power model containing both D3hot and D3. Some of our development platforms has BIOS option "RTD3 enable" which is used to enable/disable this flag (among other things). The BIOS should return acked caps when _OSC returns but we never check those in Linux. Kilian, can you try the below patch and send back dmesg when the system has been booted? It should show if the BIOS acks _PR3 or not. --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 95855cb9d6fb..463eb2d69271 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -345,8 +345,15 @@ static void acpi_bus_osc_support(void) capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_APEI_SUPPORT; if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))) return; + + acpi_handle_info(handle, "Supported caps: 0x%08x\n", capbuf[1]); + if (ACPI_SUCCESS(acpi_run_osc(handle, &context))) { u32 *capbuf_ret = context.ret.pointer; + + acpi_handle_info(handle, "Acked caps: 0x%08x (_PR3: %s)\n", capbuf_ret[1], + capbuf_ret[1] & OSC_SB_PR3_SUPPORT ? "on" : "off"); + if (context.ret.length > OSC_SUPPORT_DWORD) { osc_sb_apei_support_acked = capbuf_ret[OSC_SUPPORT_DWORD] & OSC_SB_APEI_SUPPORT;