From patchwork Tue Sep 4 07:17:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Zhang, Rui" X-Patchwork-Id: 10586897 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-2.web.codeaurora.org (Postfix) with ESMTP id 0674816B1 for ; Tue, 4 Sep 2018 07:17:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E09E928E98 for ; Tue, 4 Sep 2018 07:17:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4BF228EA9; Tue, 4 Sep 2018 07:17:50 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 6049228E98 for ; Tue, 4 Sep 2018 07:17:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726029AbeIDLlh (ORCPT ); Tue, 4 Sep 2018 07:41:37 -0400 Received: from mga01.intel.com ([192.55.52.88]:26456 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726015AbeIDLlh (ORCPT ); Tue, 4 Sep 2018 07:41:37 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2018 00:17:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,328,1531810800"; d="scan'208";a="85812256" Received: from xhao3-mobl.ccr.corp.intel.com ([10.249.171.25]) by fmsmga004.fm.intel.com with ESMTP; 04 Sep 2018 00:17:47 -0700 Message-ID: <1536045465.2282.21.camel@intel.com> Subject: [PATCH] ACPI / LPSS: Force lpss quirks on boot From: Zhang Rui To: William Lieurance Cc: "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 04 Sep 2018 15:17:45 +0800 In-Reply-To: <1535942331.2072.5.camel@intel.com> References: <20180901175916.28567-1-william.lieurance@namikoda.com> <1535942331.2072.5.camel@intel.com> X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 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 一, 2018-09-03 at 10:38 +0800, Zhang Rui wrote: > Hi, William, > > On 六, 2018-09-01 at 12:59 -0500, William Lieurance wrote: > > > > For some number of systems with lpss_quirks enabled, on boot the > > system > > goes through an acpi_lpss_resume() without a corresponding > > acpi_lpss_suspend() having been called. > I read the code but didn't find out why this could happen, but if it > is > true, please check if the below patch helps > > From 27fda1ab0d800966b0ec1c444fe356812bd2f04e Mon Sep 17 00:00:00 > 2001 > From: Zhang Rui > Date: Mon, 3 Sep 2018 10:00:07 +0800 > Subject: [PATCH] ACPI / LPSS: Force lpss quirks on boot > > Commit 12864ff8545f ("ACPI / LPSS: Avoid PM quirks on suspend and > resume > from hibernation") bypasses lpss quirks for S3 and S4, by setting a > flag > for S3/S4 in acpi_lpss_suspend(), and check that flag in > acpi_lpss_resume(). > > But this overlooks the boot case where acpi_lpss_resume() may get > called > without a corresponding acpi_lpss_suspend() having been called. > > Thus force setting the flag during boot. > > Fixes: 12864ff8545f (ACPI / LPSS: Avoid PM quirks on suspend and > resume from hibernation) > Link: https://bugzilla.kernel.org/show_bug.cgi?id=200989 > Signed-off-by: Zhang Rui According to https://bugzilla.kernel.org/show_bug.cgi?id=200989#c6, the patch has been confirmed to fix the problem. Don't know why the patch does not show up in patchwork. Let me resend. From f07303f10e41c2b61d0d4da5f74e98a3bf8e7147 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Mon, 3 Sep 2018 10:00:07 +0800 Subject: [PATCH] ACPI / LPSS: Force lpss quirks on boot Commit 12864ff8545f ("ACPI / LPSS: Avoid PM quirks on suspend and resume from hibernation") bypasses lpss quirks for S3 and S4, by setting a flag for S3/S4 in acpi_lpss_suspend(), and check that flag in acpi_lpss_resume(). But this overlooks the boot case where acpi_lpss_resume() may get called without a corresponding acpi_lpss_suspend() having been called. Thus force setting the flag during boot. Fixes: 12864ff8545f (ACPI / LPSS: Avoid PM quirks on suspend and resume from hibernation) Link: https://bugzilla.kernel.org/show_bug.cgi?id=200989 Reported-and-tested-by: William Lieurance Signed-off-by: Zhang Rui ---  drivers/acpi/acpi_lpss.c | 2 +-  1 file changed, 1 insertion(+), 1 deletion(-) --  2.7.4 diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index 9706613..bf64cfa 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c @@ -879,7 +879,7 @@ static void acpi_lpss_dismiss(struct device *dev)  #define LPSS_GPIODEF0_DMA_LLP BIT(13)    static DEFINE_MUTEX(lpss_iosf_mutex); -static bool lpss_iosf_d3_entered; +static bool lpss_iosf_d3_entered = true;    static void lpss_iosf_enter_d3_state(void)  {