From patchwork Mon Jan 16 02:55:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Rui" X-Patchwork-Id: 9517999 X-Patchwork-Delegate: rjw@sisk.pl 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 71BEB601B7 for ; Mon, 16 Jan 2017 02:55:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 215842839B for ; Mon, 16 Jan 2017 02:55:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 158E3284C9; Mon, 16 Jan 2017 02:55:55 +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 7A47A2839B for ; Mon, 16 Jan 2017 02:55:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751621AbdAPCzx (ORCPT ); Sun, 15 Jan 2017 21:55:53 -0500 Received: from mga05.intel.com ([192.55.52.43]:61485 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751603AbdAPCzx (ORCPT ); Sun, 15 Jan 2017 21:55:53 -0500 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP; 15 Jan 2017 18:55:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,237,1477983600"; d="scan'208";a="922924151" Received: from hjiang6-mobl3.ccr.corp.intel.com (HELO rzhang1-surface.ccr.corp.intel.com) ([10.255.24.189]) by orsmga003.jf.intel.com with ESMTP; 15 Jan 2017 18:55:46 -0800 From: Zhang Rui To: rjw@rjwysocki.net Cc: linux-acpi@vger.kernel.org, Zhang Rui Subject: [PATCH] ACPI: save NVS memory for Lenovo G50-45 Date: Mon, 16 Jan 2017 10:55:45 +0800 Message-Id: <1484535345-5126-1-git-send-email-rui.zhang@intel.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 In commit 821d6f0359b0 ("ACPI / sleep: Do not save NVS for new machines to accelerate S3"), to optimize S3 suspend/resume speed, code is introduced to ignore NVS memory saving during S3 for all the platforms later than 2012. But, Lenovo G50-45, a platform released in 2015, still needs NVS memory saving during S3. A quirk is introduced for this platform. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189431 Tested-by: Przemek Signed-off-by: Zhang Rui --- drivers/acpi/sleep.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 9b6cebe227a0..0804e63863b6 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -130,6 +130,17 @@ void __init acpi_nvs_nosave_s3(void) nvs_nosave_s3 = true; } +void __init acpi_nvs_save_s3(void) +{ + nvs_nosave_s3 = false; +} + +static int __init init_nvs_save_s3(const struct dmi_system_id *d) +{ + acpi_nvs_save_s3(); + return 0; +} + /* * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the * user to request that behavior by using the 'acpi_old_suspend_ordering' @@ -324,6 +335,19 @@ static struct dmi_system_id acpisleep_dmi_table[] __initdata = { DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"), }, }, + /* + * https://bugzilla.kernel.org/show_bug.cgi?id=189431 + * Lenovo G50-45 is a platform later than 2012, but needs nvs memory + * saving during S3. + */ + { + .callback = init_nvs_save_s3, + .ident = "Lenovo G50-45", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_NAME, "80E3"), + }, + }, {}, };