From patchwork Tue Aug 23 15:01:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Govindraj R X-Patchwork-Id: 1088812 Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7NF5OE9027706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 23 Aug 2011 15:05:45 GMT Received: from daredevil.linux-foundation.org (localhost [127.0.0.1]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p7NF38Gs026941; Tue, 23 Aug 2011 08:03:09 -0700 Received: from mail-fx0-f47.google.com (mail-fx0-f47.google.com [209.85.161.47]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id p7NF2GCd026845 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Tue, 23 Aug 2011 08:02:19 -0700 Received: by fxg11 with SMTP id 11so315470fxg.6 for ; Tue, 23 Aug 2011 08:02:16 -0700 (PDT) Received: by 10.204.5.81 with SMTP id 17mr1605588bku.225.1314111735970; Tue, 23 Aug 2011 08:02:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.55.75 with HTTP; Tue, 23 Aug 2011 08:01:52 -0700 (PDT) In-Reply-To: <4E53B6FC.8030507@ti.com> References: <4E53B6FC.8030507@ti.com> From: Govindraj Date: Tue, 23 Aug 2011 20:31:52 +0530 Message-ID: To: Santosh Received-SPF: pass (localhost is always allowed.) X-Spam-Status: No, hits=-4.184 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SPF_PASS, OSDL_HEADER_SUBJECT_BRACKETED X-Spam-Checker-Version: SpamAssassin 3.2.4-osdl_revision__1.47__ X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.21 Cc: "Basak, Partha" , Govindraj R , Linux PM mailing list , linux-omap@vger.kernel.org Subject: Re: [linux-pm] [POWER DOMAIN suspend callbacks] Observation. X-BeenThere: linux-pm@lists.linux-foundation.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux power management List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 23 Aug 2011 15:05:45 +0000 (UTC) On Tue, Aug 23, 2011 at 7:49 PM, Santosh wrote: > Rafael, Kevin, > > On latest kernel( V3.1-rc1+), the subsystem(driver) suspend > callbacks are not getting called because power domain callbcaks > are populated. > > And as per commit 4d27e9dc{PM: Make power domain callbacks take > precedence over subsystem ones}, it's expected bahavior. > > Who is suppose to call the driver suspend callback? > Some drivers/subsystem would have state machine which needs to > be suspended. > > Is the power domain suspend callback, suppose to take care of > it ? If yes, then that seems to be missing for OMAP. > Looks like from _od_suspend_noirq -> pm_generic_suspend_noirq -> __pm_generic_call(dev, PM_EVENT_SUSPEND, true); --> [..] case PM_EVENT_SUSPEND: callback = noirq ? pm->suspend_noirq : pm->suspend; shouldn't we call pm_generic_suspend from _od_suspend_noirq rather than calling pm_generic_suspend_noirq? Since _noirq seems to call .suspend_noirq hook which most of the them have not populated. pm_generic_suspend* calls may fail to call legacy platform .suspend hooks? Looks like we need below change for driver .suspend hook to be called. --- Thanks, Govindraj.R diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index b6b4097..c2a18ae 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -584,9 +584,9 @@ static int _od_suspend_noirq(struct device *dev) int ret; if (od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND) - return pm_generic_suspend_noirq(dev); + return pm_generic_suspend(dev); - ret = pm_generic_suspend_noirq(dev); + ret = pm_generic_suspend(dev); if (!ret && !pm_runtime_status_suspended(dev)) { if (pm_generic_runtime_suspend(dev) == 0) { @@ -604,7 +604,7 @@ static int _od_resume_noirq(struct device *dev) struct omap_device *od = to_omap_device(pdev); if (od->flags & OMAP_DEVICE_NO_IDLE_ON_SUSPEND) - return pm_generic_resume_noirq(dev); + return pm_generic_resume(dev); if ((od->flags & OMAP_DEVICE_SUSPENDED) && !pm_runtime_status_suspended(dev)) { @@ -613,7 +613,7 @@ static int _od_resume_noirq(struct device *dev) pm_generic_runtime_resume(dev); } - return pm_generic_resume_noirq(dev); + return pm_generic_resume(dev); } #endif