[v2,2/2] PM / Domains: Drop unnecessary wakeup code from pm_genpd_prepare()

Message ID 1461653238-3891-3-git-send-email-ulf.hansson@linaro.org
State Accepted
Commit 164a2159a2d6789bc7e3c4b126dde7f3ce865992
Headers show

Commit Message

Ulf Hansson April 26, 2016, 6:47 a.m.
As the PM core already have wakeup management during the system PM phase,
it seems reasonable that genpd and its users should be able to rely on
that. Therefore let's remove this from pm_genpd_prepare().

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

---

Changes in v2:
	None.

---
 drivers/base/power/domain.c | 6 ------
 1 file changed, 6 deletions(-)

-- 
1.9.1

Comments

Ulf Hansson April 26, 2016, 11:51 a.m. | #1
On 26 April 2016 at 09:31, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Ulf,

>

> Thank you for the patch.

>

> On Tuesday 26 Apr 2016 08:47:18 Ulf Hansson wrote:

>> As the PM core already have wakeup management during the system PM phase,

>> it seems reasonable that genpd and its users should be able to rely on

>> that. Therefore let's remove this from pm_genpd_prepare().

>

> It's probably because I'm not familiar enough with the PM implementation, but

> I haven't been able to locate the wakeup management code in the PM core.


It's done in __device_suspend() (drivers/base/power/main.c).

So it means it will be moved from the system PM prepare phase (as
currently in genpd) to the system PM suspend phase. I think this
should be okay for genpd users.

Kind regards
Uffe

>

>> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

>> ---

>>

>> Changes in v2:

>>       None.

>>

>> ---

>>  drivers/base/power/domain.c | 6 ------

>>  1 file changed, 6 deletions(-)

>>

>> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c

>> index 60a3573..de23b64 100644

>> --- a/drivers/base/power/domain.c

>> +++ b/drivers/base/power/domain.c

>> @@ -730,12 +730,6 @@ static int pm_genpd_prepare(struct device *dev)

>>        * at this point and a system wakeup event should be reported if it's

>>        * set up to wake up the system from sleep states.

>>        */

>> -     if (pm_runtime_barrier(dev) && device_may_wakeup(dev))

>> -             pm_wakeup_event(dev, 0);

>> -

>> -     if (pm_wakeup_pending())

>> -             return -EBUSY;

>> -

>>       if (resume_needed(dev, genpd))

>>               pm_runtime_resume(dev);

>

> --

> Regards,

>

> Laurent Pinchart

>

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 60a3573..de23b64 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -730,12 +730,6 @@  static int pm_genpd_prepare(struct device *dev)
 	 * at this point and a system wakeup event should be reported if it's
 	 * set up to wake up the system from sleep states.
 	 */
-	if (pm_runtime_barrier(dev) && device_may_wakeup(dev))
-		pm_wakeup_event(dev, 0);
-
-	if (pm_wakeup_pending())
-		return -EBUSY;
-
 	if (resume_needed(dev, genpd))
 		pm_runtime_resume(dev);