From: daniel.lezcano@linaro.org (Daniel Lezcano)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 07/15] ARM: cpuidle: add init/exit routine
Date: Mon, 25 Mar 2013 22:53:18 +0100 [thread overview]
Message-ID: <5150C74E.1040903@linaro.org> (raw)
In-Reply-To: <alpine.LFD.2.03.1303251616070.1372@syhkavp.arg>
On 03/25/2013 09:28 PM, Nicolas Pitre wrote:
> On Mon, 25 Mar 2013, Daniel Lezcano wrote:
>
>> On 03/25/2013 07:10 PM, Andrew Lunn wrote:
>>> On Mon, Mar 25, 2013 at 06:55:32PM +0100, Daniel Lezcano wrote:
>>>> The init and exit routine for most of the drivers are the same,
>>>> that is register the driver and register the device.
>>>>
>>>> Provide a common function to do that in the cpuidle driver for ARM,
>>>> so we can get rid of a lot of code duplication in the different SOC
>>>> cpuidle drivers.
>>>
>>> Hi Daniel
>>>
>>> Please could you add a comment in the code about which piece is
>>> specific to ARM, because its not obvious to me. Its not like there is
>>> a reference to WFI for example. It looks like this code could go in
>>> drivers/cpuidle/cpuidle.c
>>
>> Yes, I agree. At the first glance, the code, as it is, could go in this
>> file but more ARM specific code will be moved to this ARM generic code
>> driver like device tree description and couple idle states. The init
>> function would be more arch specific then.
>>
>> For this reason, I think it is reasonable to move to
>> arm/kernel/cpuidle.c rather than drivers/cpuidle/cpuidle.c first.
>
> No.
>
> Please move things under drivers/cpuidle/ upfront.
>
> We do want drivers to be gathered according to their purpose and
> subsystem, not according to the architecture they belong to.
>
> This is a simple maintenance optimization to do so.
>
> The reason is when someone wishes to improve the subsystem then that
> someone who might know nothing about the ARM or other architectures
> won't have to look for obscure drivers buried into arch specific
> directories. When things are gathered under a common directory it is
> then much easier to perform wide ranging changes to a subsystem.
>
> And for those who do know the ARM architecture and wish to modify the
> ARM driver it is not that hard to locate the driver once.
>
> The "downside" for you might be that the activity under drivers/cpuidle/
> is more closely scrutinized by more people. But that isn't a bad thing
> either.
>
>> In the future, when all the ARM cpuidle driver will be fully
>> consolidated, that will be easier to identify the common parts across
>> the different arch and then move them to the generic framework.
>
> Nothing prevents you from doing that consolidation work right in
> drivers/cpuidle/.
I fully agree with you but I think there is a misunderstanding.
The idea is to consolidate the ARM code in the ARM cpuidle driver which
is mostly empty. The init/exit functions could falsely lead someone to
think they could be moved in the generic framework but IMO it is too
soon because the code consolidation will bring some arch specificity and
in this case we will going back and forth. I want to avoid that.
Let me consolidate the ARM driver, cleanup the headers to split the arch
specific code from the rest and then move this driver to
drivers/cpuidle. This is just a question of a week.
--
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
next prev parent reply other threads:[~2013-03-25 21:53 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-25 17:55 [PATCH 00/15] ARM: cpuidle: code consolidation Daniel Lezcano
2013-03-25 17:55 ` [PATCH 01/15] timer: move enum definition out of ifdef section Daniel Lezcano
2013-03-26 4:36 ` Santosh Shilimkar
2013-03-26 9:55 ` Daniel Lezcano
2013-03-25 17:55 ` [PATCH 02/15] cpuidle: initialize the broadcast timer framework Daniel Lezcano
2013-03-26 4:39 ` Santosh Shilimkar
2013-03-25 17:55 ` [PATCH 03/15] cpuidle: ux500: remove timer broadcast initialization Daniel Lezcano
2013-03-27 14:46 ` Linus Walleij
2013-03-25 17:55 ` [PATCH 04/15] cpuidle: OMAP4: " Daniel Lezcano
2013-03-26 4:41 ` Santosh Shilimkar
2013-03-25 17:55 ` [PATCH 05/15] cpuidle: imx6: " Daniel Lezcano
2013-03-26 7:25 ` Shawn Guo
2013-03-26 9:43 ` Daniel Lezcano
2013-03-26 12:40 ` Shawn Guo
2013-03-26 12:53 ` Daniel Lezcano
2013-03-26 13:06 ` Rafael J. Wysocki
2013-03-26 14:28 ` Shawn Guo
2013-03-25 17:55 ` [PATCH 06/15] ARM: cpuidle: remove useless declaration Daniel Lezcano
2013-03-25 17:55 ` [PATCH 07/15] ARM: cpuidle: add init/exit routine Daniel Lezcano
2013-03-25 18:10 ` Andrew Lunn
2013-03-25 18:33 ` Daniel Lezcano
2013-03-25 19:09 ` Andrew Lunn
2013-03-25 19:20 ` Daniel Lezcano
2013-03-25 19:31 ` Amit Kucheria
2013-03-25 19:46 ` Daniel Lezcano
2013-03-25 21:42 ` Andrew Lunn
2013-03-25 22:09 ` Daniel Lezcano
2013-03-25 20:28 ` Nicolas Pitre
2013-03-25 21:53 ` Daniel Lezcano [this message]
2013-03-25 21:57 ` Nicolas Pitre
2013-03-25 17:55 ` [PATCH 08/15] ARM: ux500: cpuidle: use init/exit common routine Daniel Lezcano
2013-03-27 14:47 ` Linus Walleij
2013-03-25 17:55 ` [PATCH 09/15] ARM: at91: " Daniel Lezcano
2013-03-26 8:48 ` Nicolas Ferre
2013-03-25 17:55 ` [PATCH 10/15] ARM: OMAP3: " Daniel Lezcano
2013-03-25 17:55 ` [PATCH 11/15] ARM: s3c64xx: " Daniel Lezcano
2013-03-25 17:55 ` [PATCH 12/15] ARM: tegra1: " Daniel Lezcano
2013-03-25 17:55 ` [PATCH 13/15] ARM: shmobile: pm: fix init sections Daniel Lezcano
2013-03-27 14:09 ` Simon Horman
2013-03-25 17:55 ` [PATCH 14/15] ARM: shmobile: cpuidle: remove useless WFI function Daniel Lezcano
2013-03-27 14:09 ` Simon Horman
2013-03-25 17:55 ` [PATCH 15/15] ARM: shmobile: cpuidle: use init/exit common routine Daniel Lezcano
2013-03-27 14:10 ` Simon Horman
2013-03-25 20:27 ` [PATCH 00/15] ARM: cpuidle: code consolidation Rob Herring
2013-03-25 21:55 ` Daniel Lezcano
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=5150C74E.1040903@linaro.org \
--to=daniel.lezcano@linaro.org \
--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).