Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753536AbcKNOjf (ORCPT ); Mon, 14 Nov 2016 09:39:35 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:52527 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932414AbcKNOjd (ORCPT ); Mon, 14 Nov 2016 09:39:33 -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: Mon, 14 Nov 2016 15:37:44 +0100 Message-ID: <6787744.7DRFf7p3US@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20161114135018.GL1041@n2100.armlinux.org.uk> References: <1479099731-28108-1-git-send-email-pankaj.dubey@samsung.com> <2479429.Js1FDSdQzs@wuerfel> <20161114135018.GL1041@n2100.armlinux.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:/qETUVfY0jTsVXvjRVmHmOui6MUrXlgDPPlzT1xSYDY1lZommdE EFiNaSQfv0ST7vxlZaUwcg5tY0ogvb38z15LXN1I+qm73SmK8pEHTvW81L/EiNJ7aYFz6BM 8DuoP9RYYkTcb85Tq1WTWGKA2hIlQ8SRVm4bYn44cMeR1n+WeGb8n3zTmRpq1bT07HJu6ui 5J4mfOHOQ/yhfaeVNcRhA== X-UI-Out-Filterresults: notjunk:1;V01:K0:nVEiyK071wk=:Zdn4qDthCQIiq7LlbInoQ5 PGRITJLwG1jVBHQja9v9nQtbs/8uu/KIhnYPwwpZPZXYy8SpMRuvkQcs7laUuKFFHxX3gK6nV J8w5zKOD/ef1hgkF4vZZsiegzXWAmckvGmpWVWXSO0Oov94PuTUNvsO3MEcbdX6bI4P5L0u5J y8R7KOQJOoX3OyUdv583xpn/af88P6R9LM+qWYJ/ts1wA0iv8N4KBnsNkpdExTYJijjgZql+f AP4xKlXUEFpcf315XuVWHxxYRgLEy+PS1cweA2bOpXY16kXnRzNAcQPDN98uqKRIEB2t8RSEi TNHALnmustfyhn7UP9iiUSSdfME13IzY8ullxyDyTezlZdKNB4ihVIbeK3fJDQRbZoqrhhptU MTEonjsw6pwo+tAjK0wgPsEBjjZqRBYT+EH7n9he5qvQXEUv9jMckqsjTRyguhzM3W8kDmeWv oklaLVIWVumdOqnVZ7PrxWexkBkipnyr+Q+KwhOy4V/3fROv3FlkG4iBuZHaeuqUtVJzfi8k4 843fuAbiiO1rAPKBO2nETxCno1c+GrRuTBHFMn/zuTmn9YLlSKO2nnEeDr2tk5r9gu7PCG1gi qT8iVsmwIgFmLfgEO6+wJH2amahzzYwM4vnT/xMWY3V0ozujlxiAFjjWtf1bxywlxlzcDYt3L P9g8Q+ci62vSkDcZsUVP1SG+/OArkKuX0qJC+d4S5g4JXRmvkY3BpBA1XDyyXLwQgGP0QyHW2 jRscniZOoami8j2NHK5fna9rov/tbvL1kk3hTIU0dvwQpgeFAeODTLWpHM4= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1981 Lines: 44 On Monday, November 14, 2016 1:50:18 PM CET Russell King - ARM Linux wrote: > On Mon, Nov 14, 2016 at 01:03:09PM +0100, Arnd Bergmann wrote: > > On Monday, November 14, 2016 2:10:16 PM CET pankaj.dubey wrote: > > > >> + scu_base = of_iomap(np, 0); > > > >> + of_node_put(np); > > > >> + if (!scu_base) { > > > >> + pr_err("%s failed to map scu_base via DT\n", __func__); > > > > > > > > For non-ca5, non-ca9 based SoCs, we'll see this error msg. We understand > > > > what does it mean, but it may confuse normal users. In current version, > > > > berlin doesn't complain like this for non-ca9 SoCs > > > > > > > > > > OK, let me see other reviewer's comment on this. Then we will decide if > > > this error message is required or can be omitted. > > > > We need to look at all callers here, to see if the function ever gets > > called for a CPU that doesn't have an SCU. I'd say we should warn if > > we know there is an SCU but we cannot map it, but never warn on > > any of the CPU cores that don't support an SCU. > > Maybe there should be two helpers: > > of_scu_enable() which _only_ looks up the SCU address in DT and enables > it if it finds it, otherwise returning failure. > > a9_scu_enable() which tries to use the A9 provided SCU address and > enables it if it finds it, otherwise returning failure. > > Then callers can decide which of these to call, and what error messages > to print on their failures. Splitting the function in two is probably simpler overall, but we may still have to look at all the callers: Any platform that currently tries to map it on any CPU and doesn't warn about the absence of the device node (or about scu_a9_has_base() == false) should really continue not to warn about that. If all platforms only call these on SMP machines with an ARM11MPcore, Cortex-A5 or Cortex-A9, everything should be fine here, otherwise we can leave the warning in the caller after checking the return code of the new APIs. Arnd