All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/5] ARM: pm: add generic CPU suspend/resume support
Date: Fri, 11 Feb 2011 11:58:53 +0000	[thread overview]
Message-ID: <20110211115853.GC23404@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTimCtaSZ=CHT5snWZ496_bi4sH=0LU7vJ-Jfh=dP@mail.gmail.com>

On Wed, Feb 09, 2011 at 07:15:25PM -0800, Colin Cross wrote:
> The diagnostic register also needs to be saved to keep the errata bits
> set in __v7_setup.

Saving I've no problem with.  Restoring gets hairy with kernels running
in non-secure mode, as we can't just write the register - we don't know
whether we are running in secure or non-secure mode.  A write to the
register in NS mode will crash.

Santosh: is the diagnostic register on OMAP4 re-initialized by the secure
code on OMAP?

> > + ? ? ? stmia ? r0, {r4 - r11}
> > + ? ? ? ldmfd ? sp!, {r4 - r11, pc}
> > +ENDPROC(cpu_v7_do_suspend)
> > +
> > +ENTRY(cpu_v7_do_resume)
> > + ? ? ? mov ? ? ip, #0
> > + ? ? ? mcr ? ? p15, 0, ip, c8, c7, 0 ? @ invalidate TLBs
> > + ? ? ? mcr ? ? p15, 0, ip, c7, c5, 0 ? @ invalidate I cache
> 
> Does this need the same ALT_SMP/ALT_UP combo as v7_flush_icache_all?

That depends whether you the CPU which is resuming is part of a coherent
SMP system at that point.  This instruction will invalidate the I-cache
for the local CPU only, whereas the c7, c1 variant will invalidate the
instruction caches of all CPUs within the inner sharable domain.

Has anything changed in the other CPUs as a result of this CPU resuming
at this point?  I don't think so, so I think we just need to ensure that
the local CPU instruction cache is invalidated at this point.

> Tegra2 suspend and cpuidle works on top of this patch and the patch
> that adds SMP support to sleep_save_sp.  Tegra seems to need to
> invalidate the entire l1 data cache before enabling it,

As it's undefined what state the data cache is in on resume, I'm surprised
the s5pv210 code doesn't also need a D-cache invalidate too.  Maybe Samsung
folk can answer that.

> so I'm using a
> custom reset vector that branches to cpu_resume, and I'm handling the
> TLB invalidate in the function cpu_resume returns to.
> 
> Tested-by: Colin Cross <ccross@android.com>
> 
> Are you targeting 2.6.39 with these patches?  They replace a few
> hundred lines of code in the Tegra2 suspend, hotplug, and idle
> patches, so I'd like to wait until this is in before pushing mine.

Undecided at the moment.  It's great that you've tested it, and I've
also tested it on Assabet, but PXA and Samsung stuff hasn't been
tested yet.  I guess I could just push the generic and sa1100 bits for
2.6.39, unless the remainder gets tested.

Once the above issues have answers, I'll see about posting a new set of
patches.

  reply	other threads:[~2011-02-11 11:58 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-06 19:11 [RFC] Generic CPU save/restore PM support Russell King - ARM Linux
2011-02-06 19:12 ` [PATCH 1/5] ARM: move cache/processor/fault glue to separate include files Russell King - ARM Linux
2011-02-06 19:12 ` [PATCH 2/5] ARM: pm: add generic CPU suspend/resume support Russell King - ARM Linux
2011-02-07 12:01   ` [PATCH v2 " Russell King - ARM Linux
2011-02-07 12:10     ` [PATCH v3 " Russell King - ARM Linux
2011-02-07 13:21       ` saeed bishara
2011-02-07 13:34         ` Russell King - ARM Linux
2011-02-07 14:04           ` saeed bishara
2011-02-07 14:17             ` Russell King - ARM Linux
2011-02-07 14:27               ` saeed bishara
2011-02-07 14:33                 ` Russell King - ARM Linux
2011-02-07 14:58                   ` saeed bishara
2011-02-07 15:02                     ` Russell King - ARM Linux
2011-02-08 10:21                       ` Lorenzo Pieralisi
2011-02-08 11:23                         ` Russell King - ARM Linux
2011-02-08 12:33                           ` Russell King - ARM Linux
2011-02-08 14:25                             ` Lorenzo Pieralisi
2011-02-08  8:08               ` Colin Cross
2011-02-10  3:15               ` Colin Cross
2011-02-11 11:58                 ` Russell King - ARM Linux [this message]
2011-02-11 12:07                   ` Santosh Shilimkar
2011-02-12 14:50                     ` Russell King - ARM Linux
2011-02-12 15:09                       ` Santosh Shilimkar
2011-02-28 18:17                         ` Santosh Shilimkar
2011-02-28 18:17                           ` Santosh Shilimkar
2011-02-28 18:21                         ` Jean Pihet
2011-02-14  0:27                   ` Kukjin Kim
2011-02-06 19:13 ` [PATCH 3/5] ARM: pm: convert PXA to generic " Russell King - ARM Linux
2011-02-06 19:13 ` [PATCH 4/5] ARM: pm: convert sa11x0 " Russell King - ARM Linux
2011-02-07 18:11   ` Russell King - ARM Linux
2011-02-06 19:13 ` [PATCH 5/5] ARM: pm: convert samsung platforms " Russell King - ARM Linux
2011-02-07  5:42 ` [RFC] Generic CPU save/restore PM support Kukjin Kim
2011-02-07 10:44   ` Russell King - ARM Linux
     [not found] <mailman.11856.1297088273.1534.linux-arm-kernel@lists.infradead.org>
2011-02-07 15:41 ` [PATCH v3 2/5] ARM: pm: add generic CPU suspend/resume support Frank Hofmann

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=20110211115853.GC23404@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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 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.