From patchwork Wed Aug 9 22:34:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 9892391 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 5FA1260384 for ; Wed, 9 Aug 2017 22:43:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 536F0289E5 for ; Wed, 9 Aug 2017 22:43:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48919289FC; Wed, 9 Aug 2017 22:43:38 +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=unavailable 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 04852289E5 for ; Wed, 9 Aug 2017 22:43:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752594AbdHIWmz (ORCPT ); Wed, 9 Aug 2017 18:42:55 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:51212 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752403AbdHIWmz (ORCPT ); Wed, 9 Aug 2017 18:42:55 -0400 Received: from 79.184.253.199.ipv4.supernova.orange.pl (79.184.253.199) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.82) id 0bd37b952efa7b4e; Thu, 10 Aug 2017 00:42:53 +0200 From: "Rafael J. Wysocki" To: Linux ACPI Cc: Mika Westerberg , Srinivas Pandruvada , Linux PCI , LKML , Lv Zheng , Bob Moore Subject: [PATCH 3/3] ACPI / scan: Enable GPEs before scanning the namespace Date: Thu, 10 Aug 2017 00:34:23 +0200 Message-ID: <6344941.kJ2o2XerZ0@aspire.rjw.lan> In-Reply-To: <12346760.yAFCnkEgf6@aspire.rjw.lan> References: <12346760.yAFCnkEgf6@aspire.rjw.lan> MIME-Version: 1.0 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 From: Rafael J. Wysocki On some systems the platform firmware expects GPEs to be enabled before the enumeration of devices and if that expectation is not met, the systems in question may not boot in some situations. For this reason, change the initialization ordering of the ACPI subsystem to make it enable GPEs before scanning the namespace for the first time in order to enumerate devices. Reported-by: Mika Westerberg Suggested-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki Acked-by: Lv Zheng --- drivers/acpi/scan.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: linux-pm/drivers/acpi/scan.c =================================================================== --- linux-pm.orig/drivers/acpi/scan.c +++ linux-pm/drivers/acpi/scan.c @@ -2139,6 +2139,10 @@ int __init acpi_scan_init(void) acpi_get_spcr_uart_addr(); } + acpi_gpe_apply_masked_gpes(); + acpi_update_all_gpes(); + acpi_ec_ecdt_start(); + mutex_lock(&acpi_scan_lock); /* * Enumerate devices in the ACPI namespace. @@ -2163,10 +2167,6 @@ int __init acpi_scan_init(void) } } - acpi_gpe_apply_masked_gpes(); - acpi_update_all_gpes(); - acpi_ec_ecdt_start(); - acpi_scan_initialized = true; out: