From patchwork Tue Sep 5 21:00:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Stezenbach X-Patchwork-Id: 9939605 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 B117B604D3 for ; Tue, 5 Sep 2017 21:00:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96D1228A0C for ; Tue, 5 Sep 2017 21:00:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AEA128A15; Tue, 5 Sep 2017 21:00:57 +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 C23E128A0C for ; Tue, 5 Sep 2017 21:00:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752192AbdIEVAz (ORCPT ); Tue, 5 Sep 2017 17:00:55 -0400 Received: from mail.sig21.net ([80.244.240.74]:60258 "EHLO mail.sig21.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752011AbdIEVAy (ORCPT ); Tue, 5 Sep 2017 17:00:54 -0400 Received: from p5ddc6bea.dip0.t-ipconnect.de ([93.220.107.234] helo=abc.local) by mail.sig21.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dpKxb-000653-DJ; Tue, 05 Sep 2017 23:00:44 +0200 Received: from js by abc.local with local (Exim 4.89) (envelope-from ) id 1dpKxW-00062M-MZ; Tue, 05 Sep 2017 23:00:34 +0200 Date: Tue, 5 Sep 2017 23:00:34 +0200 From: Johannes Stezenbach To: Mika Westerberg Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Linux PM , linux-i2c , Wolfram Sang , ACPI Devel Maling List , Kevin Hilman , Jarkko Nikula , Andy Shevchenko , Jisheng Zhang , John Stultz , Guodong Xu , Sumit Semwal , Haojian Zhuang , Ulf Hansson Subject: Re: [RFT][PATCH v2 2/2] PM / i2c: designware: Clean up system sleep handling without ACPI Message-ID: <20170905210034.57b4pqg3suz4m3bl@sig21.net> References: <3023226.l5IfJK6GIc@aspire.rjw.lan> <1524365.Uf1AH187pl@aspire.rjw.lan> <20170905150744.GA2477@lahna.fi.intel.com> <3495106.6fP2YzlEUn@aspire.rjw.lan> <20170905152458.GB2477@lahna.fi.intel.com> <20170905154147.GC2477@lahna.fi.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170905154147.GC2477@lahna.fi.intel.com> User-Agent: NeoMutt/20170609 (1.8.3) 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 Tue, Sep 05, 2017 at 06:41:47PM +0300, Mika Westerberg wrote: > On Tue, Sep 05, 2017 at 05:32:07PM +0200, Rafael J. Wysocki wrote: > > On Tue, Sep 5, 2017 at 5:24 PM, Mika Westerberg wrote: > > > diff --git a/drivers/mfd/intel-lpss.h b/drivers/mfd/intel-lpss.h > > > index 694116630ffa..c987f7fe6c74 100644 > > > --- a/drivers/mfd/intel-lpss.h > > > +++ b/drivers/mfd/intel-lpss.h > > > @@ -38,8 +38,8 @@ int intel_lpss_resume(struct device *dev); > > > #ifdef CONFIG_PM_SLEEP > > > #define INTEL_LPSS_SLEEP_PM_OPS \ > > > .prepare = intel_lpss_prepare, \ > > > - .suspend = intel_lpss_suspend, \ > > > - .resume = intel_lpss_resume, \ > > > + .suspend_late = intel_lpss_suspend, \ > > > + .resume_early = intel_lpss_resume, \ > > > .freeze = intel_lpss_suspend, \ > > > .thaw = intel_lpss_resume, \ > > > .poweroff = intel_lpss_suspend, \ > > > > Of course, freeze/thaw, poweroff/restore need to be moved to the > > late/early stages too. > > Right. I tested the patches on Asus E200HA with the above + freeze_late/thaw_early, works fine. Then, wrt Rafael's comment in earlier mail about ordering of i2c designware vs. other drivers calling it via ACPI OpRegion, I changed it to noirq: (probably it's off-topic here but I tested while at it) It causes errors in dmesg: [ 62.460369] PM: late suspend of devices complete after 35.484 msecs [ 62.492283] i2c_designware 808622C1:02: timeout in disabling adapter [ 62.519527] i2c_designware 808622C1:01: timeout in disabling adapter [ 62.546930] i2c_designware 808622C1:00: timeout in disabling adapter [ 62.565844] PM: noirq suspend of devices complete after 105.431 msecs [ 62.565853] PM: suspend-to-idle ... [ 65.590077] Suspended for 3.104 seconds [ 65.591669] i2c_designware 808622C1:00: Unknown Synopsys component type: 0xffffffff [ 65.591689] i2c_designware 808622C1:01: Unknown Synopsys component type: 0xffffffff [ 65.591704] i2c_designware 808622C1:02: Unknown Synopsys component type: 0xffffffff [ 65.612136] PM: noirq resume of devices complete after 21.451 msecs [ 65.615059] PM: resume from suspend-to-idle But at least keyboard attached to 808622C1:00 still worked, it is: [ 3.264799] input: PDEC3393:00 0B05:8585 as /devices/pci0000:00/808622C1:00/i2c-0/i2c-PDEC3393:00/0018:0B05:8585.0001 /input/input5 [ 3.266476] asus 0018:0B05:8585.0001: input,hidraw0: I2C HID v1.00 Keyboard [PDEC3393:00 0B05:8585] on i2c-PDEC3393:00 --- 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/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 335b2b236faa..6b1b3938c405 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -475,7 +475,7 @@ static int dw_i2c_plat_resume(struct device *dev) } static const struct dev_pm_ops dw_i2c_dev_pm_ops = { - SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume) + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume) SET_RUNTIME_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume, NULL) }; diff --git a/drivers/mfd/intel-lpss.h b/drivers/mfd/intel-lpss.h index 694116630ffa..7069d67160a0 100644 --- a/drivers/mfd/intel-lpss.h +++ b/drivers/mfd/intel-lpss.h @@ -38,10 +38,10 @@ int intel_lpss_resume(struct device *dev); #ifdef CONFIG_PM_SLEEP #define INTEL_LPSS_SLEEP_PM_OPS \ .prepare = intel_lpss_prepare, \ - .suspend = intel_lpss_suspend, \ - .resume = intel_lpss_resume, \ - .freeze = intel_lpss_suspend, \ - .thaw = intel_lpss_resume, \ + .suspend_noirq = intel_lpss_suspend, \ + .resume_noirq = intel_lpss_resume, \ + .freeze_noirq = intel_lpss_suspend, \ + .thaw_noirq = intel_lpss_resume, \ .poweroff = intel_lpss_suspend, \ .restore = intel_lpss_resume, #else