From patchwork Fri Feb 21 18:09:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 11397097 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CAACC92A for ; Fri, 21 Feb 2020 18:09:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B36A62465D for ; Fri, 21 Feb 2020 18:09:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726150AbgBUSJJ (ORCPT ); Fri, 21 Feb 2020 13:09:09 -0500 Received: from muru.com ([72.249.23.125]:56804 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbgBUSJJ (ORCPT ); Fri, 21 Feb 2020 13:09:09 -0500 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 72836807E; Fri, 21 Feb 2020 18:09:52 +0000 (UTC) From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, kbuild test robot , Aaro Koskinen , "Andrew F . Davis" , Arnd Bergmann , Catalin Marinas , Marc Zyngier , Rob Herring , Russell King , Steven Price , Will Deacon Subject: [PATCH] ARM: OMAP2+: Fix compile if CONFIG_HAVE_ARM_SMCCC is not set Date: Fri, 21 Feb 2020 10:09:01 -0800 Message-Id: <20200221180901.15812-1-tony@atomide.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Recent omap changes added runtime checks to use omap_smccc_smc() when optee is configured in dts. As the omap-secure code can be built for ARMv6 only without ARMv7 and use custom smc calls, we now get a build error: omap-secure.c:(.text+0x94): undefined reference to `__arm_smccc_smc' Let's just ifdef out omap_smccc_smc() unless the CPU has selected CONFIG_HAVE_ARM_SMCCC. The other option discussed was to add an inline function to arm-smccc.h, but we'd still also have to add ifdef around omap_smccc_smc() to avoid a warning for uninitialized value for struct arm_smccc_res in omap_smccc_smc(). And we probably should not start initializing values in arm-smccc.h if disabled. Let's also warn on trying to use omap_smccc_smc() if disabled as suggested by Andrew F. Davis . Fixes: 48840e16c299 ("ARM: OMAP2+: Use ARM SMC Calling Convention when OP-TEE is available") Reported-by: kbuild test robot Cc: Aaro Koskinen Cc: Andrew F. Davis Cc: Arnd Bergmann Cc: Catalin Marinas Cc: Marc Zyngier Cc: Rob Herring Cc: Russell King Cc: Steven Price Cc: Will Deacon Signed-off-by: Tony Lindgren Acked-by: Andrew F. Davis --- arch/arm/mach-omap2/omap-secure.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c --- a/arch/arm/mach-omap2/omap-secure.c +++ b/arch/arm/mach-omap2/omap-secure.c @@ -77,6 +77,7 @@ u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs, u32 arg1, u32 arg2, return ret; } +#ifdef CONFIG_HAVE_ARM_SMCCC void omap_smccc_smc(u32 fn, u32 arg) { struct arm_smccc_res res; @@ -85,6 +86,12 @@ void omap_smccc_smc(u32 fn, u32 arg) 0, 0, 0, 0, 0, 0, &res); WARN(res.a0, "Secure function call 0x%08x failed\n", fn); } +#else +void omap_smccc_smc(u32 fn, u32 arg) +{ + WARN_ONCE(1, "smccc is disabled\n"); +} +#endif void omap_smc1(u32 fn, u32 arg) {