All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Shawn Guo <shawn.guo@freescale.com>
Cc: linux-omap@vger.kernel.org,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 00/11] Add L2 cache cleaning to generic CPU suspend
Date: Mon, 19 Sep 2011 17:22:22 +0100	[thread overview]
Message-ID: <20110919162222.GC16591@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20110910161002.GA462@S2100-06.ap.freescale.net>

On Sun, Sep 11, 2011 at 12:10:04AM +0800, Shawn Guo wrote:
> On Thu, Sep 01, 2011 at 11:57:54PM +0800, Shawn Guo wrote:
> > On Thu, Sep 01, 2011 at 04:34:51PM +0100, Russell King - ARM Linux wrote:
> > > On Thu, Sep 01, 2011 at 11:33:43PM +0800, Shawn Guo wrote:
> > > > This is also the case on i.MX6Q, which L2 cache is retained during a
> > > > suspend/resume cycle.  Currently, I have to call into the following
> > > > before calling generic cpu_suspend() to clean/invalidate the entire
> > > > L2 cache.
> > > > 
> > > > 	outer_flush_all();
> > > > 	outer_disable();
> > > > 
> > > > But there is a wired thing on using generic cpu_resume().  I have to
> > > > invalidate L1 before calling into cpu_resume() like below.
> > > > 
> > > > ENTRY(imx6q_cpu_resume)
> > > >         bl      v7_invalidate_l1
> > > >         b       cpu_resume
> > > > ENDPROC(imx6q_cpu_resume)
> > > > 
> > > > ENTRY(imx6q_secondary_startup)
> > > >         bl      v7_invalidate_l1
> > > >         b       secondary_startup
> > > > ENDPROC(imx6q_secondary_startup)
> > > > 
> > > > The v7_invalidate_l1() is the function copied from mach-tegra/headsmp.S,
> > > > which has to be called before calling secondary_startup to boot
> > > > secondary cores (same situation between Tegra and i.MX6Q).
> > > 
> > > Presumably that's because your L1 cache contains randomized data with
> > > random validity (and presumably random dirtyness) at boot time - something
> > > which unfortunately the ARM ARM permits.  I don't think we can go to the
> > > extent of dealing with this in the generic code as it would unnecessarily
> > > perturb those implementations which either the boot loader has already
> > > sorted out that issue, or which don't have the issue at all.
> > > 
> > Yes, agreed.  It seems that Tegra and i.MX6Q are the only two CA9MP
> > cases here.  But is it possible to maintain this v7_invalidate_l1()
> > function in cache-v7.S, so that we do not need to duplicate it in
> > platform codes?
> > 
> > > > Before applying this patch series, I have something like below actually
> > > > working.
> > > > 
> > > > 
> > > > 	outer_flush_all();
> > > > 	outer_disable();
> > > > 	imx_set_cpu_jump(0, imx6q_cpu_resume);
> > > > 	/* Zzz ... */
> > > > 	cpu_suspend(0, imx6q_suspend_finish);
> > > > 
> > > > I expect with you patches applied, I can still have it work with simply
> > > > removing those two lines outer cache codes.
> > > 
> > > That should be the case.
> > > 
> > > > But unfortunately, I'm
> > > > running into Oops when resuming back.  And I also have Oops with
> > > > imx_set_cpu_jump(0, cpu_resume) which means skipping the
> > > > v7_invalidate_l1() and calling generic cpu_resume() only.
> > > 
> > > Do you have a copy of the oops?
> > > 
> > 
> Hi Russell,
> 
> After following your great debugging clue that we need to enable L2
> before calling into generic cpu_resume(), now this patch series works
> great for imx6q.  Thanks a lot, and here is my tag.
> 
> Tested-by: Shawn Guo <shawn.guo@linaro.org>

Is that for all these patches?

WARNING: multiple messages have this Message-ID (diff)
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 00/11] Add L2 cache cleaning to generic CPU suspend
Date: Mon, 19 Sep 2011 17:22:22 +0100	[thread overview]
Message-ID: <20110919162222.GC16591@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20110910161002.GA462@S2100-06.ap.freescale.net>

