* PM/runtime issue: Device cannot runtime resume because power domain is off during system resume
@ 2014-10-16 14:05 Krzysztof Kozlowski
2014-10-29 13:01 ` Ulf Hansson
0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2014-10-16 14:05 UTC (permalink / raw)
To: Rafael J. Wysocki, Pavel Machek, Len Brown, linux-pm,
linux-kernel
Hi,
I encounter issues with DRM/panel driver for Exynos after resuming from
suspend to RAM. This is reproduced on 3.16 but I think it is applicable
also to mainline.
The scenario:
0. DRM DSI is in LCD power domain. Power domain is OFF before
suspending.
1. System suspends.
2. System resumes.
3. DRM driver:resume().
4. pm_runtime_get() for DRM DSI driver.
5. This should enable LCD power domain.
6. but __pm_genpd_poweron() exits early because:
genpd->prepared_count = 3
genpd->suspend_power_off = 1
in domain.c:183
7. The domain is not powered on but it is marked as active.
8. The DRM driver thinks everything is OK and proceeds with resume...
but it fails because whole power domain is OFF.
The question: Shouldn't the power domain be powered up EARLY?
Something like this:
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 40bc2f4072cc..4fdfe404a04c 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -179,8 +179,7 @@ static int __pm_genpd_poweron(struct
}
finish_wait(&genpd->status_wait_queue, &wait);
- if (genpd->status == GPD_STATE_ACTIVE
- || (genpd->prepared_count > 0 && genpd->suspend_power_off))
+ if (genpd->status == GPD_STATE_ACTIVE)
return 0;
if (genpd->status != GPD_STATE_POWER_OFF) {
If not... how to solve the scenario above?
Best regards,
Krzyszto
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: PM/runtime issue: Device cannot runtime resume because power domain is off during system resume
2014-10-16 14:05 PM/runtime issue: Device cannot runtime resume because power domain is off during system resume Krzysztof Kozlowski
@ 2014-10-29 13:01 ` Ulf Hansson
2014-10-29 15:44 ` Krzysztof Kozlowski
0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2014-10-29 13:01 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Rafael J. Wysocki, Pavel Machek, Len Brown,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
On 16 October 2014 16:05, Krzysztof Kozlowski <k.kozlowski@samsung.com> wrote:
> Hi,
>
> I encounter issues with DRM/panel driver for Exynos after resuming from
> suspend to RAM. This is reproduced on 3.16 but I think it is applicable
> also to mainline.
>
> The scenario:
> 0. DRM DSI is in LCD power domain. Power domain is OFF before
> suspending.
> 1. System suspends.
> 2. System resumes.
> 3. DRM driver:resume().
> 4. pm_runtime_get() for DRM DSI driver.
> 5. This should enable LCD power domain.
> 6. but __pm_genpd_poweron() exits early because:
> genpd->prepared_count = 3
I am getting to this soonish in my genpd work. Currently I am working
on the boot issues. :-)
At a first glance, I think the genpd->prepare_count variable shouldn't
exist at all, but I need to dig into this in more detail to be sure.
In principle I think genpd should rely _more_ on the PM core during
system PM transitions. For example the PM core invokes a
pm_runtime_get_noresume() (and for some reason genpd as well) at the
->prepare() phase. Shouldn't that be enough!?
> genpd->suspend_power_off = 1
> in domain.c:183
>
> 7. The domain is not powered on but it is marked as active.
> 8. The DRM driver thinks everything is OK and proceeds with resume...
> but it fails because whole power domain is OFF.
>
> The question: Shouldn't the power domain be powered up EARLY?
Good question, I would like us to strive towards these goals:
For CONFIG_PM_RUNTIME, I think the PM domain should be powered up at
the first time a runtime PM resume callbacks gets invoked.
For !CONFIG_PM_RUNTIME, I think we should restore the state the PM
domain had prior we went to system PM sleep.
Kind regards
Uffe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PM/runtime issue: Device cannot runtime resume because power domain is off during system resume
2014-10-29 13:01 ` Ulf Hansson
@ 2014-10-29 15:44 ` Krzysztof Kozlowski
0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2014-10-29 15:44 UTC (permalink / raw)
To: Ulf Hansson
Cc: Rafael J. Wysocki, Pavel Machek, Len Brown,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
On śro, 2014-10-29 at 14:01 +0100, Ulf Hansson wrote:
> On 16 October 2014 16:05, Krzysztof Kozlowski <k.kozlowski@samsung.com> wrote:
> > Hi,
> >
> > I encounter issues with DRM/panel driver for Exynos after resuming from
> > suspend to RAM. This is reproduced on 3.16 but I think it is applicable
> > also to mainline.
> >
> > The scenario:
> > 0. DRM DSI is in LCD power domain. Power domain is OFF before
> > suspending.
> > 1. System suspends.
> > 2. System resumes.
> > 3. DRM driver:resume().
> > 4. pm_runtime_get() for DRM DSI driver.
> > 5. This should enable LCD power domain.
> > 6. but __pm_genpd_poweron() exits early because:
> > genpd->prepared_count = 3
>
> I am getting to this soonish in my genpd work. Currently I am working
> on the boot issues. :-)
>
> At a first glance, I think the genpd->prepare_count variable shouldn't
> exist at all, but I need to dig into this in more detail to be sure.
>
> In principle I think genpd should rely _more_ on the PM core during
> system PM transitions. For example the PM core invokes a
> pm_runtime_get_noresume() (and for some reason genpd as well) at the
> ->prepare() phase. Shouldn't that be enough!?
>
> > genpd->suspend_power_off = 1
> > in domain.c:183
> >
> > 7. The domain is not powered on but it is marked as active.
> > 8. The DRM driver thinks everything is OK and proceeds with resume...
> > but it fails because whole power domain is OFF.
> >
> > The question: Shouldn't the power domain be powered up EARLY?
>
> Good question, I would like us to strive towards these goals:
>
> For CONFIG_PM_RUNTIME, I think the PM domain should be powered up at
> the first time a runtime PM resume callbacks gets invoked.
> For !CONFIG_PM_RUNTIME, I think we should restore the state the PM
> domain had prior we went to system PM sleep.
For the first case (PM_RUNTIME) I sent a proposal:
https://lkml.org/lkml/2014/10/23/308
which seems to work for my configuration. However I did not test it
without runtime PM...
The issues I found were:
1. Runtime resume during early system suspend (triggered by poking
console).
2. Runtime resume during system resume (triggered by "normal" resuming
device).
In both case the power domain was off so runtime resume failed.
I've got a simple testing scenario and setup for reproducing these so if
you need tests I can help.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-29 15:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-16 14:05 PM/runtime issue: Device cannot runtime resume because power domain is off during system resume Krzysztof Kozlowski
2014-10-29 13:01 ` Ulf Hansson
2014-10-29 15:44 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).