From patchwork Mon Oct 31 09:52:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 9405197 X-Patchwork-Delegate: sboyd@codeaurora.org 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 99F8160234 for ; Mon, 31 Oct 2016 09:52:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BEED28F07 for ; Mon, 31 Oct 2016 09:52:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C4B529038; Mon, 31 Oct 2016 09:52:26 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 D1C4728F07 for ; Mon, 31 Oct 2016 09:52:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764277AbcJaJwZ (ORCPT ); Mon, 31 Oct 2016 05:52:25 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:38177 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764275AbcJaJwY (ORCPT ); Mon, 31 Oct 2016 05:52:24 -0400 Received: from penelope.kanocho.kobe.vergenet.net (unknown [217.111.208.18]) by kirsty.vergenet.net (Postfix) with ESMTPSA id A6B4B25B779; Mon, 31 Oct 2016 20:52:20 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1477907541; bh=P1tDmZ+3+ShAwyHyQJ8CGwfWPPyhLEySNbpeCF1iPeE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AKl3bA4cVOSYK6hRn17C4u0ag9vpIgSfEamTtZyRAa3LPZfAwybWS3+mrI0BbSV1l Zn6+wCOPIKt/ZwxlEWgb5xzS26TWSTwIuU90b5wCzZQkQJU6Olv9dWjQV2TQ0oL3It LXtcAVdYA8/YAjKWi0YF85QKgTPI7jkc6IgUeYbM= Received: by penelope.kanocho.kobe.vergenet.net (Postfix, from userid 7100) id 39098605BF; Mon, 31 Oct 2016 10:52:17 +0100 (CET) Date: Mon, 31 Oct 2016 10:52:17 +0100 From: Simon Horman To: Geert Uytterhoeven Cc: Arnd Bergmann , Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Laurent Pinchart , Magnus Damm , Sergei Shtylyov , Linux-Renesas , linux-clk , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] clk: fix link error for rcar-gen2 Message-ID: <20161031095214.GA2335@verge.net.au> References: <20161021154737.3803065-1-arnd@arndb.de> <3808786.t4RxxDciQu@wuerfel> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organisation: Horms Solutions BV User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Oct 31, 2016 at 10:23:00AM +0100, Geert Uytterhoeven wrote: > On Tue, Oct 25, 2016 at 10:37 AM, Geert Uytterhoeven > wrote: > > On Fri, Oct 21, 2016 at 11:07 PM, Arnd Bergmann wrote: > >> On Friday, October 21, 2016 8:01:49 PM CEST Geert Uytterhoeven wrote: > >>> > diff --git a/drivers/clk/renesas/Makefile b/drivers/clk/renesas/Makefile > >>> > index 90dd0db7d9c6..762d122eddec 100644 > >>> > --- a/drivers/clk/renesas/Makefile > >>> > +++ b/drivers/clk/renesas/Makefile > >>> > @@ -4,11 +4,7 @@ obj-$(CONFIG_ARCH_R8A73A4) += clk-r8a73a4.o clk-div6.o > >>> > obj-$(CONFIG_ARCH_R8A7740) += clk-r8a7740.o clk-div6.o > >>> > obj-$(CONFIG_ARCH_R8A7778) += clk-r8a7778.o > >>> > obj-$(CONFIG_ARCH_R8A7779) += clk-r8a7779.o > >>> > -obj-$(CONFIG_ARCH_R8A7790) += clk-rcar-gen2.o clk-div6.o > >>> > -obj-$(CONFIG_ARCH_R8A7791) += clk-rcar-gen2.o clk-div6.o > >>> > -obj-$(CONFIG_ARCH_R8A7792) += clk-rcar-gen2.o clk-div6.o > >>> > -obj-$(CONFIG_ARCH_R8A7793) += clk-rcar-gen2.o clk-div6.o > >>> > -obj-$(CONFIG_ARCH_R8A7794) += clk-rcar-gen2.o clk-div6.o > >>> > +obj-$(CONFIG_ARCH_RCAR_GEN2) += clk-rcar-gen2.o clk-div6.o > >>> > obj-$(CONFIG_ARCH_R8A7795) += r8a7795-cpg-mssr.o rcar-gen3-cpg.o > >>> > obj-$(CONFIG_ARCH_R8A7796) += r8a7796-cpg-mssr.o rcar-gen3-cpg.o > >>> > obj-$(CONFIG_ARCH_SH73A0) += clk-sh73a0.o clk-div6.o > >>> > >>> Please don't fix it this way, as it will make it _harder_ to convert the R-Car > >>> Gen2 SoCs to the modern CPG/MSSR driver later. > >> > >> Ok, I see. How about just adding another line for r8a7743 and > >> dropping that again after the timer_init has been converted? > > > > That's an option, but it touches a different subsystem ;-) > > Alternatively, the call to rcar_gen2_clocks_init() in > arch/arm/mach-shmobile/setup-rcar-gen2.c:rcar_gen2_timer_init() > can be protected temporarily by > > #if defined(CONFIG_R8A7790) || ... || defined(CONFIG_R8A7794) > > until "[PATCH v4 00/23] soc: renesas: Add R-Car RST driver for > obtaining mode pin state" went it, which will remove that call. I believe Geert has something like the following in mind. It makes sense to me as it should resolve the problem in question and although it is a work-around it should not be in place for long as the patchset mentioned immediately above would remove it. From: Simon Horman Subject: [PATCH] ARM: shmobile: only call rcar_gen2_clocks_init() if present The RZ/G1M (r8a7743) uses the R-Car Gen2 core, but not the R-Car Gen2 clock driver. This is a harbinger of a transition for R-Car Gen2 SoCs. As the process to get all the required pieces in place is somewhat complex it seems useful to try to disentangle dependencies where possible. The approach here is to temporarily disable calling rcar_gen2_clocks_init() if no R-Car Gen2 SoC are configured and thus the symbol will not be present. Fixes: 1254f607fc3d ("ARM: shmobile: r8a7743: basic SoC support") Signed-off-by: Simon Horman Acked-by: Geert Uytterhoeven --- The current likely path to removing need for this is for "[PATCH v4 00/23] soc: renesas: Add R-Car RST driver for obtaining mode pin state" to be accepted. In particular patch 20 removes the call to rcar_gen2_clocks_init() in rcar_gen2_timer_init(). --- arch/arm/mach-shmobile/setup-rcar-gen2.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c index 875bcb8c1026..657262556dc4 100644 --- a/arch/arm/mach-shmobile/setup-rcar-gen2.c +++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c @@ -131,7 +131,13 @@ void __init rcar_gen2_timer_init(void) iounmap(base); #endif /* CONFIG_ARM_ARCH_TIMER */ - rcar_gen2_clocks_init(mode); + if (IS_ENABLED(CONFIG_ARCH_R8A7790) || + IS_ENABLED(CONFIG_ARCH_R8A7791) || + IS_ENABLED(CONFIG_ARCH_R8A7792) || + IS_ENABLED(CONFIG_ARCH_R8A7793) || + IS_ENABLED(CONFIG_ARCH_R8A7794)) + rcar_gen2_clocks_init(mode); + clocksource_probe(); }