From patchwork Wed Nov 29 06:06:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 10081447 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 CADA86020B for ; Wed, 29 Nov 2017 06:06:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC136295BA for ; Wed, 29 Nov 2017 06:06:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE9B3295C5; Wed, 29 Nov 2017 06:06:40 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 49092295BA for ; Wed, 29 Nov 2017 06:06:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750813AbdK2GGj (ORCPT ); Wed, 29 Nov 2017 01:06:39 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:46817 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750812AbdK2GGj (ORCPT ); Wed, 29 Nov 2017 01:06:39 -0500 Received: by mail-qk0-f194.google.com with SMTP id b184so2992448qkc.13 for ; Tue, 28 Nov 2017 22:06:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to:cc; bh=GlosFU3e42ZBjb1gbswwXwNifM04ol8NHo6gojn8aQw=; b=OO7gezaYJ8OKm4VniAWgvniwKBW8r9/I6H7qqbmx4Tdi7+1kBBfNebsLZBH8nM6/MO oSNQN/Lpd34E46HIy/awtuBUkm3AW8tDfOFyIa1TBjstPN7AxXYrzqXIugJkELunfUPR 89P7Luyl/1JLUtTfsFi+cOga3v3bCuR0nVvRek/jEhqbLTEG5ubMt4PNIcTDbxwXrau9 qb5T3iSy4cLzRiTLUaLdBq1jozhe+wr5MdOGS0DLusmmT6SsHoWZOJey77NKMDblIy8W On/Cqjz0KN919s9g/BDC6jPWJ8kSYUrnavQYgLGX02psYvLiOtN3/+XECQJoyFScZxnt DGaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to:cc; bh=GlosFU3e42ZBjb1gbswwXwNifM04ol8NHo6gojn8aQw=; b=GJrtzeB0IXol1AAxvxcm72Yz9IO7IJA23+hJOoElu181V+Kiv8lQGaropGj8kYcmVy 3apb6LEtjLRcNO1Cz16wbJrq152EUAfsSRaHns0Qw4gPAUdb+F5VdUYripG8oYQCaTNp YuUesB5FlBlGaWE6HRLU80qx+HE1u5hCAXIuXsDIXPtOoV65rRnf9gG0q6O01JCCgd3q ppN+2STdjiUxQrWs1OhI1KM1LwfRlhOI64Br3ZHfNBMQZ1hTalcgkjJfiI+nkCs2VDp0 6UZCWKuvQQAwlFOpV+jwsZ/a3t3QjNTnO+kSUuz1EeJ8abY2PTFrjJ4j1zCG/xLRanYL O21Q== X-Gm-Message-State: AJaThX74fxL/Zt3bWXArCYzO7V/ZIITuPJymr2Sjqdj8sh6knnaFu+ja YTbiFqi9HZEpGJi1o6+1jwDqL2Ht0hQrgTeSDhOtww== X-Google-Smtp-Source: AGs4zMYSy2yFawBFFwSxKnaTw86AAMaonbuSN4HFe5GJyTB1YZmmVy3X1F+XSR0Y2EyNI7rersjfpN8icM0kI9qcrqU= X-Received: by 10.55.72.6 with SMTP id v6mr2767744qka.333.1511935598391; Tue, 28 Nov 2017 22:06:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.3.162 with HTTP; Tue, 28 Nov 2017 22:06:37 -0800 (PST) From: Len Brown Date: Wed, 29 Nov 2017 01:06:37 -0500 X-Google-Sender-Auth: lg-0nhNgyJP3qC1qJQ3VRq2M7ek Message-ID: Subject: Dell XPS13 9360 - 1,000ms acpi_pm_finish() To: "Rafael J. Wysocki" Cc: linux acpi 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 Rafael, Per our discussion... As of Linux-4.14, acpi_pm_finish() takes over 1,000 ms on the Dell XPS13. This routine accounts for 50% of the total resume time of this machine. So I commented _WAK out of acpi_hw_legacy_wake(), and that 1000ms became 2ms. (and the system also seemed to resume fine without _WAK, though I didn't test it extensively) So I effectively pre-pended acpi_pm_finish() to acpi_pm_end() with the hack patch below, and that seems to work fine. (Note that it seems that the relative ordering of enabling run-time GPEs and invoking _WAK is already correct in acpi_hw_legacy_wake() -- the GPEs are enabled first.) So the question becomes... How early does _WAK really need to be? thanks Len Brown, Intel Open Source Technology Center --- 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 diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 8082871b409a..f25f1874cfaf 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -495,6 +495,8 @@ static void acpi_pm_start(u32 acpi_state) */ static void acpi_pm_end(void) { + printk("lenb: acpi_pm_finish from within acpi_pm_end\n"); + acpi_pm_finish(); acpi_turn_off_unused_power_resources(); acpi_scan_lock_release(); /* @@ -639,7 +641,6 @@ static const struct platform_suspend_ops acpi_suspend_ops = { .begin = acpi_suspend_begin, .prepare_late = acpi_pm_prepare, .enter = acpi_suspend_enter, - .wake = acpi_pm_finish, .end = acpi_pm_end, };