Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755055AbcKNI5m (ORCPT ); Mon, 14 Nov 2016 03:57:42 -0500 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:58420 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753781AbcKNI43 (ORCPT ); Mon, 14 Nov 2016 03:56:29 -0500 Date: Mon, 14 Nov 2016 16:51:34 +0800 From: Jisheng Zhang To: Pankaj Dubey CC: , , , , , , , , , , , Sebastian Hesselbarth Subject: Re: [PATCH 03/16] ARM: berlin: use generic API for enabling SCU Message-ID: <20161114165134.411ae04b@xhacker> In-Reply-To: <1479099731-28108-4-git-send-email-pankaj.dubey@samsung.com> References: <1479099731-28108-1-git-send-email-pankaj.dubey@samsung.com> <1479099731-28108-4-git-send-email-pankaj.dubey@samsung.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-14_03:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611140180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1786 Lines: 62 Hi Pankaj, On Mon, 14 Nov 2016 10:31:58 +0530 Pankaj Dubey wrote: > Now as we have of_scu_enable which takes care of mapping > scu base from DT, lets use it. > > CC: Jisheng Zhang > CC: Sebastian Hesselbarth > Signed-off-by: Pankaj Dubey > --- > arch/arm/mach-berlin/platsmp.c | 17 +++++------------ > 1 file changed, 5 insertions(+), 12 deletions(-) > > diff --git a/arch/arm/mach-berlin/platsmp.c b/arch/arm/mach-berlin/platsmp.c > index 93f9068..25a6ca5 100644 > --- a/arch/arm/mach-berlin/platsmp.c > +++ b/arch/arm/mach-berlin/platsmp.c > @@ -60,26 +60,21 @@ static int berlin_boot_secondary(unsigned int cpu, struct task_struct *idle) > static void __init berlin_smp_prepare_cpus(unsigned int max_cpus) > { > struct device_node *np; > - void __iomem *scu_base; > void __iomem *vectors_base; > > - np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); > - scu_base = of_iomap(np, 0); > - of_node_put(np); > - if (!scu_base) > - return; > - > np = of_find_compatible_node(NULL, NULL, "marvell,berlin-cpu-ctrl"); > cpu_ctrl = of_iomap(np, 0); > of_node_put(np); > if (!cpu_ctrl) > - goto unmap_scu; > + return; > > vectors_base = ioremap(CONFIG_VECTORS_BASE, SZ_32K); > if (!vectors_base) > - goto unmap_scu; > + return; > + > + if (of_scu_enable()) In err code path, we need to unmap vectors_base before return > + return; > > - scu_enable(scu_base); > flush_cache_all(); > > /* > @@ -95,8 +90,6 @@ static void __init berlin_smp_prepare_cpus(unsigned int max_cpus) > writel(virt_to_phys(secondary_startup), vectors_base + SW_RESET_ADDR); > > iounmap(vectors_base); > -unmap_scu: > - iounmap(scu_base); > } > > #ifdef CONFIG_HOTPLUG_CPU