On Sun, Sep 11, 2011 at 12:10:04AM +0800, Shawn Guo wrote:
> On Thu, Sep 01, 2011 at 11:57:54PM +0800, Shawn Guo wrote:
> > On Thu, Sep 01, 2011 at 04:34:51PM +0100, Russell King - ARM Linux wrote:
> > > On Thu, Sep 01, 2011 at 11:33:43PM +0800, Shawn Guo wrote:
> > > > This is also the case on i.MX6Q, which L2 cache is retained during a
> > > > suspend/resume cycle.  Currently, I have to call into the following
> > > > before calling generic cpu_suspend() to clean/invalidate the entire
> > > > L2 cache.
> > > > 
> > > > 	outer_flush_all();
> > > > 	outer_disable();
> > > > 
> > > > But there is a wired thing on using generic cpu_resume().  I have to
> > > > invalidate L1 before calling into cpu_resume() like below.
> > > > 
> > > > ENTRY(imx6q_cpu_resume)
> > > >         bl      v7_invalidate_l1
> > > >         b       cpu_resume
> > > > ENDPROC(imx6q_cpu_resume)
> > > > 
> > > > ENTRY(imx6q_secondary_startup)
> > > >         bl      v7_invalidate_l1
> > > >         b       secondary_startup
> > > > ENDPROC(imx6q_secondary_startup)
> > > > 
> > > > The v7_invalidate_l1() is the function copied from mach-tegra/headsmp.S,
> > > > which has to be called before calling secondary_startup to boot
> > > > secondary cores (same situation between Tegra and i.MX6Q).
> > > 
> > > Presumably that's because your L1 cache contains randomized data with
> > > random validity (and presumably random dirtyness) at boot time - something
> > > which unfortunately the ARM ARM permits.  I don't think we can go to the
> > > extent of dealing with this in the generic code as it would unnecessarily
> > > perturb those implementations which either the boot loader has already
> > > sorted out that issue, or which don't have the issue at all.
> > > 
> > Yes, agreed.  It seems that Tegra and i.MX6Q are the only two CA9MP
> > cases here.  But is it possible to maintain this v7_invalidate_l1()
> > function in cache-v7.S, so that we do not need to duplicate it in
> > platform codes?
> > 
> > > > Before applying this patch series, I have something like below actually
> > > > working.
> > > > 
> > > > 
> > > > 	outer_flush_all();
> > > > 	outer_disable();
> > > > 	imx_set_cpu_jump(0, imx6q_cpu_resume);
> > > > 	/* Zzz ... */
> > > > 	cpu_suspend(0, imx6q_suspend_finish);
> > > > 
> > > > I expect with you patches applied, I can still have it work with simply
> > > > removing those two lines outer cache codes.
> > > 
> > > That should be the case.
> > > 
> > > > But unfortunately, I'm
> > > > running into Oops when resuming back.  And I also have Oops with
> > > > imx_set_cpu_jump(0, cpu_resume) which means skipping the
> > > > v7_invalidate_l1() and calling generic cpu_resume() only.
> > > 
> > > Do you have a copy of the oops?
> > > 
> > 
> Hi Russell,
> 
> After following your great debugging clue that we need to enable L2
> before calling into generic cpu_resume(), now this patch series works
> great for imx6q.  Thanks a lot, and here is my tag.
> 
> Tested-by: Shawn Guo <shawn.guo@linaro.org>

