From patchwork Tue Aug 23 17:06:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 1089012 Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7NHDM41008394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 23 Aug 2011 17:13:42 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 p7NH6CNE006115; Tue, 23 Aug 2011 10:06:13 -0700 Received: from na3sys009aog124.obsmtp.com (na3sys009aog124.obsmtp.com [74.125.149.151]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with SMTP id p7NH68ns006093 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 23 Aug 2011 10:06:10 -0700 Received: from mail-gw0-f54.google.com ([74.125.83.54]) (using TLSv1) by na3sys009aob124.postini.com ([74.125.148.12]) with SMTP ID DSNKTlPeAP9qS3RIQ6V46KHl27AIND/XDAkA@postini.com; Tue, 23 Aug 2011 10:06:10 PDT Received: by mail-gw0-f54.google.com with SMTP id 15so295358gwb.13 for ; Tue, 23 Aug 2011 10:06:08 -0700 (PDT) Received: by 10.151.110.19 with SMTP id n19mr922650ybm.80.1314119168460; Tue, 23 Aug 2011 10:06:08 -0700 (PDT) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net [24.19.7.36]) by mx.google.com with ESMTPS id 16sm114211ybm.3.2011.08.23.10.06.06 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Aug 2011 10:06:07 -0700 (PDT) From: Kevin Hilman To: Santosh Organization: Texas Instruments, Inc. References: <4E53B6FC.8030507@ti.com> Date: Tue, 23 Aug 2011 10:06:05 -0700 In-Reply-To: <4E53B6FC.8030507@ti.com> (Santosh's message of "Tue, 23 Aug 2011 19:49:40 +0530") Message-ID: <871uwcjbwi.fsf@ti.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Received-SPF: pass (localhost is always allowed.) X-Spam-Status: No, hits=-104.262 required=5 tests=AWL, BAYES_00, OSDL_HEADER_SPF_PASS, OSDL_HEADER_SUBJECT_BRACKETED, USER_IN_WHITELIST 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: 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 (demeter2.kernel.org [140.211.167.43]); Tue, 23 Aug 2011 17:13:42 +0000 (UTC) Hi Santosh, Santosh writes: > 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. Correct. > Who is suppose to call the driver suspend callback? If populated, the PM domain callbacks should call the driver callbacks. If there are no PM domain callbacks, then the subsystem (in this case, the platform_bus) should be calling the driver callbacks. > 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. Yup, there's a bug. They're not missing, just misplaced. ;) When adding the noirq callbacks to ensure devices are idled late in suspend by omap_device, I the patch commited mistakenly uses SET_SYSTEM_SLEEP_PM_OPS(), which sets the "normal" suspend/resume handlers and not the noirq handlers. Can you try the patch below? I only briefly tested it on omap3/n900 so far. This populates most of the PM domain methods with the same ones used by the subystem (platform_bus) and only overrides the noirq methods with custom versions. This patch should make all the driver's suspend/resume methods be called as expected. After a bit more sanitiy testing, I'll post a real patch for the -rc series. Kevin diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index d8f2299..7a0d248 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -626,7 +626,8 @@ static struct dev_pm_domain omap_device_pm_domain = { SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume, _od_runtime_idle) USE_PLATFORM_PM_SLEEP_OPS - SET_SYSTEM_SLEEP_PM_OPS(_od_suspend_noirq, _od_resume_noirq) + .suspend_noirq = _od_suspend_noirq, + .resume_noirq = _od_resume_noirq, } };