From patchwork Mon Jun 11 21:52:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 10458901 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 0489F601A0 for ; Mon, 11 Jun 2018 21:52:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3EDD2846F for ; Mon, 11 Jun 2018 21:52:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D601C285E5; Mon, 11 Jun 2018 21:52:37 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_TVD_MIME_EPI 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 696A32846F for ; Mon, 11 Jun 2018 21:52:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932492AbeFKVwg (ORCPT ); Mon, 11 Jun 2018 17:52:36 -0400 Received: from mail-ot0-f194.google.com ([74.125.82.194]:33750 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932230AbeFKVwf (ORCPT ); Mon, 11 Jun 2018 17:52:35 -0400 Received: by mail-ot0-f194.google.com with SMTP id h6-v6so25663056otj.0; Mon, 11 Jun 2018 14:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=XyPbqVuScJglDySmIXdE7l9rpzjOQMA1Ui06yBBJp8Y=; b=C44984j9TqINqq4dDvzjX43HUGD1IxfjgS+MvZTrZF9McS6o8OIJ93cE9+GJut7Xm/ RKTIvVg9lb8KpQQ5kdJysDYkOuznATrKfrWYuzntIDpSxCF6TXuNMyUNAnqFFMH9kZdi OtkuR76Lvx47N7oqN11eArsXDPFw4uHhkTYqiRhgNtuqPf+0y45xUfZBHSjmxgr2WSCB /s/jZQlIT+eczTy1r4SrylBeksNuLwgZRp0ofyZn1M4XgNJtLx2/asJGDhnkt5Q/x572 cA4i052M1jzPlSA+U1TEGvsBep2EKLv2bDmgL1b8mTE3XTAwmlw+fMRo/l5aRPUtKIL/ CKDg== 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:in-reply-to:references:from :date:message-id:subject:to:cc; bh=XyPbqVuScJglDySmIXdE7l9rpzjOQMA1Ui06yBBJp8Y=; b=oPlnbGYo+cHsWnAdtnV4YfaaXGYglyLzws7uMCB975ueSgXBGQMZUKGIU2AXBXyWwO bc66m32tu4NwZ5GI4+75kq7zco1hbfuFZ9G2JhNQyVrgHups4hoyB0bPOWHSSdkAqO3D DO5dOg6F3nf4Rf+JYlSBCIBoVQcvT2FdoTIqBbe/QS9wklM0INbCdWhSg3eeEgb2WnJ9 VH36NrYAC4A7KZSHqVkoIjcvzmnM1FK3KbskHMqRgC5+FSL4obJLOwX7frAzF5JJupOw ztLh4QFQ07C57sf2hZWJuH8Xr2G4PbGdSyxt4n99LMnUHIgoaDNS6vN6FYRTcrETeZyL 3kAw== X-Gm-Message-State: APt69E2zq4pRH1YsQvGR5YruNTADrF8+28vf1ju7yWCIcYmfnOtuLCEf u+j7M4rS1D5d6VDJk4KoVhMwc1k1iyHCvN/G4pQ= X-Google-Smtp-Source: ADUXVKLEBehAH5W7FQve3RnP8RBcPUk+u4gX2B3+R4WY1JTq6IMQ0SXGvKG+UQOGkvkGLL/GR4vpOg7tsKj0H34I2pg= X-Received: by 2002:a9d:cc7:: with SMTP id o7-v6mr604181otd.291.1528753955017; Mon, 11 Jun 2018 14:52:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1429:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 14:52:34 -0700 (PDT) In-Reply-To: References: From: "Rafael J. Wysocki" Date: Mon, 11 Jun 2018 23:52:34 +0200 X-Google-Sender-Auth: UqG1_o5hdI4Q6-lQbVvexS3KHM4 Message-ID: Subject: Re: Possible regression caused by commit a192aa923b66a To: Kai-Heng Feng Cc: "Rafael J. Wysocki" , Ulf Hansson , P HeLiOn , ACPI Devel Maling List , Linux Kernel Mailing List 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 Mon, Jun 11, 2018 at 10:09 AM, Rafael J. Wysocki wrote: > On Mon, Jun 11, 2018 at 8:26 AM, Kai-Heng Feng > wrote: >> Hi Rafael, >> >> There's a regression report [1] that says commit a192aa923b66a ("ACPI / >> LPSS: Consolidate runtime PM and system sleep handling") is the first bad >> commit. >> >> From the looks of it, it didn't introduce any behavioral change. So your >> help is appreciated. >> >> [1] https://bugs.launchpad.net/bugs/1774950 > > Well, the only difference is the iosf quirk AFAICS, but that should be > easy enough to check. I'll try to cut a patch for that later today. If the iosf quirk is the source of the problem, the attached patch should help. --- drivers/acpi/acpi_lpss.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) Index: linux-pm/drivers/acpi/acpi_lpss.c =================================================================== --- linux-pm.orig/drivers/acpi/acpi_lpss.c +++ linux-pm/drivers/acpi/acpi_lpss.c @@ -940,9 +940,10 @@ static void lpss_iosf_exit_d3_state(void mutex_unlock(&lpss_iosf_mutex); } -static int acpi_lpss_suspend(struct device *dev, bool wakeup) +static int acpi_lpss_suspend(struct device *dev, bool runtime) { struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); + bool wakeup = runtime || device_may_wakeup(dev); int ret; if (pdata->dev_desc->flags & LPSS_SAVE_CTX) @@ -955,13 +956,14 @@ static int acpi_lpss_suspend(struct devi * wrong status for devices being about to be powered off. See * lpss_iosf_enter_d3_state() for further information. */ - if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) + if (runtime && lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && + iosf_mbi_available()) lpss_iosf_enter_d3_state(); return ret; } -static int acpi_lpss_resume(struct device *dev) +static int acpi_lpss_resume(struct device *dev, bool runtime) { struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); int ret; @@ -970,7 +972,8 @@ static int acpi_lpss_resume(struct devic * This call is kept first to be in symmetry with * acpi_lpss_runtime_suspend() one. */ - if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available()) + if (runtime && lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && + iosf_mbi_available()) lpss_iosf_exit_d3_state(); ret = acpi_dev_resume(dev); @@ -994,12 +997,12 @@ static int acpi_lpss_suspend_late(struct return 0; ret = pm_generic_suspend_late(dev); - return ret ? ret : acpi_lpss_suspend(dev, device_may_wakeup(dev)); + return ret ? ret : acpi_lpss_suspend(dev, false); } static int acpi_lpss_resume_early(struct device *dev) { - int ret = acpi_lpss_resume(dev); + int ret = acpi_lpss_resume(dev, false); return ret ? ret : pm_generic_resume_early(dev); } @@ -1014,7 +1017,7 @@ static int acpi_lpss_runtime_suspend(str static int acpi_lpss_runtime_resume(struct device *dev) { - int ret = acpi_lpss_resume(dev); + int ret = acpi_lpss_resume(dev, true); return ret ? ret : pm_generic_runtime_resume(dev); }