Is that for all these patches?

  reply	other threads:[~2011-09-19 16:22 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-01 12:47 [PATCH 00/11] Add L2 cache cleaning to generic CPU suspend Russell King - ARM Linux
2011-09-01 12:47 ` Russell King - ARM Linux
2011-09-01 12:48 ` [PATCH 01/11] ARM: pm: CPU specific code should not overwrite r1 (v:p offset) Russell King - ARM Linux
2011-09-01 12:48   ` Russell King - ARM Linux
2011-09-01 12:48 ` [PATCH 02/11] ARM: pm: arm920/926: fix number of registers saved Russell King - ARM Linux
2011-09-01 12:48   ` Russell King - ARM Linux
2011-09-01 12:49 ` [PATCH 03/11] ARM: pm: some ARMv7 requires a dsb in resume to ensure correctness Russell King - ARM Linux
2011-09-01 12:49   ` Russell King - ARM Linux
2011-09-07 15:41   ` Catalin Marinas
2011-09-07 15:41     ` Catalin Marinas
2011-09-07 16:19     ` Russell King - ARM Linux
2011-09-07 16:19       ` Russell King - ARM Linux
2011-09-07 16:26       ` Catalin Marinas
2011-09-07 16:26         ` Catalin Marinas
2011-09-07 16:54       ` Catalin Marinas
2011-09-07 16:54         ` Catalin Marinas
2011-09-01 12:49 ` [PATCH 04/11] ARM: pm: avoid writing the auxillary control register for ARMv7 Russell King - ARM Linux
2011-09-01 12:49   ` Russell King - ARM Linux
2011-09-01 12:49 ` [PATCH 05/11] ARM: pm: force non-zero return value from __cpu_suspend when aborting Russell King - ARM Linux
2011-09-01 12:49   ` Russell King - ARM Linux
2011-09-01 12:50 ` [PATCH 06/11] ARM: pm: preallocate a page table for suspend/resume Russell King - ARM Linux
2011-09-01 12:50   ` Russell King - ARM Linux
2011-09-01 12:50 ` [PATCH 07/11] ARM: pm: only use preallocated page table during resume Russell King - ARM Linux
2011-09-01 12:50   ` Russell King - ARM Linux
2011-09-01 12:50 ` [PATCH 08/11] ARM: pm: no need to save/restore context ID register Russell King - ARM Linux
2011-09-01 12:50   ` Russell King - ARM Linux
2011-09-03 16:33   ` Santosh
2011-09-03 16:33     ` Santosh
2011-09-04 10:08     ` Russell King - ARM Linux
2011-09-04 10:08       ` Russell King - ARM Linux
2011-09-01 12:51 ` [PATCH 09/11] ARM: pm: get rid of cpu_resume_turn_mmu_on Russell King - ARM Linux
2011-09-01 12:51   ` Russell King - ARM Linux
2011-09-01 12:51 ` [PATCH 10/11] ARM: pm: convert some assembly to C Russell King - ARM Linux
2011-09-01 12:51   ` Russell King - ARM Linux
2011-09-07 15:48   ` Lorenzo Pieralisi
2011-09-07 15:48     ` Lorenzo Pieralisi
2011-09-19 16:32     ` Russell King - ARM Linux
2011-09-19 16:32       ` Russell King - ARM Linux
2011-09-01 12:51 ` [PATCH 11/11] ARM: pm: add L2 cache cleaning for suspend Russell King - ARM Linux
2011-09-01 12:51   ` Russell King - ARM Linux
2011-09-01 15:33 ` [PATCH 00/11] Add L2 cache cleaning to generic CPU suspend Shawn Guo
2011-09-01 15:33   ` Shawn Guo
2011-09-01 15:34   ` Russell King - ARM Linux
2011-09-01 15:34     ` Russell King - ARM Linux
2011-09-01 15:57     ` Shawn Guo
2011-09-01 15:57       ` Shawn Guo
2011-09-10 16:10       ` Shawn Guo
2011-09-10 16:10         ` Shawn Guo
2011-09-19 16:22         ` Russell King - ARM Linux [this message]
2011-09-19 16:22           ` Russell King - ARM Linux
2011-09-20  3:24           ` Shawn Guo
2011-09-20  3:24             ` Shawn Guo
2011-09-03 16:36 ` Santosh
2011-09-03 16:36   ` Santosh
2011-09-04 10:12   ` Russell King - ARM Linux
2011-09-04 10:12     ` Russell King - ARM Linux

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=20110919162222.GC16591@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=santosh.shilimkar@ti.com \
    --cc=shawn.guo@freescale.com \
    /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.