From mboxrd@z Thu Jan 1 00:00:00 1970 From: Larry Finger Subject: Re: [PATCH] Fix problem with cpufreq_pndemand or cpufreq_conservative Date: Fri, 28 Dec 2012 18:53:20 -0600 Message-ID: <50DE3F00.70800@lwfinger.net> References: <50DE1A74.4040607@lwfinger.net> <3226192.H2BxHSuKio@vostro.rjw.lan> <50DE2F32.1010207@lwfinger.net> <20121229003341.GA30982@balto.lan> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Rq5Y3Jhe5bxUwi0LFwU32TpUOcnfU3eJAVnZHpYzUiQ=; b=xRYk5AYWaftPdXaWcve9z92G3MpvgSTdc0a/BhGfyXzqAFkcZz+mlGPQWNdn00a15b vvscHhIOeKfp8HQ4KgnA9sC52sZwVSB/slEcfJiwGj8QC99FzkNKGrdgvA0gwcTAwkZ0 kMHS3Sd0hFREwlGaSqWtkPNHtFjrRJGp+YPJPg0W/+GM4bIoeQKlzsuk5lWR69f/quBv Lml0UA12p+OFANdcWENlktrVV5Y6RNVc9PHh/4uvpjOrHM44m4fwIScq2Lvg4vRAK6SK ru1x4uiqJt75OHZCH/djidgy3zGR+c2aE5pSukxhmC49EVsLQbv6bkRFpjZ8JW5hIFYq wVrg== In-Reply-To: <20121229003341.GA30982@balto.lan> Sender: linux-pm-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Fabio Baltieri , "Rafael J. Wysocki" , viresh kumar , cpufreq@vger.kernel.org, Linux PM list , LKML On 12/28/2012 06:33 PM, Fabio Baltieri wrote: > On Fri, Dec 28, 2012 at 05:45:54PM -0600, Larry Finger wrote: >>> I wonder if that's avoidable? The intention is not to create an additional >>> module, clearly. >> >> It appears not to be possible. I don't know enough about to kmake to >> understand why it is forcing a new module. Perhaps some expert knows >> what Kconfig or Makefile magic will prevent that. > > kbuild is building an additional module just because the makefile is > adding the new objects in the obj-m list directly, as in: > > obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND) += cpufreq_ondemand.o cpufreq_governor.o > obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE) += cpufreq_conservative.o cpufreq_governor.o > > To build just two modules the Makefile would have to be modified [1] > into something into something like: > > obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND) += cpufreq_ondemand_mod.o > cpufreq_ondemand_mod-y := cpufreq_ondemand.o cpufreq_governor.o > obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE) += cpufreq_conservative_mod.o > cpufreq_conservative_mod-y := cpufreq_conservative.o cpufreq_governor.o > > so that only two .o are added to obj-m, but that's not correct either as > you end up with cpufreq_governor symbols exported twice. > > I think the only way would be to force cpufreq_governor as builtin with > an automatic Kconfig option. > > Fabio > > 1. http://lxr.linux.no/#linux+v3.7.1/Documentation/kbuild/makefiles.txt#L191 Fabio, Thanks for the explanation. Now I think I know how to do it. V3 follows. Larry