From patchwork Thu Nov 10 21:35:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Limonciello, Mario" X-Patchwork-Id: 9422109 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 ED8F360512 for ; Thu, 10 Nov 2016 21:48:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D048D297CA for ; Thu, 10 Nov 2016 21:48:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4FC3297D5; Thu, 10 Nov 2016 21:48:20 +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 4F286297CA for ; Thu, 10 Nov 2016 21:48:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964856AbcKJVsT (ORCPT ); Thu, 10 Nov 2016 16:48:19 -0500 Received: from esa2.dell-outbound.iphmx.com ([68.232.149.220]:32867 "EHLO esa2.dell-outbound.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965150AbcKJVsS (ORCPT ); Thu, 10 Nov 2016 16:48:18 -0500 X-Greylist: delayed 754 seconds by postgrey-1.27 at vger.kernel.org; Thu, 10 Nov 2016 16:48:18 EST DomainKey-Signature: s=smtpout; d=dell.com; c=simple; q=dns; h=Received:Received:X-LoopCount0:X-IronPort-AV:From:To:Cc: Subject:Date:Message-Id:X-Mailer; b=c4KJqDzD6nDnoKORDFwG3HIxTlH38h5mmYT/5ufhoud9u98I5QQmsee7 enDf4VjrIt5UUaPMHW/xtVY6pdYCJcpa5yRtOjSb30D2zcWmE5eYBfHua kSvqTyzMp5s/PWAe3I44smzMFSAcPTFVeYMwoZ3sMzlDwJEAkwuL2d9iB c=; DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1478814498; x=1510350498; h=from:to:cc:subject:date:message-id; bh=lcIQkAkg93kG/8LPCa6Sr6E/DL6pJCC0AieiEz5HVDU=; b=Tk4QM6p7+K72nfnG2m2Esnp0aNjq4J0Xjh9oAxGnVTwNOY9HNHsu5SIC 6QAIjSmHLtzm1mVoKyrx6TC767g0qaRYDhonNJzyEGAX1sfoPT7TeSQwE tzTd0IJy5KJYpVPNQCN36+7sD0hAwzr72pgz9kFhIqYT05c8isck99DaS Y=; Received: from esa3.dell-outbound2.iphmx.com ([68.232.154.63]) by esa2.dell-outbound.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Nov 2016 15:35:43 -0600 Received: from ausxippc110.us.dell.com ([143.166.85.200]) by esa3.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Nov 2016 03:35:43 +0600 X-LoopCount0: from 10.208.86.39 X-IronPort-AV: E=Sophos;i="5.31,620,1473138000"; d="scan'208";a="435092967" From: Mario Limonciello To: linux-acpi@vger.kernel.org Cc: Len Brown , "Rafael J . Wysocki" , Andy Lutomirski , Mario Limonciello Subject: [PATCH] acpi/sleep: Use the FADT to prefer Suspend-to-Idle instead of S3 Date: Thu, 10 Nov 2016 15:35:18 -0600 Message-Id: <1478813718-12521-1-git-send-email-mario.limonciello@dell.com> X-Mailer: git-send-email 2.7.4 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 If the ACPI_FADT_LOW_POWER_S0 bit is set, this indicates the platform should get identical or better performance using Suspend-To-Idle. By removing S3 and S1 userspace will prefer suspend-to-idle in these situations too. Signed-off-by: Mario Limonciello --- drivers/acpi/sleep.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index deb0ff7..ff1d8f1 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -171,6 +171,12 @@ static int __init init_nvs_nosave(const struct dmi_system_id *d) return 0; } +static bool suspend_to_idle_preferred(void) +{ + return (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0); +} + + static struct dmi_system_id acpisleep_dmi_table[] __initdata = { { .callback = init_old_suspend_ordering, @@ -908,6 +914,11 @@ int __init acpi_sleep_init(void) acpi_no_s5 = true; } + if (suspend_to_idle_preferred()) { + sleep_states[ACPI_STATE_S3] = 0; + sleep_states[ACPI_STATE_S1] = 0; + } + supported[0] = 0; for (i = 0; i < ACPI_S_STATE_COUNT; i++) { if (sleep_states[i])