From patchwork Tue Sep 5 15:24:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 9939223 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 97D59604D4 for ; Tue, 5 Sep 2017 15:27:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89B2928989 for ; Tue, 5 Sep 2017 15:27:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E59D28994; Tue, 5 Sep 2017 15:27:17 +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=unavailable 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 376122898D for ; Tue, 5 Sep 2017 15:27:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751767AbdIEP1Q (ORCPT ); Tue, 5 Sep 2017 11:27:16 -0400 Received: from mga01.intel.com ([192.55.52.88]:48843 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751386AbdIEP1P (ORCPT ); Tue, 5 Sep 2017 11:27:15 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2017 08:27:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,480,1498546800"; d="scan'208";a="897280233" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by FMSMGA003.fm.intel.com with SMTP; 05 Sep 2017 08:27:09 -0700 Received: by lahna (sSMTP sendmail emulation); Tue, 05 Sep 2017 18:24:58 +0300 Date: Tue, 5 Sep 2017 18:24:58 +0300 From: Mika Westerberg To: "Rafael J. Wysocki" Cc: linux-pm@vger.kernel.org, linux-i2c@vger.kernel.org, Wolfram Sang , linux-acpi@vger.kernel.org, Kevin Hilman , Jarkko Nikula , Andy Shevchenko , Jisheng Zhang , John Stultz , Guodong Xu , Sumit Semwal , Haojian Zhuang , Johannes Stezenbach , Ulf Hansson Subject: Re: [RFT][PATCH v2 2/2] PM / i2c: designware: Clean up system sleep handling without ACPI Message-ID: <20170905152458.GB2477@lahna.fi.intel.com> References: <3023226.l5IfJK6GIc@aspire.rjw.lan> <1524365.Uf1AH187pl@aspire.rjw.lan> <20170905150744.GA2477@lahna.fi.intel.com> <3495106.6fP2YzlEUn@aspire.rjw.lan> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3495106.6fP2YzlEUn@aspire.rjw.lan> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Sep 05, 2017 at 05:04:21PM +0200, Rafael J. Wysocki wrote: > On Tuesday, September 5, 2017 5:07:44 PM CEST Mika Westerberg wrote: > > On Tue, Sep 05, 2017 at 04:55:44PM +0200, Rafael J. Wysocki wrote: > > > On Tuesday, September 5, 2017 4:58:35 PM CEST Mika Westerberg wrote: > > > > On Tue, Sep 05, 2017 at 04:46:11PM +0200, Rafael J. Wysocki wrote: > > > > > On Tuesday, September 5, 2017 4:45:11 PM CEST Mika Westerberg wrote: > > > > > > On Mon, Sep 04, 2017 at 12:01:54PM +0200, Rafael J. Wysocki wrote: > > > > > > > static const struct dev_pm_ops dw_i2c_dev_pm_ops = { > > > > > > > - .prepare = dw_i2c_plat_prepare, > > > > > > > - .complete = dw_i2c_plat_complete, > > > > > > > - SET_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume) > > > > > > > - SET_RUNTIME_PM_OPS(dw_i2c_plat_runtime_suspend, > > > > > > > - dw_i2c_plat_resume, > > > > > > > - NULL) > > > > > > > + SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume) > > > > > > > > > > > > This seems to cause problem with intel-lpss MFD driver because it uses > > > > > > .suspend() and .resume() instead of .suspend_late() and .resume_early(). > > > > > > > > > > OK, so there is one more dependency here. > > > > > > > > > > Can you please point me to this code? > > > > > > > > It is in drivers/mfd/intel-lpss.c. See intel_lpss_resume(). > > > > > > > > > > Looking at it, but I don't quite see how this is related to the > > > i2c-designware-platedv suspend/resume ... > > > > intel-lpss is the parent device for i2c-designware-platdrv. It is > > supposed to handle all LPSS specific stuff, like bringing the PCI device > > out of reset before the i2c-designware-platdrv does its own resume > > things. > > Yes, I see. > > OK, so what about moving its suspend/resume to the late/early stages? > > Would the parent of it be confused? It seems to work. I did following change and now suspend/resume works fine with your patch series. 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, \