Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7836676ybl; Thu, 16 Jan 2020 06:26:41 -0800 (PST) X-Google-Smtp-Source: APXvYqyfnj9R9LCBan9hLE+7/wXN97bxGAXdEsf6wM7aQ3jehJuDPdY9WAYeEeW9CaEt2hd+x9qC X-Received: by 2002:a05:6830:10a:: with SMTP id i10mr2039578otp.365.1579184801567; Thu, 16 Jan 2020 06:26:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579184801; cv=none; d=google.com; s=arc-20160816; b=LIFvugo/mPtEbIS0GfdoGyJJbQrO0K3iMCwN81mZqg/oIPGdRvk3hMwY/L9hkCeIxC MRZdxLTIGWrtzP2UOscznmwag07hlHj1kZ94EURGVdYjZugsy8mC6Fa0I6VcQGJTa0Dj om1/m45UrwcmKWrnej+Clfyr45tOGlSrBzz8uBrQleImvageZY07wMmv2PVMrpdVfTjE Ja24dcXyfH9XtylCZCkYz6giPrCKg4kGXw0/LO5I+wohcLPeXMYW5Onk/Kod6RM5vS36 kDjroPtZ8DP6YfR6JINOh9vdxy2S5paMNLjirNkFy10RIxsNt+3urqlickVdaUjTTGA0 sOYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=E3kaplge1OfBiMnGyPiJlWGKEWKxe7cHluYTo7jID5w=; b=QZsY5PMrNGzWkkL/sy5/g1/wAAiVUVJ9z6YXekuF0VKdu86dOvQ487TwMLH0XV8eei dMEm0uin8EE0YqESkaCDLuUub9uK1ai1+suz8uqJ9IGe+HI8pikSbYcpi2wsOWFVDTY+ WeQF2qYjOU6+1VSonBlX9esUEpDLxu43R/sFt2vau3Xmmsq4UrWaxdkrIpj/GMzng2wt g2109YMz/qZY/742qA1s2puoC8WWhwiHgt80qWIl8sqptV0eidmohmlp2r+HBVSikx/h oFw1CZATULmA0sCX+qf8tETAPUXAAQc4/VxWVK3qQXrEnDKUBoMoSeBTO+RaxxPflmhN oR1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o83si12571106oib.44.2020.01.16.06.26.28; Thu, 16 Jan 2020 06:26:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726343AbgAPOZ1 (ORCPT + 99 others); Thu, 16 Jan 2020 09:25:27 -0500 Received: from magratgarlick.emantor.de ([78.46.208.201]:43864 "EHLO magratgarlick.emantor.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbgAPOZ1 (ORCPT ); Thu, 16 Jan 2020 09:25:27 -0500 X-Greylist: delayed 383 seconds by postgrey-1.27 at vger.kernel.org; Thu, 16 Jan 2020 09:25:26 EST Received: by magratgarlick.emantor.de (Postfix, from userid 114) id AAC28E7124; Thu, 16 Jan 2020 15:19:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on magratgarlick.emantor.de X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from localhost (unknown [IPv6:2a01:598:a087:a19a:907e:a13:431:7da5]) by magratgarlick.emantor.de (Postfix) with ESMTPSA id 441B6E7121; Thu, 16 Jan 2020 15:18:59 +0100 (CET) From: Rouven Czerwinski To: s.hauer@pengutronix.de, shawnguo@kernel.org Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, festevam@gmail.com, linux-imx@nxp.com, Ahmad Fatoum , Lucas Stach , Rouven Czerwinski Subject: [PATCH] ARM: imx: build v7_cpu_resume() unconditionally Date: Thu, 16 Jan 2020 15:18:49 +0100 Message-Id: <20200116141849.73955-1-r.czerwinski@pengutronix.de> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ahmad Fatoum This function is not only needed by the platform suspend code, but is also reused as the CPU resume function when the ARM cores can be powered down completely in deep idle, which is the case on i.MX6SX and i.MX6UL(L). Providing the static inline stub whenever CONFIG_SUSPEND is disabled means that those platforms will hang on resume from cpuidle if suspend is disabled. So there are two problems: - The static inline stub masks the linker error - The function is not available where needed Fix both by just building the function unconditionally, when CONFIG_SOC_IMX6 is enabled. The actual code is three instructions long, so it's arguably ok to just leave it in for all i.MX6 kernel configurations. Fixes: 05136f0897b5 ("ARM: imx: support arm power off in cpuidle for i.mx6sx") Signed-off-by: Lucas Stach Signed-off-by: Ahmad Fatoum Signed-off-by: Rouven Czerwinski --- arch/arm/mach-imx/Makefile | 2 ++ arch/arm/mach-imx/common.h | 4 ++-- arch/arm/mach-imx/resume-imx6.S | 24 ++++++++++++++++++++++++ arch/arm/mach-imx/suspend-imx6.S | 14 -------------- 4 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 arch/arm/mach-imx/resume-imx6.S diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 35ff620537e6..03506ce46149 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile @@ -91,6 +91,8 @@ AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a obj-$(CONFIG_SOC_IMX6) += suspend-imx6.o obj-$(CONFIG_SOC_IMX53) += suspend-imx53.o endif +AFLAGS_resume-imx6.o :=-Wa,-march=armv7-a +obj-$(CONFIG_SOC_IMX6) += resume-imx6.o obj-$(CONFIG_SOC_IMX6) += pm-imx6.o obj-$(CONFIG_SOC_IMX1) += mach-imx1.o diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 912aeceb4ff8..5aa5796cff0e 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -109,17 +109,17 @@ void imx_cpu_die(unsigned int cpu); int imx_cpu_kill(unsigned int cpu); #ifdef CONFIG_SUSPEND -void v7_cpu_resume(void); void imx53_suspend(void __iomem *ocram_vbase); extern const u32 imx53_suspend_sz; void imx6_suspend(void __iomem *ocram_vbase); #else -static inline void v7_cpu_resume(void) {} static inline void imx53_suspend(void __iomem *ocram_vbase) {} static const u32 imx53_suspend_sz; static inline void imx6_suspend(void __iomem *ocram_vbase) {} #endif +void v7_cpu_resume(void); + void imx6_pm_ccm_init(const char *ccm_compat); void imx6q_pm_init(void); void imx6dl_pm_init(void); diff --git a/arch/arm/mach-imx/resume-imx6.S b/arch/arm/mach-imx/resume-imx6.S new file mode 100644 index 000000000000..5bd1ba7ef15b --- /dev/null +++ b/arch/arm/mach-imx/resume-imx6.S @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright 2014 Freescale Semiconductor, Inc. + */ + +#include +#include +#include +#include +#include "hardware.h" + +/* + * The following code must assume it is running from physical address + * where absolute virtual addresses to the data section have to be + * turned into relative ones. + */ + +ENTRY(v7_cpu_resume) + bl v7_invalidate_l1 +#ifdef CONFIG_CACHE_L2X0 + bl l2c310_early_resume +#endif + b cpu_resume +ENDPROC(v7_cpu_resume) diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S index 062391ff13da..1eabf2d2834b 100644 --- a/arch/arm/mach-imx/suspend-imx6.S +++ b/arch/arm/mach-imx/suspend-imx6.S @@ -327,17 +327,3 @@ resume: ret lr ENDPROC(imx6_suspend) - -/* - * The following code must assume it is running from physical address - * where absolute virtual addresses to the data section have to be - * turned into relative ones. - */ - -ENTRY(v7_cpu_resume) - bl v7_invalidate_l1 -#ifdef CONFIG_CACHE_L2X0 - bl l2c310_early_resume -#endif - b cpu_resume -ENDPROC(v7_cpu_resume) -- 2.25.0