linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: santosh.shilimkar@ti.com (Santosh Shilimkar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/17] ARM: gic: Use cpu pm notifiers to save gic state
Date: Thu, 07 Jul 2011 19:07:09 -0700	[thread overview]
Message-ID: <4E16664D.7010206@ti.com> (raw)
In-Reply-To: <CAMbhsRT-Z4AmYmen9B9+mJ+c5YWyVbcsx0mykrn7L_JxgOLVDg@mail.gmail.com>

On 7/7/2011 6:41 PM, Colin Cross wrote:
> On Thu, Jul 7, 2011 at 6:35 PM, Santosh Shilimkar
> <santosh.shilimkar@ti.com>  wrote:
>> On 7/7/2011 8:50 AM, Lorenzo Pieralisi wrote:
>>>
>>> From: Colin Cross<ccross@android.com>
>>>
>>> When the cpu is powered down in a low power mode, the gic cpu
>>> interface may be reset, and when the cpu complex is powered
>>> down, the gic distributor may also be reset.
>>>
>>> This patch uses CPU_PM_ENTER and CPU_PM_EXIT notifiers to save
>>> and restore the gic cpu interface registers, and the
>>> CPU_COMPLEX_PM_ENTER and CPU_COMPLEX_PM_EXIT notifiers to save
>>> and restore the gic distributor registers.
>>>
>>> Signed-off-by: Colin Cross<ccross@android.com>
>>> ---
>>>   arch/arm/common/gic.c |  212
>>> +++++++++++++++++++++++++++++++++++++++++++++++++
>>>   1 files changed, 212 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
>>> index 4ddd0a6..8d62e07 100644
>>> --- a/arch/arm/common/gic.c
>>> +++ b/arch/arm/common/gic.c
>>
>> [...]
>>
>>> +
>>> +static int gic_notifier(struct notifier_block *self, unsigned long cmd,
>>>       void *v)
>>> +{
>>> +       int i;
>>> +
>>> +       for (i = 0; i<    MAX_GIC_NR; i++) {
>>> +               switch (cmd) {
>>> +               case CPU_PM_ENTER:
>>> +                       gic_cpu_save(i);
>>> +                       break;
>>> +               case CPU_PM_ENTER_FAILED:
>>> +               case CPU_PM_EXIT:
>>> +                       gic_cpu_restore(i);
>>> +                       break;
>>> +               case CPU_COMPLEX_PM_ENTER:
>>> +                       gic_dist_save(i);
>>> +                       break;
>>> +               case CPU_COMPLEX_PM_ENTER_FAILED:
>>> +               case CPU_COMPLEX_PM_EXIT:
>>> +                       gic_dist_restore(i);
>>> +                       break;
>>> +               }
>>> +       }
>>> +
>>> +       return NOTIFY_OK;
>>> +}
>>
>> Just to put forth OMAP requirements for GIC and see how much
>> we can leverage these for OMAP.
>>
>> OMAP support GP(general) and HS(secure) devices and implements
>> the trustzone on these devices. on Secure devices the GIC save
>> and restore is completely done by secure ROM code. There are
>> API's for save and restore is automatic on CPU reset based
>> on the last CPU cluster state.
>>
>> On GP devices too, very few GIC registers needs to be saved
>> in a pre-defined memory/register layout and restore is again
>> done by boot-ROM code.
>>
>> OMAP need to enable/disable distributor and CPU interfaces
>> based on CPU power states and that is something can be useful.
>> Would be good if there is a provision to over-write the gic
>> save/restore function using function pointers so that OMAP
>> PM code can use the notifiers.
>>
>> Any more thoughts how we can handle this? We would like to
>> use common ARM code as much as possible.
>
> Is it strictly necessary to use the custom OMAP save and restore?
Yes. On secure devices there is no choice.

