From patchwork Thu Jun 16 10:27:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 9180415 X-Patchwork-Delegate: horms@verge.net.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 14D0F6088F for ; Thu, 16 Jun 2016 10:27:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07FD5282EE for ; Thu, 16 Jun 2016 10:27:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1108282FF; Thu, 16 Jun 2016 10:27:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 788C0282EE for ; Thu, 16 Jun 2016 10:27:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753915AbcFPK1w (ORCPT ); Thu, 16 Jun 2016 06:27:52 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:38297 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752659AbcFPK1t (ORCPT ); Thu, 16 Jun 2016 06:27:49 -0400 Received: from ayla.of.borg ([84.195.107.21]) by xavier.telenet-ops.be with bizsmtp id 7NTm1t00B0TjorY01NTmY9; Thu, 16 Jun 2016 12:27:48 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1bDUWY-0003bE-7G; Thu, 16 Jun 2016 12:27:46 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1bDUWY-0007JX-F7; Thu, 16 Jun 2016 12:27:46 +0200 From: Geert Uytterhoeven To: Simon Horman , Magnus Damm Cc: Mark Rutland , Lorenzo Pieralisi , Keita Kobayashi , Laurent Pinchart , Sergei Shtylyov , linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Magnus Damm , Geert Uytterhoeven Subject: [PATCH v4 08/13] ARM: shmobile: smp: Add function to prioritize DT SMP Date: Thu, 16 Jun 2016 12:27:37 +0200 Message-Id: <1466072862-28030-9-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466072862-28030-1-git-send-email-geert+renesas@glider.be> References: <1466072862-28030-1-git-send-email-geert+renesas@glider.be> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Add a function to check if other DT based method is available, and if so return false to not hook up smp_ops from the machine vector. This results in that DT-based SMP support has priority over older C-based smp_ops code, and in case DT-based SMP support code does not exist in the DTB then the old smp_ops code will still work as-is. Signed-off-by: Magnus Damm Signed-off-by: Geert Uytterhoeven --- v4: - Remove empty line at end of file, v3: - No changes, v2: - Rework r8a7791-specific version to become reusable function. --- arch/arm/mach-shmobile/common.h | 1 + arch/arm/mach-shmobile/platsmp.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h index 3b562d87826d7410..1a8f7b3ab449db56 100644 --- a/arch/arm/mach-shmobile/common.h +++ b/arch/arm/mach-shmobile/common.h @@ -10,6 +10,7 @@ extern void shmobile_smp_sleep(void); extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn, unsigned long arg); extern bool shmobile_smp_cpu_can_disable(unsigned int cpu); +extern bool shmobile_smp_init_fallback_ops(void); extern void shmobile_boot_scu(void); extern void shmobile_smp_scu_prepare_cpus(phys_addr_t scu_base_phys, unsigned int max_cpus); diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c index b23378f3d7e1726b..f3dba6f356e29446 100644 --- a/arch/arm/mach-shmobile/platsmp.c +++ b/arch/arm/mach-shmobile/platsmp.c @@ -36,3 +36,9 @@ bool shmobile_smp_cpu_can_disable(unsigned int cpu) return true; /* Hotplug of any CPU is supported */ } #endif + +bool __init shmobile_smp_init_fallback_ops(void) +{ + /* fallback on PSCI/smp_ops if no other DT based method is detected */ + return platform_can_secondary_boot() ? true : false; +}