From patchwork Thu Feb 8 19:12:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 10207819 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 8C5FF602D8 for ; Thu, 8 Feb 2018 19:13:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DF8929583 for ; Thu, 8 Feb 2018 19:13:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72B5329598; Thu, 8 Feb 2018 19:13:56 +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 3E0CE29583 for ; Thu, 8 Feb 2018 19:13:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752441AbeBHTNw convert rfc822-to-8bit (ORCPT ); Thu, 8 Feb 2018 14:13:52 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:45437 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752433AbeBHTNu (ORCPT ); Thu, 8 Feb 2018 14:13:50 -0500 Received: from 79.184.255.223.ipv4.supernova.orange.pl (79.184.255.223) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id f659358947aa2e87; Thu, 8 Feb 2018 20:13:48 +0100 From: "Rafael J. Wysocki" To: =?ISO-8859-1?Q?Bj=F8rn?= Mork , Markus Demleitner Cc: Greg KH , Andreas Lindhe , Gjorgji Jankovski , Damjan Georgievski , Fernando Chaves , Tomislav Ivek , "Denis P." , "linux-acpi@vger.kernel.org" Subject: Re: [Bug 197863] Thinkpad X240 resume dramatically slower on kernels 4.13+ Date: Thu, 08 Feb 2018 20:12:06 +0100 Message-ID: <4333304.2V78SBapX3@aspire.rjw.lan> In-Reply-To: References: MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wednesday, February 7, 2018 11:44:15 PM CET Rafael J. Wysocki wrote: > On Mon, Feb 5, 2018 at 6:06 PM, Rafael J. Wysocki > wrote: > > On 2/5/2018 3:14 PM, Bjørn Mork wrote: > >> > >> "Rafael J. Wysocki" writes: > >>> > >>> On 2/4/2018 9:28 PM, Bjørn Mork wrote: > >>> > >>>> But I do wonder if the attached (completely untested!!) patch makes > >>>> things any better? > >>> > >>> I don't think so, the macro is needed too. > >> > >> Doh! Obviously. Don't know how I managed to miss that. > >> > >>> I'll queue up a full revert of 662591461c4b9a1e3b. > >> > >> Still with the additional exception for "ec == first_ec"? > >> > > > > No, just a full revert for now. > > That doesn't work, because we made some changes on top of this commit. > > I'll send a patch to try tomorrow. Below is a patch for the mainline (should be applicable to 4.15.y) to test. Please let me know if it improves things for you. The corresponding fix for -stable would still be a full revert of 662591461c4b9a1e3b, but it needs to be fixed in the mainline first. --- drivers/acpi/ec.c | 6 ++++++ 1 file changed, 6 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-pm/drivers/acpi/ec.c =================================================================== --- linux-pm.orig/drivers/acpi/ec.c +++ linux-pm/drivers/acpi/ec.c @@ -1927,6 +1927,9 @@ static int acpi_ec_suspend_noirq(struct ec->reference_count >= 1) acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_DISABLE); + if (acpi_sleep_no_ec_events()) + acpi_ec_enter_noirq(ec); + return 0; } @@ -1934,6 +1937,9 @@ static int acpi_ec_resume_noirq(struct d { struct acpi_ec *ec = acpi_driver_data(to_acpi_device(dev)); + if (acpi_sleep_no_ec_events()) + acpi_ec_leave_noirq(ec); + if (ec_no_wakeup && test_bit(EC_FLAGS_STARTED, &ec->flags) && ec->reference_count >= 1) acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_ENABLE);