All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chenhui Zhao <chenhui.zhao@freescale.com>
To: Scott Wood <scottwood@freescale.com>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Jason.Jin@freescale.com,
	Wang Dongsheng-B40534 <B40534@freescale.com>
Subject: Re: [PATCH 8/9] powerpc/85xx: add save/restore functions for core registers
Date: Mon, 17 Mar 2014 18:50:32 +0800	[thread overview]
Message-ID: <20140317105032.GC6204@localhost.localdomain> (raw)
In-Reply-To: <1394838105.12479.144.camel@snotra.buserror.net>

On Fri, Mar 14, 2014 at 06:01:45PM -0500, Scott Wood wrote:
> On Wed, 2014-03-12 at 17:42 +0800, Chenhui Zhao wrote:
> > On Tue, Mar 11, 2014 at 07:45:14PM -0500, Scott Wood wrote:
> > > On Fri, 2014-03-07 at 12:58 +0800, Chenhui Zhao wrote:
> > > > From: Wang Dongsheng <dongsheng.wang@freescale.com>
> > > > 
> > > > Add booke_cpu_state_save() and booke_cpu_state_restore() functions which can be
> > > > used to save/restore CPU's registers in the case of deep sleep and hibernation.
> > > > 
> > > > Supported processors: E6500, E5500, E500MC, E500v2 and E500v1.
> > > > 
> > > > Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
> > > > Signed-off-by: Chenhui Zhao <chenhui.zhao@freescale.com>
> > > > ---
> > > >  arch/powerpc/include/asm/booke_save_regs.h |   96 ++++++++
> > > >  arch/powerpc/kernel/Makefile               |    1 +
> > > >  arch/powerpc/kernel/booke_save_regs.S      |  361 ++++++++++++++++++++++++++++
> > > >  3 files changed, 458 insertions(+), 0 deletions(-)
> > > >  create mode 100644 arch/powerpc/include/asm/booke_save_regs.h
> > > >  create mode 100644 arch/powerpc/kernel/booke_save_regs.S
> > > > 
> > > > diff --git a/arch/powerpc/include/asm/booke_save_regs.h b/arch/powerpc/include/asm/booke_save_regs.h
> > > > new file mode 100644
> > > > index 0000000..87c357a
> > > > --- /dev/null
> > > > +++ b/arch/powerpc/include/asm/booke_save_regs.h
> > > > @@ -0,0 +1,96 @@
> > > > +/*
> > > > + *  Save/restore e500 series core registers
> > > 
> > > Filename says booke, comment says e500.
> > > 
> > > Filename and comment also fail to point out that this is specifically
> > > for standby/suspend, not for hibernate which is implemented in
> > > swsusp_booke.S/swsusp_asm64.S.
> > 
> > Sorry for inconsistency. Will changes e500 to booke.
> > Hibernation and suspend can share the code.
> 
> Maybe they could, but AFAICT this patchset doesn't make that happen --
> and I'm not convinced that the churn would be worthwhile.  Note that
> swsusp_asm64.S is not just for booke, so most of that file would not be
> going away if you did make such a change.

OK. Let's put Hibernation aside, and change the code just for suspend.

> 
> I also don't like the way it looks like booke_save_regs.S is a booke
> version of ppc_save_regs.S, even though they serve different purposes
> and ppc_save_regs.S is still relevant to booke.
> 
> > > > + * Software-Use Registers
> > > > + *	SPRG1			0x260		(dw * 76), 64-bit need to save.
> > > > + *	SPRG3			0x268		(dw * 77), 32-bit need to save.
> > > 
> > > What about "CPU and NUMA node for VDSO getcpu" on 64-bit?  Currently
> > > SPRG3, but it will need to change for critical interrupt support.
> > > 
> > > > + * MMU Registers
> > > > + *	PID0 - PID2		0x270 ~ 0x280	(dw * 78 ~ dw * 80)
> > > 
> > > PID1/PID2 are e500v1/v2 only -- and Linux doesn't use them outside of
> > > KVM (and you're not in KVM when you're running this code).
> > > 
> > > Are we ever going to have a non-zero PID at this point?
> > 
> > I incline to the view that saving all registers regardless of used or
> > unused. The good point is that it can be compliant to the future
> > changes of the usage of registers.
> > 
> > What do you think?
> 
> I agree to a certain extent, but balance it with the complexity of
> dealing with registers that don't exist on all booke chips.  If they
> don't really need to be saved, why go through the hassle of conditional
> code?

I agree. For these registers, I'll check if they are really needed.

-Chenhui

WARNING: multiple messages have this Message-ID (diff)
From: Chenhui Zhao <chenhui.zhao@freescale.com>
To: Scott Wood <scottwood@freescale.com>
Cc: <linuxppc-dev@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>,
	<leoli@freescale.com>, <Jason.Jin@freescale.com>,
	Wang Dongsheng-B40534 <B40534@freescale.com>
Subject: Re: [PATCH 8/9] powerpc/85xx: add save/restore functions for core registers
Date: Mon, 17 Mar 2014 18:50:32 +0800	[thread overview]
Message-ID: <20140317105032.GC6204@localhost.localdomain> (raw)
In-Reply-To: <1394838105.12479.144.camel@snotra.buserror.net>

On Fri, Mar 14, 2014 at 06:01:45PM -0500, Scott Wood wrote:
> On Wed, 2014-03-12 at 17:42 +0800, Chenhui Zhao wrote:
> > On Tue, Mar 11, 2014 at 07:45:14PM -0500, Scott Wood wrote:
> > > On Fri, 2014-03-07 at 12:58 +0800, Chenhui Zhao wrote:
> > > > From: Wang Dongsheng <dongsheng.wang@freescale.com>
> > > > 
> > > > Add booke_cpu_state_save() and booke_cpu_state_restore() functions which can be
> > > > used to save/restore CPU's registers in the case of deep sleep and hibernation.
> > > > 
> > > > Supported processors: E6500, E5500, E500MC, E500v2 and E500v1.
> > > > 
> > > > Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
> > > > Signed-off-by: Chenhui Zhao <chenhui.zhao@freescale.com>
> > > > ---
> > > >  arch/powerpc/include/asm/booke_save_regs.h |   96 ++++++++
> > > >  arch/powerpc/kernel/Makefile               |    1 +
> > > >  arch/powerpc/kernel/booke_save_regs.S      |  361 ++++++++++++++++++++++++++++
> > > >  3 files changed, 458 insertions(+), 0 deletions(-)
> > > >  create mode 100644 arch/powerpc/include/asm/booke_save_regs.h
> > > >  create mode 100644 arch/powerpc/kernel/booke_save_regs.S
> > > > 
> > > > diff --git a/arch/powerpc/include/asm/booke_save_regs.h b/arch/powerpc/include/asm/booke_save_regs.h
> > > > new file mode 100644
> > > > index 0000000..87c357a
> > > > --- /dev/null
> > > > +++ b/arch/powerpc/include/asm/booke_save_regs.h
> > > > @@ -0,0 +1,96 @@
> > > > +/*
> > > > + *  Save/restore e500 series core registers
> > > 
> > > Filename says booke, comment says e500.
> > > 
> > > Filename and comment also fail to point out that this is specifically
> > > for standby/suspend, not for hibernate which is implemented in
> > > swsusp_booke.S/swsusp_asm64.S.
> > 
> > Sorry for inconsistency. Will changes e500 to booke.
> > Hibernation and suspend can share the code.
> 
> Maybe they could, but AFAICT this patchset doesn't make that happen --
> and I'm not convinced that the churn would be worthwhile.  Note that
> swsusp_asm64.S is not just for booke, so most of that file would not be
> going away if you did make such a change.

OK. Let's put Hibernation aside, and change the code just for suspend.

> 
> I also don't like the way it looks like booke_save_regs.S is a booke
> version of ppc_save_regs.S, even though they serve different purposes
> and ppc_save_regs.S is still relevant to booke.
> 
> > > > + * Software-Use Registers
> > > > + *	SPRG1			0x260		(dw * 76), 64-bit need to save.
> > > > + *	SPRG3			0x268		(dw * 77), 32-bit need to save.
> > > 
> > > What about "CPU and NUMA node for VDSO getcpu" on 64-bit?  Currently
> > > SPRG3, but it will need to change for critical interrupt support.
> > > 
> > > > + * MMU Registers
> > > > + *	PID0 - PID2		0x270 ~ 0x280	(dw * 78 ~ dw * 80)
> > > 
> > > PID1/PID2 are e500v1/v2 only -- and Linux doesn't use them outside of
> > > KVM (and you're not in KVM when you're running this code).
> > > 
> > > Are we ever going to have a non-zero PID at this point?
> > 
> > I incline to the view that saving all registers regardless of used or
> > unused. The good point is that it can be compliant to the future
> > changes of the usage of registers.
> > 
> > What do you think?
> 
> I agree to a certain extent, but balance it with the complexity of
> dealing with registers that don't exist on all booke chips.  If they
> don't really need to be saved, why go through the hassle of conditional
> code?

I agree. For these registers, I'll check if they are really needed.

-Chenhui


  reply	other threads:[~2014-03-17 10:50 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-07  4:57 [PATCH 1/9] powerpc/fsl: add PVR definition for E500MC and E5500 Chenhui Zhao
2014-03-07  4:57 ` Chenhui Zhao
2014-03-07  4:57 ` [PATCH 2/9] powerpc/cache: add cache flush operation for various e500 Chenhui Zhao
2014-03-07  4:57   ` Chenhui Zhao
2014-03-07  4:57 ` [PATCH 3/9] powerpc/rcpm: add RCPM driver Chenhui Zhao
2014-03-07  4:57   ` Chenhui Zhao
2014-03-11 23:42   ` Scott Wood
2014-03-11 23:42     ` Scott Wood
2014-03-12  3:59     ` Chenhui Zhao
2014-03-12  3:59       ` Chenhui Zhao
2014-03-14 22:34       ` Scott Wood
2014-03-14 22:34         ` Scott Wood
2014-03-07  4:58 ` [PATCH 4/9] powerpc/85xx: support CPU hotplug for e500mc and e5500 Chenhui Zhao
2014-03-07  4:58   ` Chenhui Zhao
2014-03-11 23:48   ` Scott Wood
2014-03-11 23:48     ` Scott Wood
2014-03-12  4:34     ` Chenhui Zhao
2014-03-12  4:34       ` Chenhui Zhao
2014-03-07  4:58 ` [PATCH 5/9] powerpc/85xx: disable irq by hardware when suspend for 64-bit Chenhui Zhao
2014-03-07  4:58   ` Chenhui Zhao
2014-03-11 23:51   ` Scott Wood
2014-03-11 23:51     ` Scott Wood
2014-03-12  7:46     ` Chenhui Zhao
2014-03-12  7:46       ` Chenhui Zhao
2014-03-14 22:41       ` Scott Wood
2014-03-14 22:41         ` Scott Wood
2014-03-17  9:37         ` Chenhui Zhao
2014-03-17  9:37           ` Chenhui Zhao
2014-03-07  4:58 ` [PATCH 6/9] powerpc/85xx: support sleep feature on QorIQ SoCs with RCPM Chenhui Zhao
2014-03-07  4:58   ` Chenhui Zhao
2014-03-12  0:00   ` Scott Wood
2014-03-12  0:00     ` Scott Wood
2014-03-12  8:08     ` Chenhui Zhao
2014-03-12  8:08       ` Chenhui Zhao
2014-03-14 22:46       ` Scott Wood
2014-03-14 22:46         ` Scott Wood
2014-03-07  4:58 ` [PATCH 7/9] fsl: add EPU FSM configuration for deep sleep Chenhui Zhao
2014-03-07  4:58   ` Chenhui Zhao
2014-03-12  0:08   ` Scott Wood
2014-03-12  0:08     ` Scott Wood
2014-03-12  8:34     ` Chenhui Zhao
2014-03-12  8:34       ` Chenhui Zhao
2014-03-14 22:51       ` Scott Wood
2014-03-14 22:51         ` Scott Wood
2014-03-17 10:27         ` Chenhui Zhao
2014-03-17 10:27           ` Chenhui Zhao
2014-03-18 23:21           ` Scott Wood
2014-03-18 23:21             ` Scott Wood
2014-03-19  0:08             ` Chenhui Zhao
2014-03-19  0:08               ` Chenhui Zhao
2014-03-07  4:58 ` [PATCH 8/9] powerpc/85xx: add save/restore functions for core registers Chenhui Zhao
2014-03-07  4:58   ` Chenhui Zhao
2014-03-12  0:45   ` Scott Wood
2014-03-12  0:45     ` Scott Wood
2014-03-12  9:42     ` Chenhui Zhao
2014-03-12  9:42       ` Chenhui Zhao
2014-03-14 23:01       ` Scott Wood
2014-03-14 23:01         ` Scott Wood
2014-03-17 10:50         ` Chenhui Zhao [this message]
2014-03-17 10:50           ` Chenhui Zhao
2014-03-07  4:58 ` [PATCH 9/9] powerpc/pm: support deep sleep feature on T1040 Chenhui Zhao
2014-03-07  4:58   ` Chenhui Zhao
2014-03-12  1:10   ` Scott Wood
2014-03-12  1:10     ` Scott Wood
2014-03-12  5:57     ` Kevin Hao
2014-03-12  5:57       ` Kevin Hao
2014-03-12 17:43       ` Scott Wood
2014-03-12 17:43         ` Scott Wood
2014-03-13  7:46         ` Kevin Hao
2014-03-13  7:46           ` Kevin Hao
2014-03-14 22:26           ` Scott Wood
2014-03-14 22:26             ` Scott Wood
2014-03-16  4:58             ` Kevin Hao
2014-03-16  4:58               ` Kevin Hao
2014-03-18 23:18               ` Scott Wood
2014-03-18 23:18                 ` Scott Wood
2014-03-20 11:47                 ` Kevin Hao
2014-03-20 11:47                   ` Kevin Hao
2014-03-20 11:59                   ` David Laight
2014-03-20 11:59                     ` David Laight
2014-03-20 22:07                     ` Scott Wood
2014-03-20 22:07                       ` Scott Wood
2014-03-21  9:21                       ` David Laight
2014-03-21  9:21                         ` David Laight
2014-03-21 21:16                         ` Scott Wood
2014-03-21 21:16                           ` Scott Wood
2014-03-20 22:17                   ` Scott Wood
2014-03-20 22:17                     ` Scott Wood
2014-03-12 10:40     ` Chenhui Zhao
2014-03-12 10:40       ` Chenhui Zhao
2014-03-14 23:18       ` Scott Wood
2014-03-14 23:18         ` Scott Wood
2014-03-17 11:19         ` Chenhui Zhao
2014-03-17 11:19           ` Chenhui Zhao
2014-03-18 22:42           ` Scott Wood
2014-03-18 22:42             ` Scott Wood
2014-03-19  0:56             ` Chenhui Zhao
2014-03-19  0:56               ` Chenhui Zhao
2014-03-20 23:33               ` Scott Wood
2014-03-20 23:33                 ` Scott Wood

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=20140317105032.GC6204@localhost.localdomain \
    --to=chenhui.zhao@freescale.com \
    --cc=B40534@freescale.com \
    --cc=Jason.Jin@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=scottwood@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.