Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754214AbcJMLKe (ORCPT ); Thu, 13 Oct 2016 07:10:34 -0400 Received: from down.free-electrons.com ([37.187.137.238]:38929 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753878AbcJMLK0 (ORCPT ); Thu, 13 Oct 2016 07:10:26 -0400 Date: Thu, 13 Oct 2016 13:03:17 +0200 From: Alexandre Belloni To: Jean-Jacques Hiblot Cc: Sebastian Reichel , Dmitry Eremin-Solenikov , Nicolas Ferre , Linux Kernel Mailing List , "linux-arm-kernel@lists.infradead.org" , linux-pm@vger.kernel.org Subject: Re: [PATCH 2/2] power/reset: at91-poweroff: timely shitdown LPDDR memories Message-ID: <20161013110317.ee6by6njrvs53ztx@piout.net> References: <20161007163427.11454-1-alexandre.belloni@free-electrons.com> <20161007163427.11454-3-alexandre.belloni@free-electrons.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20160916 (1.7.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1022 Lines: 30 On 12/10/2016 at 14:48:27 +0200, Jean-Jacques Hiblot wrote : > > +static void at91_lpddr_poweroff(void) > > +{ > > + asm volatile( > > + /* Align to cache lines */ > > + ".balign 32\n\t" > > + > > + " ldr r6, [%2, #" __stringify(AT91_SHDW_CR) "]\n\t" > At first sight, it looks useless. I assume it's used to preload the > TLB before the LPDDR is turned off. > A comment to explain why this line is useful would prevent its removal. Yes, this is the case. I can add a comment. Anyway, I would prefer the whole thing to run from SRAM, as a PIE instead of relying on the cache. > > + ddr_type = readl(mpddrc_base + AT91_DDRSDRC_MDR) & AT91_DDRSDRC_MD; > > + if ((ddr_type == AT91_DDRSDRC_MD_LPDDR2) || > > + (ddr_type == AT91_DDRSDRC_MD_LPDDR3)) > Souldn't there be something like "pm_power_off = at91_lpddr_poweroff;" here ? > Indeed -- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com