From: Rickard Andersson <rickard.andersson@stericsson.com>
To: Linus Walleij <linus.walleij@linaro.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
"hongbo.zhang@linaro.org" <hongbo.zhang@linaro.org>,
"khilman@linaro.org" <khilman@linaro.org>,
"ulf.hansson@linaro.org" <ulf.hansson@linaro.org>,
Linus WALLEIJ <linus.walleij@stericsson.com>
Subject: Re: [PATCH V2 03/12] PM / Domains: Add on-off notifiers
Date: Tue, 30 Apr 2013 14:55:40 +0200 [thread overview]
Message-ID: <517FBF4C.6090806@stericsson.com> (raw)
In-Reply-To: <CACRpkdb+JrnrQgzZ5xdtFDubexNRm2WsrLXv+5zfjN1wdowaNg@mail.gmail.com>
On 04/29/2013 02:14 PM, Linus Walleij wrote:
> On Tue, Apr 23, 2013 at 2:26 PM, Rickard Andersson
> <rickard.andersson@stericsson.com> wrote:
>> On 03/31/2013 12:17 AM, Rafael J. Wysocki wrote:
>>> On Thursday, March 28, 2013 05:11:29 PM Rickard Andersson wrote:
>>>> I believe notifiers are the best solution to the problem of
>>>> restoring context early when waking up after sleep.
>>> I don't.
>> Some motivation would be good.
> (...)
>>> Well, quite frankly, it is hard to say what problem this is supposed to
>>> address from your description. Care to give some more details?
>> The problem is that some hardware blocks needs to be restored as early as
>> possible after leaving the U8500 CPU coupled sleep state ApSleep (APE power
>> domain being off).
> (APE = Application Processor Environment, on embedded)
>
> I just have this vague feeling that this is one of those embedded SoC
> vs desktop things where worlds collide.
>
> Isn't it so that on common x86 (desktop, server, laptop) the context of
> the system is saved by some BIOS/ACPI call, and then the ROM
> takes you back up with all devices put back into context?
>
> On embedded SoC's we don't have this, all states in the hardware
> has to be saved and restored with kernel code.
>
> Then there is a question about whether this shall be done centrally
> (there is one piece of code that knows all volatile registers of all
> hardware blocks in the system) which is close to what the desktop
> BIOS may do, or whether you want to do this in a distributed manner,
> so that each driver saves and restores the context of it's particular
> hardware.
>
The advantage with using the distributed approach is that all knowledge
of a certain hardware block can be handled in one place, the driver.
Having all knowledge in one place is a standard software design pattern.
Most drivers in the APE domain will be fine using runtime pm, but a few
needs their context (i.e. registers) to be restored directly when
leaving a sleep state where the APE power domain has been off. For
example the following hardware blocks: APE clocks, ICN (main
interconnect bus) and TPIU (Trace Port Interface Unit).
Using the TPIU block as an example: tracing with debugger (using TPIU
block) needs to be active (context restored) directly after sleep in
order to be able to record the execution also after waking up from
sleep. If the TPIU context is not restored after waking up from sleep
then the debuggers recording of the execution will also stop after
waking up from sleep which is not a good thing when looking for
difficult errors using a debugger.
Rafael: Can you please share your view?
Thanks in advance!
/Rickard
WARNING: multiple messages have this Message-ID (diff)
From: rickard.andersson@stericsson.com (Rickard Andersson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 03/12] PM / Domains: Add on-off notifiers
Date: Tue, 30 Apr 2013 14:55:40 +0200 [thread overview]
Message-ID: <517FBF4C.6090806@stericsson.com> (raw)
In-Reply-To: <CACRpkdb+JrnrQgzZ5xdtFDubexNRm2WsrLXv+5zfjN1wdowaNg@mail.gmail.com>
On 04/29/2013 02:14 PM, Linus Walleij wrote:
> On Tue, Apr 23, 2013 at 2:26 PM, Rickard Andersson
> <rickard.andersson@stericsson.com> wrote:
>> On 03/31/2013 12:17 AM, Rafael J. Wysocki wrote:
>>> On Thursday, March 28, 2013 05:11:29 PM Rickard Andersson wrote:
>>>> I believe notifiers are the best solution to the problem of
>>>> restoring context early when waking up after sleep.
>>> I don't.
>> Some motivation would be good.
> (...)
>>> Well, quite frankly, it is hard to say what problem this is supposed to
>>> address from your description. Care to give some more details?
>> The problem is that some hardware blocks needs to be restored as early as
>> possible after leaving the U8500 CPU coupled sleep state ApSleep (APE power
>> domain being off).
> (APE = Application Processor Environment, on embedded)
>
> I just have this vague feeling that this is one of those embedded SoC
> vs desktop things where worlds collide.
>
> Isn't it so that on common x86 (desktop, server, laptop) the context of
> the system is saved by some BIOS/ACPI call, and then the ROM
> takes you back up with all devices put back into context?
>
> On embedded SoC's we don't have this, all states in the hardware
> has to be saved and restored with kernel code.
>
> Then there is a question about whether this shall be done centrally
> (there is one piece of code that knows all volatile registers of all
> hardware blocks in the system) which is close to what the desktop
> BIOS may do, or whether you want to do this in a distributed manner,
> so that each driver saves and restores the context of it's particular
> hardware.
>
The advantage with using the distributed approach is that all knowledge
of a certain hardware block can be handled in one place, the driver.
Having all knowledge in one place is a standard software design pattern.
Most drivers in the APE domain will be fine using runtime pm, but a few
needs their context (i.e. registers) to be restored directly when
leaving a sleep state where the APE power domain has been off. For
example the following hardware blocks: APE clocks, ICN (main
interconnect bus) and TPIU (Trace Port Interface Unit).
Using the TPIU block as an example: tracing with debugger (using TPIU
block) needs to be active (context restored) directly after sleep in
order to be able to record the execution also after waking up from
sleep. If the TPIU context is not restored after waking up from sleep
then the debuggers recording of the execution will also stop after
waking up from sleep which is not a good thing when looking for
difficult errors using a debugger.
Rafael: Can you please share your view?
Thanks in advance!
/Rickard
next prev parent reply other threads:[~2013-04-30 12:56 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 16:11 [PATCH V2 00/12] ux500 suspend-resume Rickard Andersson
2013-03-28 16:11 ` Rickard Andersson
2013-03-28 16:11 ` [PATCH V2 01/12] mfd: db8500: Add IO force function Rickard Andersson
2013-03-28 16:11 ` Rickard Andersson
2013-03-28 16:11 ` [PATCH V2 02/12] ARM: ux500: Add platform suspend ops Rickard Andersson
2013-03-28 16:11 ` Rickard Andersson
2013-03-28 16:11 ` [PATCH V2 03/12] PM / Domains: Add on-off notifiers Rickard Andersson
2013-03-28 16:11 ` Rickard Andersson
2013-03-30 23:17 ` Rafael J. Wysocki
2013-03-30 23:17 ` Rafael J. Wysocki
2013-04-23 12:26 ` Rickard Andersson
2013-04-23 12:26 ` Rickard Andersson
2013-04-29 12:14 ` Linus Walleij
2013-04-29 12:14 ` Linus Walleij
2013-04-30 12:55 ` Rickard Andersson [this message]
2013-04-30 12:55 ` Rickard Andersson
2013-03-28 16:11 ` [PATCH V2 04/12] PM / Domains: Lookup domain by name Rickard Andersson
2013-03-28 16:11 ` Rickard Andersson
2013-03-28 16:11 ` [PATCH V2 05/12] ARM: ux500: Create APE generic power domain Rickard Andersson
2013-03-28 16:11 ` Rickard Andersson
2013-03-28 16:11 ` [PATCH V2 06/12] clk: ux500: Add PRCC power management Rickard Andersson
2013-03-28 16:11 ` Rickard Andersson
2013-03-28 16:11 ` [PATCH V2 07/12] ARM: ux500: Create u8500-clk device Rickard Andersson
2013-03-28 16:11 ` Rickard Andersson
2013-03-28 16:11 ` [PATCH V2 08/12] ARM: ux500: Add ApSleep state to suspend Rickard Andersson
2013-03-28 16:11 ` Rickard Andersson
2013-03-28 16:11 ` [PATCH V2 09/12] drivers: bus: ux500: Add ICN driver Rickard Andersson
2013-03-28 16:11 ` Rickard Andersson
2013-03-28 16:11 ` [PATCH V2 10/12] ARM: ux500: Create ICN device Rickard Andersson
2013-03-28 16:11 ` Rickard Andersson
2013-03-28 16:11 ` [PATCH V2 11/12] misc: ux500: Add TPIU driver Rickard Andersson
2013-03-28 16:11 ` Rickard Andersson
2013-03-28 16:11 ` [PATCH V2 12/12] ARM: ux500: Create TPIU device Rickard Andersson
2013-03-28 16:11 ` Rickard Andersson
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=517FBF4C.6090806@stericsson.com \
--to=rickard.andersson@stericsson.com \
--cc=daniel.lezcano@linaro.org \
--cc=hongbo.zhang@linaro.org \
--cc=khilman@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=ulf.hansson@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.