From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/3] cpufreq: kirkwood: Add a cpufreq driver for Marvell Kirkwood SoCs
Date: Sun, 27 Jan 2013 17:25:23 +0100 [thread overview]
Message-ID: <20130127162523.GK29973@lunn.ch> (raw)
In-Reply-To: <CAKohpomQJfsWBY5o3ep4r86fYYQ39JnMPswjoe8YFT37ekM20w@mail.gmail.com>
On Sun, Jan 27, 2013 at 09:33:04PM +0530, Viresh Kumar wrote:
> On 27 January 2013 21:12, Andrew Lunn <andrew@lunn.ch> wrote:
> > And how would the module get loaded? There is no hardware anchor to
> > make the module load. No enumeration of some bus causing it to be
> > loaded. In the ARM world, platform drivers are the norm.
>
> The way you do it now is by creating a platform device for it in your
> arch/arm/mach-* directory. And you are passing an IOMEM resource too.
>
> I believe, normally we don't require any DT node or platform device from
> arch/arm/mach-* for cpufreq drivers. This is something which should
> always be initialized once it is selected in .config.
What current happens is that most of the drivers use a late_initcall():
linux/drivers/cpufreq$ grep late_initcall *
acpi-cpufreq.c:late_initcall(acpi_cpufreq_init);
cpufreq-cpu0.c:late_initcall(cpu0_cpufreq_driver_init);
exynos-cpufreq.c:late_initcall(exynos_cpufreq_init);
longhaul.c:late_initcall(longhaul_init);
p4-clockmod.c:late_initcall(cpufreq_p4_init);
pcc-cpufreq.c:late_initcall(pcc_cpufreq_init);
powernow-k7.c:late_initcall(powernow_init);
powernow-k8.c:late_initcall(powernowk8_init);
s5pv210-cpufreq.c:late_initcall(s5pv210_cpufreq_init);
spear-cpufreq.c:late_initcall(spear_cpufreq_driver_init);
speedstep-centrino.c:late_initcall(centrino_init);
So when we have a multiplatform kernel with many of these drivers
built in, all but one are going to notice they are not on the hardware
they support, and return -ENODEV.
By making it a platform driver, the kirkwood cpufreq driver will only
get loaded on kirkwood systems, and won't slow down the boot for
everybody else.
Andrew
next prev parent reply other threads:[~2013-01-27 16:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-27 10:07 [PATCH v3 0/3] Kirkwoode cpufreq driver Andrew Lunn
2013-01-27 10:07 ` [PATCH v3 1/3] cpufreq: kirkwood: Add a cpufreq driver for Marvell Kirkwood SoCs Andrew Lunn
2013-01-27 14:49 ` Viresh Kumar
2013-01-27 15:42 ` Andrew Lunn
2013-01-27 16:03 ` Viresh Kumar
2013-01-27 16:25 ` Andrew Lunn [this message]
2013-01-27 16:45 ` Viresh Kumar
2013-01-27 17:17 ` Andrew Lunn
2013-01-28 3:19 ` Viresh Kumar
2013-01-27 17:11 ` Russell King - ARM Linux
2013-01-27 17:23 ` Andrew Lunn
2013-01-28 6:41 ` Shawn Guo
2013-01-27 18:20 ` Andrew Lunn
2013-01-27 10:07 ` [PATCH v3 2/3] arm: kirkwood: Instantiate cpufreq driver Andrew Lunn
2013-05-26 17:59 ` Jason Cooper
2013-01-27 10:07 ` [PATCH v3 3/3] arm: kirkwood: Enable cpufreq and ondemand on kirkwood_defconfig Andrew Lunn
2013-05-26 18:02 ` Jason Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130127162523.GK29973@lunn.ch \
--to=andrew@lunn.ch \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).