Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1618251

Re: [PATCH 4.4 23/26] power: reset: at91-poweroff: timely shutdown LPDDR memories

From Alexandre Belloni <alexandre.belloni@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [PATCH 4.4 23/26] power: reset: at91-poweroff: timely shutdown LPDDR memories
Date 2017-04-06 20:20 +0200
Message-ID <ttkaJ-4pu-9@gated-at.bofh.it> (permalink)
References <ttb7s-66T-19@gated-at.bofh.it> <ttc3x-6L0-51@gated-at.bofh.it> <ttjHI-3XQ-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 06/04/2017 at 18:45:39 +0100, Ben Hutchings wrote:
> On Thu, 2017-04-06 at 10:38 +0200, Greg Kroah-Hartman wrote:
> > 4.4-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> > 
> > commit 0b0408745e7ff24757cbfd571d69026c0ddb803c upstream.
> > 
> > LPDDR memories can only handle up to 400 uncontrolled power off. Ensure the
> > proper power off sequence is used before shutting down the platform.
> > 
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> > Signed-off-by: Sebastian Reichel <sre@kernel.org>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> [...] 
> > +static void at91_lpddr_poweroff(void)
> > +{
> > +	asm volatile(
> > +		/* Align to cache lines */
> > +		".balign 32\n\t"
> > +
> > +		/* Ensure AT91_SHDW_CR is in the TLB by reading it */
> > +		"	ldr	r6, [%2, #" __stringify(AT91_SHDW_CR) "]\n\t"
> 
> This clobbers r6...
> 
> > +		/* Power down SDRAM0 */
> > +		"	str	%1, [%0, #" __stringify(AT91_DDRSDRC_LPR) "]\n\t"
> > +		/* Shutdown CPU */
> > +		"	str	%3, [%2, #" __stringify(AT91_SHDW_CR) "]\n\t"
> > +
> > +		"	b	.\n\t"
> > +		:
> > +		: "r" (mpddrc_base),
> > +		  "r" cpu_to_le32(AT91_DDRSDRC_LPDDR2_PWOFF),
> > +		  "r" (at91_shdwc_base),
> > +		  "r" cpu_to_le32(AT91_SHDW_KEY | AT91_SHDW_SHDW)
> > +		: "r0");
> [...]
> 
> ...but the clobber list has r0.
> 

Indeed. However, It doesn't matter much as nothing can possibly run
afterwards.


-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.4 23/26] power: reset: at91-poweroff: timely shutdown LPDDR memories Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-04-06 11:40 +0200
  Re: [PATCH 4.4 23/26] power: reset: at91-poweroff: timely shutdown  LPDDR memories Ben Hutchings <ben.hutchings@codethink.co.uk> - 2017-04-06 19:50 +0200
    Re: [PATCH 4.4 23/26] power: reset: at91-poweroff: timely shutdown  LPDDR memories Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-04-06 20:20 +0200
      Re: [PATCH 4.4 23/26] power: reset: at91-poweroff: timely shutdown  LPDDR memories Ben Hutchings <ben.hutchings@codethink.co.uk> - 2017-04-06 20:30 +0200

csiph-web