From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D475C54FCB for ; Thu, 23 Apr 2020 13:45:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5091420728 for ; Thu, 23 Apr 2020 13:45:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728001AbgDWNpk (ORCPT ); Thu, 23 Apr 2020 09:45:40 -0400 Received: from foss.arm.com ([217.140.110.172]:40142 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727898AbgDWNpk (ORCPT ); Thu, 23 Apr 2020 09:45:40 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0C68431B; Thu, 23 Apr 2020 06:45:39 -0700 (PDT) Received: from bogus (unknown [10.37.12.118]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 72B2E3F6CF; Thu, 23 Apr 2020 06:45:35 -0700 (PDT) Date: Thu, 23 Apr 2020 14:45:28 +0100 From: Sudeep Holla To: Rob Herring Cc: Linus Walleij , Liviu Dudau , Lorenzo Pieralisi , Arnd Bergmann , Catalin Marinas , Greg Kroah-Hartman , Lee Jones , Sebastian Reichel , Stephen Boyd , Will Deacon , Sudeep Holla , Kevin Brodsky , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, Michael Turquette Subject: Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module Message-ID: <20200423133342.GA10628@bogus> References: <20200419170810.5738-1-robh@kernel.org> <20200419170810.5738-9-robh@kernel.org> <20200422210802.GH25585@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200422210802.GH25585@bogus> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org On Wed, Apr 22, 2020 at 10:08:02PM +0100, Sudeep Holla wrote: > On Sun, Apr 19, 2020 at 12:08:01PM -0500, Rob Herring wrote: > > Enable building the vexpress-osc clock driver as a module. > > > > Cc: Linus Walleij > > Cc: Liviu Dudau > > Cc: Sudeep Holla > > Cc: Lorenzo Pieralisi > > Cc: Michael Turquette > > Cc: Stephen Boyd > > Cc: linux-clk@vger.kernel.org > > Signed-off-by: Rob Herring > > --- > > drivers/clk/versatile/Kconfig | 4 ++-- > > drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------ > > 2 files changed, 6 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig > > index 5bdd5c98990b..9de2396dcf9b 100644 > > --- a/drivers/clk/versatile/Kconfig > > +++ b/drivers/clk/versatile/Kconfig > > @@ -15,8 +15,8 @@ config CLK_SP810 > > of the ARM SP810 System Controller cell. > > > > config CLK_VEXPRESS_OSC > > - bool "Clock driver for Versatile Express OSC clock generators" > > - depends on VEXPRESS_CONFIG || COMPILE_TEST > > + tristate "Clock driver for Versatile Express OSC clock generators" > > + depends on VEXPRESS_CONFIG > > default y if ARCH_VEXPRESS > > ---help--- > > Simple regmap-based driver driving clock generators on Versatile > > diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c > > index 5bb1d5a714d0..b2b32fa2d7c3 100644 > > --- a/drivers/clk/versatile/clk-vexpress-osc.c > > +++ b/drivers/clk/versatile/clk-vexpress-osc.c > > @@ -7,6 +7,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = { > > { .compatible = "arm,vexpress-osc", }, > > {} > > }; > > +MODULE_DEVICE_TABLE(of, vexpress_osc_of_match); > > > > static struct platform_driver vexpress_osc_driver = { > > .driver = { > > @@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = { > > }, > > .probe = vexpress_osc_probe, > > }; > > - > > -static int __init vexpress_osc_init(void) > > -{ > > - return platform_driver_register(&vexpress_osc_driver); > > -} > > -core_initcall(vexpress_osc_init); > > +module_platform_driver(vexpress_osc_driver); > > I am not 100% sure of this. This might break the boot on CA9 and TC2 > at-least. There are loads of MB peripherals that need this. This will > break the boot. We need to check if all the dependent modules are also > at module_initcall level and if they deal with deferred probe correctly. > Lot of them are legacy and may happen to be working by carefully initcall > level adjustments. > OK I managed to try this on my TC2 and it fails to boot. However when I enable earlyprintk as I see no log without it, it boots just fine. I also checked adding initcall_debug and I may be wrong on the dependency part. The modules dependent on vexpress-osc are probed later correctly. This make it more difficult to debug as I don't have any debugger attached at the moment to look at the logbuf when it hangs without earlyprintk. -- Regards, Sudeep From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C125C54FCB for ; Thu, 23 Apr 2020 13:45:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3BDC620728 for ; Thu, 23 Apr 2020 13:45:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ExQzVWC4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BDC620728 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2YchznQRb72i/ndeN6vPJ/9/cDiACyufcbR1ArHXyog=; b=ExQzVWC4UyYpPv OPhDSXZaWz+o4lLBpcqTk4nVYoZVX09/UP9/Yrp5J9uA3yK+rgsqMSrJPXqa+uNAtTFY+h2TCli+q QpAWk3y98eR/RcrMB+RWUE+xiPO+f0en68jX/Do2n3jE85UH9gManQHufnl0u9pR9XvOGA77ikI0F Z3reMDj79rVeLixV4oZZk9OM0ZMBjGALyLnfUkm7LNAYuhWYnEc5iIFfpD5HXj/pb+qXRTEmd7wVN hi0DEHMfsuAmSqp88D+/nPpDh7gfNhfavQZ8KJE2VSJUZx+Zi2pta3fYB3YiQ6rgRUX6gnUrGki7N VsLSVbkYbMvQeXgXlZlg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRcAj-0004xy-Lq; Thu, 23 Apr 2020 13:45:45 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRcAg-0004wJ-1F for linux-arm-kernel@lists.infradead.org; Thu, 23 Apr 2020 13:45:43 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0C68431B; Thu, 23 Apr 2020 06:45:39 -0700 (PDT) Received: from bogus (unknown [10.37.12.118]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 72B2E3F6CF; Thu, 23 Apr 2020 06:45:35 -0700 (PDT) Date: Thu, 23 Apr 2020 14:45:28 +0100 From: Sudeep Holla To: Rob Herring Subject: Re: [PATCH 08/17] clk: vexpress-osc: Support building as a module Message-ID: <20200423133342.GA10628@bogus> References: <20200419170810.5738-1-robh@kernel.org> <20200419170810.5738-9-robh@kernel.org> <20200422210802.GH25585@bogus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200422210802.GH25585@bogus> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200423_064542_161748_4E26D29B X-CRM114-Status: GOOD ( 21.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Arnd Bergmann , linux-pm@vger.kernel.org, Stephen Boyd , Catalin Marinas , Linus Walleij , Sudeep Holla , Liviu Dudau , Sebastian Reichel , Kevin Brodsky , Michael Turquette , Will Deacon , Greg Kroah-Hartman , Lee Jones , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 22, 2020 at 10:08:02PM +0100, Sudeep Holla wrote: > On Sun, Apr 19, 2020 at 12:08:01PM -0500, Rob Herring wrote: > > Enable building the vexpress-osc clock driver as a module. > > > > Cc: Linus Walleij > > Cc: Liviu Dudau > > Cc: Sudeep Holla > > Cc: Lorenzo Pieralisi > > Cc: Michael Turquette > > Cc: Stephen Boyd > > Cc: linux-clk@vger.kernel.org > > Signed-off-by: Rob Herring > > --- > > drivers/clk/versatile/Kconfig | 4 ++-- > > drivers/clk/versatile/clk-vexpress-osc.c | 10 ++++------ > > 2 files changed, 6 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig > > index 5bdd5c98990b..9de2396dcf9b 100644 > > --- a/drivers/clk/versatile/Kconfig > > +++ b/drivers/clk/versatile/Kconfig > > @@ -15,8 +15,8 @@ config CLK_SP810 > > of the ARM SP810 System Controller cell. > > > > config CLK_VEXPRESS_OSC > > - bool "Clock driver for Versatile Express OSC clock generators" > > - depends on VEXPRESS_CONFIG || COMPILE_TEST > > + tristate "Clock driver for Versatile Express OSC clock generators" > > + depends on VEXPRESS_CONFIG > > default y if ARCH_VEXPRESS > > ---help--- > > Simple regmap-based driver driving clock generators on Versatile > > diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c > > index 5bb1d5a714d0..b2b32fa2d7c3 100644 > > --- a/drivers/clk/versatile/clk-vexpress-osc.c > > +++ b/drivers/clk/versatile/clk-vexpress-osc.c > > @@ -7,6 +7,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -108,6 +109,7 @@ static const struct of_device_id vexpress_osc_of_match[] = { > > { .compatible = "arm,vexpress-osc", }, > > {} > > }; > > +MODULE_DEVICE_TABLE(of, vexpress_osc_of_match); > > > > static struct platform_driver vexpress_osc_driver = { > > .driver = { > > @@ -116,9 +118,5 @@ static struct platform_driver vexpress_osc_driver = { > > }, > > .probe = vexpress_osc_probe, > > }; > > - > > -static int __init vexpress_osc_init(void) > > -{ > > - return platform_driver_register(&vexpress_osc_driver); > > -} > > -core_initcall(vexpress_osc_init); > > +module_platform_driver(vexpress_osc_driver); > > I am not 100% sure of this. This might break the boot on CA9 and TC2 > at-least. There are loads of MB peripherals that need this. This will > break the boot. We need to check if all the dependent modules are also > at module_initcall level and if they deal with deferred probe correctly. > Lot of them are legacy and may happen to be working by carefully initcall > level adjustments. > OK I managed to try this on my TC2 and it fails to boot. However when I enable earlyprintk as I see no log without it, it boots just fine. I also checked adding initcall_debug and I may be wrong on the dependency part. The modules dependent on vexpress-osc are probed later correctly. This make it more difficult to debug as I don't have any debugger attached at the moment to look at the logbuf when it hangs without earlyprintk. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel