linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, G.Chen@freescale.com,
	Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH] powerpc: Fix determining TI_CPU in power_save_ppc32_restore()
Date: Tue, 26 Aug 2008 14:37:40 +1000	[thread overview]
Message-ID: <1219725460.13162.120.camel@pasglop> (raw)
In-Reply-To: <Pine.LNX.4.64.0808252058320.21303@blarg.am.freescale.net>


>  #ifdef CONFIG_SMP
> -	mfspr	r12,SPRN_SPRG3
> -	lwz	r11,TI_CPU(r12)		/* get cpu number * 4 */
> +	lwz	r11,TI_CPU(r9)		/* get cpu number * 4 */
>  	slwi	r11,r11,2
>  #else
>  	li	r11,0
>  #endif
> +
> +	lwz	r9,_LINK(r11)		/* interrupted in ppc6xx_idle: */
> +	stw	r9,_NIP(r11)		/* make it do a blr */
> +

hrm... you just clobbered r11, won't work very well :-)

Ben.

>  	/* Todo make sure all these are in the same page
>  	 * and load r11 (@ha part + CPU offset) only once
>  	 */
> diff --git a/arch/powerpc/kernel/idle_e500.S b/arch/powerpc/kernel/idle_e500.S
> index 0630403..c9d7234 100644
> --- a/arch/powerpc/kernel/idle_e500.S
> +++ b/arch/powerpc/kernel/idle_e500.S
> @@ -76,18 +76,19 @@ END_FTR_SECTION_IFSET(CPU_FTR_L2CSR|CPU_FTR_CAN_NAP)
>  /*
>   * Return from NAP/DOZE mode, restore some CPU specific registers,
>   * r2 containing physical address of current.
> + * r9 points to thread_info
>   * r11 points to the exception frame (physical address).
>   * We have to preserve r10.
>   */
>  _GLOBAL(power_save_ppc32_restore)
> -	lwz	r9,_LINK(r11)		/* interrupted in e500_idle */
> -	stw	r9,_NIP(r11)		/* make it do a blr */
> -
>  #ifdef CONFIG_SMP
> -	mfspr	r12,SPRN_SPRG3
> -	lwz	r11,TI_CPU(r12)		/* get cpu number * 4 */
> +	lwz	r11,TI_CPU(r9)		/* get cpu number * 4 */
>  	slwi	r11,r11,2
>  #else
>  	li	r11,0
>  #endif
> +
> +	lwz	r9,_LINK(r11)		/* interrupted in e500_idle */
> +	stw	r9,_NIP(r11)		/* make it do a blr */
> +
>  	b	transfer_to_handler_cont

      parent reply	other threads:[~2008-08-26  4:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-26  1:59 [PATCH] powerpc: Fix determining TI_CPU in power_save_ppc32_restore() Kumar Gala
2008-08-26  2:10 ` Kumar Gala
2008-08-26  4:37 ` Benjamin Herrenschmidt [this message]

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=1219725460.13162.120.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=G.Chen@freescale.com \
    --cc=galak@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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).