From patchwork Wed Jul 31 07:08:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2836125 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9B35C9F9C8 for ; Wed, 31 Jul 2013 07:23:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B364820145 for ; Wed, 31 Jul 2013 07:23:28 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE9BD2011D for ; Wed, 31 Jul 2013 07:23:27 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V4QXA-0007hV-T6; Wed, 31 Jul 2013 07:09:23 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V4QWW-0005LA-Bm; Wed, 31 Jul 2013 07:08:40 +0000 Received: from mail-pb0-x232.google.com ([2607:f8b0:400e:c01::232]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V4QWC-0005I0-H6 for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2013 07:08:21 +0000 Received: by mail-pb0-f50.google.com with SMTP id uo5so419659pbc.37 for ; Wed, 31 Jul 2013 00:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=f+e1vAZkmuae80AjCaeIj9NhNeBm61cYFWeyiLM0hss=; b=Gq9l0sDo6hKJgT+67O1nkcktASd21LFqxJctX4xY3Ja4qHyoMY6ysf2M7d1M3V4+nO xCrmU6n6K+m/WPVZhUlvOfIRMkzuUm+dDJ8I23Y2fvKshefjAqjhVhWKDKG/x8YBqT6y /Jih+wJ5WgCi3UQrBan4klKhQs46eCJfqGTb6ZLlVJcxkqjisjX7yJaz8vPORhZfvAon KwzHqir7WGl+//ODRi8/HGWtN5CXU2Js6XD45Y/dmNsVEEcKGlwTb7A+6/wwQQBIqNSP GCtj+DCWyCa5hYdyyTHdP6aXIurB8SMaCnzsrgvWihe8sBOemhHwsM0QE8IRVXp+Zove nMeQ== X-Received: by 10.66.145.4 with SMTP id sq4mr78971739pab.46.1375254479070; Wed, 31 Jul 2013 00:07:59 -0700 (PDT) Received: from [127.0.0.1] (ac230065.ppp.asahi-net.or.jp. [183.77.230.65]) by mx.google.com with ESMTPSA id yk10sm2635231pac.16.2013.07.31.00.07.56 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 31 Jul 2013 00:07:58 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Wed, 31 Jul 2013 16:08:09 +0900 Message-Id: <20130731070809.14444.98907.sendpatchset@w520> In-Reply-To: <20130731070702.14444.64961.sendpatchset@w520> References: <20130731070702.14444.64961.sendpatchset@w520> Subject: [PATCH 07/07] ARM: shmobile: Use shared SCU CPU Hotplug code on r8a7779 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130731_030820_663719_77E0AB4E X-CRM114-Status: GOOD ( 12.58 ) X-Spam-Score: -2.0 (--) Cc: arnd@arndb.de, Magnus Damm , horms@verge.net.au, ulrich.hecht@gmail.com, olof@lixom.net, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Update the r8a7779 specific CPU Hotplug code to make use of the recently introduced shared SCU functions. The r8a7779 power domain hardware requires special power down handling at ->kill() time. Signed-off-by: Magnus Damm --- arch/arm/mach-shmobile/smp-r8a7779.c | 41 +++------------------------------- 1 file changed, 4 insertions(+), 37 deletions(-) --- 0004/arch/arm/mach-shmobile/smp-r8a7779.c +++ work/arch/arm/mach-shmobile/smp-r8a7779.c 2013-07-31 12:12:26.000000000 +0900 @@ -122,47 +122,14 @@ static void __init r8a7779_smp_prepare_c } #ifdef CONFIG_HOTPLUG_CPU -static int r8a7779_scu_psr_core_disabled(int cpu) -{ - unsigned long mask = 3 << (cpu * 8); - - if ((__raw_readl(shmobile_scu_base + 8) & mask) == mask) - return 1; - - return 0; -} - static int r8a7779_cpu_kill(unsigned int cpu) { - int k; - - /* this function is running on another CPU than the offline target, - * here we need wait for shutdown code in platform_cpu_die() to - * finish before asking SoC-specific code to power off the CPU core. - */ - for (k = 0; k < 1000; k++) { - if (r8a7779_scu_psr_core_disabled(cpu)) - return r8a7779_platform_cpu_kill(cpu); - - mdelay(1); - } + if (shmobile_smp_scu_cpu_kill(cpu)) + return r8a7779_platform_cpu_kill(cpu); return 0; } -static void r8a7779_cpu_die(unsigned int cpu) -{ - dsb(); - flush_cache_all(); - - /* disable cache coherency */ - scu_power_mode(shmobile_scu_base, SCU_PM_POWEROFF); - - /* Endless loop until power off from r8a7779_cpu_kill() */ - while (1) - cpu_do_idle(); -} - static int r8a7779_cpu_disable(unsigned int cpu) { /* only CPU1->3 have power domains, do not allow hotplug of CPU0 */ @@ -174,8 +141,8 @@ struct smp_operations r8a7779_smp_ops _ .smp_prepare_cpus = r8a7779_smp_prepare_cpus, .smp_boot_secondary = r8a7779_boot_secondary, #ifdef CONFIG_HOTPLUG_CPU - .cpu_kill = r8a7779_cpu_kill, - .cpu_die = r8a7779_cpu_die, .cpu_disable = r8a7779_cpu_disable, + .cpu_die = shmobile_smp_scu_cpu_die, + .cpu_kill = r8a7779_cpu_kill, #endif };