Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752123AbdFTNEN (ORCPT ); Tue, 20 Jun 2017 09:04:13 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:14228 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752026AbdFTNEK (ORCPT ); Tue, 20 Jun 2017 09:04:10 -0400 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Tue, 20 Jun 2017 06:04:08 -0700 Subject: Re: [PATCH] PM / Domains: Call driver's noirq callbacks To: Ulf Hansson References: <1497960327-22832-1-git-send-email-mperttunen@nvidia.com> CC: "Rafael J. Wysocki" , Kevin Hilman , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" From: Mikko Perttunen Message-ID: Date: Tue, 20 Jun 2017 16:04:03 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.21.26.175] X-ClientProxiedBy: UKMAIL102.nvidia.com (10.26.138.15) To UKMAIL101.nvidia.com (10.26.138.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1899 Lines: 63 On 20.06.2017 15:47, Ulf Hansson wrote: > On 20 June 2017 at 14:05, Mikko Perttunen wrote: >> Currently genpd installs its own suspend_noirq and resume_noirq >> callbacks, but never calls down to the driver's corresponding >> callbacks. Add these calls. >> >> Signed-off-by: Mikko Perttunen >> --- >> >> drivers/base/power/domain.c | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c >> index d3f1d96f75e9..c3b6e6018c02 100644 >> --- a/drivers/base/power/domain.c >> +++ b/drivers/base/power/domain.c >> @@ -925,6 +925,10 @@ static int pm_genpd_suspend_noirq(struct device *dev) >> return ret; >> } >> >> + ret = pm_generic_suspend_noirq(dev); >> + if (ret) >> + return ret; > > Two things: > 1) I would move this a couple of lines further above, as to avoid > pm_runtime_force_suspend() from being called before, as it may suspend > the device before the noirq callbacks gets to run. Sure. > 2) pm_genpd_suspend_noirq() is also assigned to the ->poweroff_noirq() > callback. Certainly we don't want run the *suspend* variants of the > callback, but rather the *poweroff* variants in that case. Ah, didn't notice this. Will fix. Thanks for the comments, I'll post a v2. Mikko > >> + >> genpd_lock(genpd); >> genpd->suspended_count++; >> genpd_sync_power_off(genpd, true, 0); >> @@ -958,6 +962,10 @@ static int pm_genpd_resume_noirq(struct device *dev) >> genpd->suspended_count--; >> genpd_unlock(genpd); >> >> + ret = pm_generic_resume_noirq(dev); >> + if (ret) >> + return ret; >> + >> if (genpd->dev_ops.stop && genpd->dev_ops.start) >> ret = pm_runtime_force_resume(dev); >> >> -- >> 2.1.4 >> > > Kind regards > Uffe >