> Anything that was modified by the kernel is obviously writable, and
> could be saved and restored using the common code.  Anything that can
> only be modified by TrustZone already has to be restored by the custom
> OMAP code.  There aren't many registers in the GIC, so it shouldn't be
> much of a performance difference.
In that case we will end up doing things two time un-necessary and 
that's not useful at all. You need to save all those extra cycles
to have less latency on C-states. And otherside you can't skip the
secure API save otherwise the boot-ROM code will end up re-initializing
the GIC and all secure interrupt state will be lost.

 From above code, today we use need dist/cpu interface disable/enable
functions.

Regards
Santosh

Regards
Santosh

  reply	other threads:[~2011-07-08  2:07 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 15:50 [RFC PATCH 00/17] ARM: common idle infrastructure Lorenzo Pieralisi
2011-07-07 15:50 ` [PATCH 01/17] ARM: proc: add definition of cpu_reset for ARMv6 and ARMv7 cores Lorenzo Pieralisi
2011-07-08  1:12   ` Santosh Shilimkar
2011-07-08  8:22     ` Will Deacon
2011-07-09 10:14   ` Russell King - ARM Linux
2011-07-10 11:00     ` Will Deacon
2011-07-10 11:52       ` Russell King - ARM Linux
2011-07-10 13:21         ` Will Deacon
2011-07-07 15:50 ` [PATCH 02/17] ARM: Add cpu power management notifiers Lorenzo Pieralisi
2011-07-08  1:14   ` Santosh Shilimkar
2011-07-09 10:15   ` Russell King - ARM Linux
2011-07-09 21:32     ` Colin Cross
2011-07-07 15:50 ` [PATCH 03/17] ARM: gic: Use cpu pm notifiers to save gic state Lorenzo Pieralisi
2011-07-08  1:35   ` Santosh Shilimkar
2011-07-08  1:41     ` Colin Cross
2011-07-08  2:07       ` Santosh Shilimkar [this message]
2011-07-08  7:08         ` Kukjin Kim
2011-07-09 10:21   ` Russell King - ARM Linux
2011-07-09 22:10     ` Colin Cross
2011-07-09 22:33       ` Russell King - ARM Linux
2011-07-09 23:01         ` Colin Cross
2011-07-09 23:05           ` Russell King - ARM Linux
2011-07-09 23:24             ` Colin Cross
2011-07-10  0:10             ` Santosh Shilimkar
2011-07-21  8:32   ` Santosh Shilimkar
2011-07-21 10:27     ` Lorenzo Pieralisi
2011-07-21 10:46       ` Santosh Shilimkar
2011-07-21 19:06         ` Colin Cross
2011-07-22  5:10           ` Santosh Shilimkar
2011-07-22  5:21             ` Colin Cross
2011-08-17 16:15               ` Santosh
2011-07-07 15:50 ` [PATCH 04/17] ARM: vfp: Use cpu pm notifiers to save vfp state Lorenzo Pieralisi
2011-07-09 10:44   ` Russell King - ARM Linux
2011-07-09 14:32     ` Russell King - ARM Linux
2011-07-07 15:50 ` [RFC PATCH 05/17] ARM: kernel: save/restore kernel IF Lorenzo Pieralisi
2011-07-08  1:45   ` Santosh Shilimkar
2011-07-08  8:39     ` Lorenzo Pieralisi
2011-07-08 16:12   ` Frank Hofmann
2011-07-11 14:00     ` Lorenzo Pieralisi
2011-07-11 14:31       ` Frank Hofmann
2011-07-11 16:02         ` Lorenzo Pieralisi
2011-07-11 16:57           ` Frank Hofmann
2011-07-11 18:05             ` Lorenzo Pieralisi
2011-07-11 18:40       ` Russell King - ARM Linux
2011-07-11 18:51         ` Colin Cross
2011-07-11 19:19           ` Russell King - ARM Linux
2011-07-11 19:38             ` Colin Cross
2011-07-11 20:09             ` Santosh Shilimkar
2011-07-11 20:05         ` Santosh Shilimkar
2011-07-11 20:14           ` Russell King - ARM Linux
2011-07-11 21:31             ` Santosh Shilimkar
2011-07-12 10:12         ` Lorenzo Pieralisi
2011-07-12 10:19           ` Russell King - ARM Linux
2011-07-09  8:38   ` Russell King - ARM Linux
2011-07-09  8:45     ` Russell King - ARM Linux
2011-07-11 15:36       ` Lorenzo Pieralisi
2011-07-07 15:50 ` [RFC PATCH 06/17] ARM: kernel: save/restore generic infrastructure Lorenzo Pieralisi
2011-07-08  1:58   ` Santosh Shilimkar
2011-07-08 10:33     ` Lorenzo Pieralisi
2011-07-09 10:01   ` Russell King - ARM Linux
2011-07-11 11:33     ` Lorenzo Pieralisi
2011-07-28 16:22   ` Amit Kachhap
2011-07-28 18:17     ` Lorenzo Pieralisi
2011-07-07 15:50 ` [RFC PATCH 07/17] ARM: kernel: save/restore v7 assembly helpers Lorenzo Pieralisi
2011-07-07 15:50 ` [RFC PATCH 08/17] ARM: kernel: save/restore arch runtime support Lorenzo Pieralisi
2011-07-07 15:50 ` [RFC PATCH 09/17] ARM: kernel: v7 resets support Lorenzo Pieralisi
2011-07-07 15:50 ` [RFC PATCH 10/17] ARM: kernel: save/restore v7 infrastructure support Lorenzo Pieralisi
2011-07-07 15:50 ` [RFC PATCH 11/17] ARM: kernel: add support for Lamport's bakery locks Lorenzo Pieralisi
2011-07-07 15:50 ` [RFC PATCH 12/17] ARM: kernel: add SCU reset hook Lorenzo Pieralisi
2011-07-08  2:14   ` Santosh Shilimkar
2011-07-08  9:47     ` Lorenzo Pieralisi
2011-07-07 15:50 ` [RFC PATCH 13/17] ARM: mm: L2x0 save/restore support Lorenzo Pieralisi
2011-07-07 22:06   ` Colin Cross
2011-07-08  8:25     ` Lorenzo Pieralisi
2011-07-08  2:19   ` Santosh Shilimkar
2011-07-08 10:54     ` Lorenzo Pieralisi
2011-07-07 15:50 ` [RFC PATCH 14/17] ARM: kernel: save/restore 1:1 page tables Lorenzo Pieralisi
2011-07-08  2:24   ` Santosh Shilimkar
2011-07-08 10:48     ` Lorenzo Pieralisi
2011-07-07 15:50 ` [RFC PATCH 15/17] ARM: perf: use cpu pm notifiers to save pmu state Lorenzo Pieralisi
2011-07-07 15:50 ` [RFC PATCH 16/17] ARM: PM: enhance idle pm notifiers Lorenzo Pieralisi
2011-07-07 21:20   ` Colin Cross
2011-07-08  9:04     ` Lorenzo Pieralisi
2011-07-07 15:50 ` [RFC PATCH 17/17] ARM: kernel: save/restore build infrastructure Lorenzo Pieralisi
2011-07-08  2:29   ` Santosh Shilimkar
2011-07-08 15:14     ` Lorenzo Pieralisi
2011-07-26 12:14   ` Amit Kachhap
2011-07-27  8:48     ` Lorenzo Pieralisi
2011-07-07 17:15 ` [RFC PATCH 00/17] ARM: common idle infrastructure Russell King - ARM Linux
2011-07-08  7:56   ` Lorenzo Pieralisi

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=4E16664D.7010206@ti.com \
    --to=santosh.shilimkar@ti.com \
    --cc=linux-arm-kernel@lists.infradead.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 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).