Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754029AbcKRNeH (ORCPT ); Fri, 18 Nov 2016 08:34:07 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:52233 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752123AbcKRNeB (ORCPT ); Fri, 18 Nov 2016 08:34:01 -0500 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Russell King - ARM Linux , Andrew Lunn , Heiko Stuebner , geert+renesas@glider.be, Linus Walleij , Liviu Dudau , Patrice Chotard , Wei Xu , Jisheng Zhang , "pankaj.dubey" , magnus.damm@gmail.com, Michal Simek , krzk@kernel.org, thomas.ab@samsung.com, "cpgs ." , Stephen Warren , Ray Jui , horms@verge.net.au, Jun Nie , shiraz.linux.kernel@gmail.com, linux-kernel@vger.kernel.org, vireshk@kernel.org, Dinh Nguyen , Shawn Guo Subject: Re: [PATCH 01/16] ARM: scu: Provide support for parsing SCU device node to enable SCU Date: Fri, 18 Nov 2016 14:32:30 +0100 Message-ID: <2339821.zs8sl71mMv@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20161118124805.GJ1041@n2100.armlinux.org.uk> References: <1479099731-28108-1-git-send-email-pankaj.dubey@samsung.com> <9481995.AMBiYg893F@wuerfel> <20161118124805.GJ1041@n2100.armlinux.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:b1auyPV0/dLwuXt+RqDKSCo46aQ3zKPAawS3wtiR6SPHoVT5zg1 nfkxFf3PM/5+xtcqyZ8YlBDkw/wO+JfspvpdjdVrO98X0rKy5RekLEX092fs4St1RR+qAfR y1/8ZalqV+ZQNpEyhzm0vh5oU4WzM81jm9jxxqtNiihGnTWbDHS55jQ55vqrJ6qcQ94sc/t dWbgmc1ToX1zOA1uux/5A== X-UI-Out-Filterresults: notjunk:1;V01:K0:Kjj8Z5whyTE=:hh3kI+MqEkqXp/lZF9QDPH w6c99aZLexuF1kdhTZDbLybPj5CbESH03f57iiFnYw3p0DkxOO6rOMqn4gGJM1ZoJtfAUbeoD LOSwcgRk/t95voRAKlJZGq/aH052mGzLY5b35cPvzS21ST67mUK3EFoWEFI0iIxf3PnsilEIT uKVzEtxlc768YU5G5Syknt2I4ctszPgYKB0Lmz9yNhJTUqHtK6fMp3l4v8vSDWxHbqx1NSxFs NeQghCmyunEW6XqHA43bUTlfjDvUMiIf2ZCZv0ohW03RBdLYdgrlHI+0hHtumHj+aM4Erp7zS SP7g5hJvWJo8D5TL+85epqRlcs7VvYxUb+3GPweCbgtErOz69vcl1ERmlnDYg2set5dt9oHHA hBXt/2x3GNWYdljdFB4n2xZ+pOBt64PE4jqWtIkfBDzq777Yhc0AXjNcFn1r1HZNfI4y/Jqqk lXD7OGGuu33Fj/+SzRAyvQM0e9RDF+O6UeNZN4fVdm01r16/1i1/bbIhxqYrFEY0X3U535ZBu OHDwv5HCJabEjfaLdZaUsGuyfBQxCDPFBzERLAx7BaNNz0RhL1bCGs3BiCDn7OSr+F/G+mx18 PDRXQWWnZ+gGrnAUEDOCz18ClU/pB/xdHMqY3f5WuCXZBs+T+LsbSni1y6xdWrLrJa8M0rQo4 F2KmDZI+FAPzVn40CyoJxfVU2Al43sw3WRXCbsTnAADcd8ZqmCcR+xqlVWFMxeg1lyt4iTTCZ PLKPG2P3B7Knju4p Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1475 Lines: 43 On Friday, November 18, 2016 12:48:07 PM CET Russell King - ARM Linux wrote: > On Fri, Nov 18, 2016 at 01:14:35PM +0100, Arnd Bergmann wrote: > > @@ -41,6 +43,9 @@ void scu_enable(void __iomem *scu_base) > > { > > u32 scu_ctrl; > > > > + if (scu_base) > > + scu_base = scu_base_addr; > > + > > This looks to me like nonsense. > > > #ifdef CONFIG_ARM_ERRATA_764369 > > /* Cortex-A9 only */ > > if ((read_cpuid_id() & 0xff0ffff0) == 0x410fc090) { > > @@ -85,6 +90,9 @@ int scu_power_mode(void __iomem *scu_base, unsigned int mode) > > unsigned int val; > > int cpu = MPIDR_AFFINITY_LEVEL(cpu_logical_map(smp_processor_id()), 0); > > > > + if (scu_base) > > + scu_base = scu_base_addr; > > + > > Ditto. > > Rather than doing this, I'd much prefer to always store the SCU base in > the SCU code, and remove the "void __iomem *scu_base" argment from all > these functions. Ok, then we just need one scu_probe_*() variant for each of the four methods of initializing it (iotable, of_iomap, ioremap(scu_a9_get_base) and hardcoded. The intention of doing the fallback for the NULL argument was to avoid having to add lots of new API while also allowing the change to be done one platform at a time. If we remove the argument from the other functions, they either need to get a new name, or we change them all to the new prototype at once. Either way works fine, do you have a preference between them? Arnd