From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Hilman Subject: Re: [pm-wip/cpufreq][PATCH 3/3] OMAP2+: cpufreq: do lateinit Date: Tue, 07 Jun 2011 14:49:40 -0700 Message-ID: <8762ohnwgb.fsf@ti.com> References: <1307412330-25798-1-git-send-email-nm@ti.com> <1307412330-25798-4-git-send-email-nm@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from na3sys009aog101.obsmtp.com ([74.125.149.67]:41188 "EHLO na3sys009aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757746Ab1FGVtn (ORCPT ); Tue, 7 Jun 2011 17:49:43 -0400 Received: by mail-pw0-f41.google.com with SMTP id 12so111574pwi.0 for ; Tue, 07 Jun 2011 14:49:42 -0700 (PDT) In-Reply-To: <1307412330-25798-4-git-send-email-nm@ti.com> (Nishanth Menon's message of "Mon, 6 Jun 2011 21:05:30 -0500") Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Nishanth Menon Cc: linux-omap Nishanth Menon writes: > Since we do module_init, cpufreq initializes before power late_init > where many of the required data structures are registered. What exactly are the dependencies here? The only thing I see is the dependency on omap2_get_mpuss_device(), and those devices should be created as a postcore_initcall. If there are other dependencies, they're probably created a side effect of your earlier patches where you moved stuff from the ->init hook (which happens much later) into the initcall function. Maybe that needs a rethink? > Move cpufreq init to late_initcall instead. Further CONFIG_CPU_FREQ on > which the build depends is bool and does'nt support modules yet. > > Signed-off-by: Nishanth Menon If this works, it's only because of the link order defined by the Makefile ordering since both are the same level of initcall. When I move this driver to drivers/cpufreq, then the link order is less obvious. Kevin > --- > arch/arm/mach-omap2/omap2plus-cpufreq.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c > index 2177381..07c2ab9 100644 > --- a/arch/arm/mach-omap2/omap2plus-cpufreq.c > +++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c > @@ -273,5 +273,5 @@ static void __exit omap_cpufreq_exit(void) > > MODULE_DESCRIPTION("cpufreq driver for OMAP2PLUS SOCs"); > MODULE_LICENSE("GPL"); > -module_init(omap_cpufreq_init); > +late_initcall(omap_cpufreq_init); > module_exit(omap_cpufreq_exit);