All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: "Grygorii.Strashko@linaro.org" <grygorii.strashko@linaro.org>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	nm@ti.com, sumit.semwal@linaro.org, linux-omap@vger.kernel.org,
	kishon@ti.com, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH] omapdss: extend pm notifier to handle hibernation
Date: Fri, 20 Mar 2015 15:21:15 +0000	[thread overview]
Message-ID: <550C3AEB.1090802@ti.com> (raw)
In-Reply-To: <550C3545.8060702@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 2504 bytes --]

On 20/03/15 16:57, Grygorii.Strashko@linaro.org wrote:
> Hi Tomi,
> 
> On 03/20/2015 02:20 PM, Tomi Valkeinen wrote:
>> On 25/02/15 19:03, grygorii.strashko@linaro.org wrote:
>>> From: Grygorii Strashko <Grygorii.Strashko@linaro.org>
>>>
>>> Add handling of missed events in omap_dss_pm_notif which are
>>> needed to support hibernation (suspend to disk).
>>>
>>> Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org>
>>> ---
>>>   drivers/video/fbdev/omap2/dss/core.c | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git a/drivers/video/fbdev/omap2/dss/core.c b/drivers/video/fbdev/omap2/dss/core.c
>>> index 6b74f73..e60976a 100644
>>> --- a/drivers/video/fbdev/omap2/dss/core.c
>>> +++ b/drivers/video/fbdev/omap2/dss/core.c
>>> @@ -178,11 +178,15 @@ static int omap_dss_pm_notif(struct notifier_block *b, unsigned long v, void *d)
>>>   	DSSDBG("pm notif %lu\n", v);
>>>   
>>>   	switch (v) {
>>> +	case PM_HIBERNATION_PREPARE:
>>>   	case PM_SUSPEND_PREPARE:
>>> +	case PM_RESTORE_PREPARE:
>>>   		DSSDBG("suspending displays\n");
>>>   		return dss_suspend_all_devices();
>>>   
>>>   	case PM_POST_SUSPEND:
>>> +	case PM_POST_HIBERNATION:
>>> +	case PM_POST_RESTORE:
>>>   		DSSDBG("resuming displays\n");
>>>   		return dss_resume_all_devices();
>>>   
>>
>> Why suspend displays when PM_RESTORE_PREPARE happens? Why resume when
>> PM_POST_RESTORE happens?
> 
> We have following sequence when system is restored from hibernation:
> - original kernel booted;
> - late_initcall_sync(software_resume);
>   - pm_notifier_call_chain(PM_RESTORE_PREPARE);
>   - freeze_processes
>   - check & read hibernation image
>   - suspend all devices (.freeze())
>   - jump to stored kernel
>   - restore devices
>   ...
> 
> So, all devices should be in frozen/suspended state when we will jump to stored kernel
> (device's state should be the same as before creating hib image).
> 
> Without this patch I can see a lot of log messages like below:

Yes, I am sure a fix is needed for hibernation. But I still don't quite
understand PM_RESTORE_PREPARE and PM_POST_RESTORE.

When we enter hibernation, there's only PM_HIBERNATION_PREPARE?

When waking from hibernation, there's first PM_RESTORE_PREPARE, where we
need to disable displays that were enabled during boot. Then either
PM_POST_HIBERNATION if all went well, or PM_POST_RESTORE if there was an
error, and in both cases we want to enable the displays?

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: "Grygorii.Strashko@linaro.org" <grygorii.strashko@linaro.org>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	nm@ti.com, sumit.semwal@linaro.org, linux-omap@vger.kernel.org,
	kishon@ti.com, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH] omapdss: extend pm notifier to handle hibernation
Date: Fri, 20 Mar 2015 17:21:15 +0200	[thread overview]
Message-ID: <550C3AEB.1090802@ti.com> (raw)
In-Reply-To: <550C3545.8060702@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 2504 bytes --]

On 20/03/15 16:57, Grygorii.Strashko@linaro.org wrote:
> Hi Tomi,
> 
> On 03/20/2015 02:20 PM, Tomi Valkeinen wrote:
>> On 25/02/15 19:03, grygorii.strashko@linaro.org wrote:
>>> From: Grygorii Strashko <Grygorii.Strashko@linaro.org>
>>>
>>> Add handling of missed events in omap_dss_pm_notif which are
>>> needed to support hibernation (suspend to disk).
>>>
>>> Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org>
>>> ---
>>>   drivers/video/fbdev/omap2/dss/core.c | 4 ++++
>>>   1 file changed, 4 insertions(+)
>>>
>>> diff --git a/drivers/video/fbdev/omap2/dss/core.c b/drivers/video/fbdev/omap2/dss/core.c
>>> index 6b74f73..e60976a 100644
>>> --- a/drivers/video/fbdev/omap2/dss/core.c
>>> +++ b/drivers/video/fbdev/omap2/dss/core.c
>>> @@ -178,11 +178,15 @@ static int omap_dss_pm_notif(struct notifier_block *b, unsigned long v, void *d)
>>>   	DSSDBG("pm notif %lu\n", v);
>>>   
>>>   	switch (v) {
>>> +	case PM_HIBERNATION_PREPARE:
>>>   	case PM_SUSPEND_PREPARE:
>>> +	case PM_RESTORE_PREPARE:
>>>   		DSSDBG("suspending displays\n");
>>>   		return dss_suspend_all_devices();
>>>   
>>>   	case PM_POST_SUSPEND:
>>> +	case PM_POST_HIBERNATION:
>>> +	case PM_POST_RESTORE:
>>>   		DSSDBG("resuming displays\n");
>>>   		return dss_resume_all_devices();
>>>   
>>
>> Why suspend displays when PM_RESTORE_PREPARE happens? Why resume when
>> PM_POST_RESTORE happens?
> 
> We have following sequence when system is restored from hibernation:
> - original kernel booted;
> - late_initcall_sync(software_resume);
>   - pm_notifier_call_chain(PM_RESTORE_PREPARE);
>   - freeze_processes
>   - check & read hibernation image
>   - suspend all devices (.freeze())
>   - jump to stored kernel
>   - restore devices
>   ...
> 
> So, all devices should be in frozen/suspended state when we will jump to stored kernel
> (device's state should be the same as before creating hib image).
> 
> Without this patch I can see a lot of log messages like below:

Yes, I am sure a fix is needed for hibernation. But I still don't quite
understand PM_RESTORE_PREPARE and PM_POST_RESTORE.

When we enter hibernation, there's only PM_HIBERNATION_PREPARE?

When waking from hibernation, there's first PM_RESTORE_PREPARE, where we
need to disable displays that were enabled during boot. Then either
PM_POST_HIBERNATION if all went well, or PM_POST_RESTORE if there was an
error, and in both cases we want to enable the displays?

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-03-20 15:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25 17:03 [PATCH] omapdss: extend pm notifier to handle hibernation grygorii.strashko
2015-02-25 17:03 ` grygorii.strashko
2015-03-20 12:20 ` Tomi Valkeinen
2015-03-20 12:20   ` Tomi Valkeinen
2015-03-20 14:57   ` Grygorii.Strashko@linaro.org
2015-03-20 14:57     ` Grygorii.Strashko@linaro.org
2015-03-20 15:21     ` Tomi Valkeinen [this message]
2015-03-20 15:21       ` Tomi Valkeinen
2015-03-20 17:19       ` Grygorii.Strashko@linaro.org
2015-03-20 17:19         ` Grygorii.Strashko@linaro.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=550C3AEB.1090802@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=grygorii.strashko@linaro.org \
    --cc=kishon@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=sumit.semwal@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.