From: rob.lee@linaro.org (Rob Lee)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/7] at91 : fix dirty hack for the selfrefresh function
Date: Fri, 13 Jan 2012 11:25:47 -0600 [thread overview]
Message-ID: <CAMXH7KEtc6PJNEUH6a-wxtC9zJk3RL8n4mi6Kfw3_AS3C0UYew@mail.gmail.com> (raw)
In-Reply-To: <201201131548.50753.arnd.bergmann@linaro.org>
On Fri, Jan 13, 2012 at 9:48 AM, Arnd Bergmann <arnd.bergmann@linaro.org> wrote:
> On Friday 13 January 2012, Russell King - ARM Linux wrote:
>> The idea of exporting arm_pm_standby() is one I thought about, but I'm
>> not sure if it makes sense for all SoCs to call their standby function
>> from the CPU idle code.
>
> It doesn't have to be all SoCs, but it would be nice if we could
> do it for a few of them.
>
>> I'm coming to the conclusion that moving the AT91 CPU idle driver out
>> of arch/arm/mach-at91 is the wrong thing to do - it seems that the CPU
>> idle driver is intimately linked to core AT91 code, and moving it out
>> just makes those linkages a lot more complicated to handle. ?And for
>> what benefit - just to have this located under the drivers/ subtree
>> because it's now seen to be a driver ?
>>
>> I think this is one of the times where the 'solution' is worse than the
>> problem.
>
> One of the benefits of moving all cpuidle drivers into that directory
> was so that we could spot commonalities between them and share code across
> the implementation.
>
> Maybe the answer is that we should do the second step before the first
> one instead, in particular since the at91 implementation is so simple.
> Could we have a common cpuidle driver that just calls cpu_do_idle or a
> new global pm_standby function when that is available for two disinct
> levels? Then again, there really isn't that much code left, so maybe
> it doesn't make much sense after all to consolidate it this one.
>
This patch provides a common cpuidle interface with an optional
default state that just calls cpu_do_idle. Take a look at the
drivers/cpuidle/common.c file. I hope to release the next version
within day or two, so if you have any additional suggestions that
could help with this situation, please let me know.
http://www.spinics.net/lists/arm-kernel/msg151843.html
> One more idea: We can put the driver into drivers/cpuidle/at91_cpuidle.c
> but put the functions that get called into the arch/arm/mach-at91/pm.c
> and initialize it with the standby function provided as driver_data:
>
> struct cpuidle_device at91_cpuidle_device = {
> ? ? ? ?.count = 2,
> ? ? ? ?.states_usage = {
> ? ? ? ?[0] = { .driver_data = &cpu_do_idle },
> ? ? ? ?[1] = { .driver_data = &at91_standby },
> ? ? ? ?},
> };
>
> Not really how it's meant to be used, but separates the cpu-specific parts
> from the main driver.
>
> ? ? ? ?Arnd
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at ?http://vger.kernel.org/majordomo-info.html
It seems that clock driver functionality for some platforms are
implemented in arch/arm/mach-xxx and then exported through calls to
clk_get. The platform_driver system also allows exporting of platform
data to non platform located files. Perhaps each platform could have
one specific platform driver structure instance whose sole purpose is
to export platform specific functions by a call to
platform_get_drvdata. Or, a lighter weight system similar to clk_get
could be created for this purpose. Of course both of these are
heavier than just adding extern statements to a drivers/cpuidle/blah.c
file but I just wanted to throw those options out there in case it is
the "extern" method of exporting that is an issue and not the actual
exporting platform specific located functionality to non-platform
areas.
next prev parent reply other threads:[~2012-01-13 17:25 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-11 14:55 [PATCH 0/7] at91 : pm.h cleanups Daniel Lezcano
2012-01-11 14:55 ` [PATCH 1/7] at91 : coding style fixes Daniel Lezcano
2012-01-11 14:55 ` [PATCH 2/7] at91 : declare header name Daniel Lezcano
2012-01-11 14:55 ` [PATCH 3/7] at91 : group headers inclusion for the memory controller Daniel Lezcano
2012-01-11 14:55 ` [PATCH 4/7] at91 : convert pm.h macros to static inline functions Daniel Lezcano
2012-01-11 14:55 ` [PATCH 5/7] at91 : fix dirty hack for the selfrefresh function Daniel Lezcano
2012-01-11 15:10 ` Arnd Bergmann
2012-01-11 16:55 ` Russell King - ARM Linux
2012-01-11 18:27 ` Arnd Bergmann
2012-01-11 19:43 ` Russell King - ARM Linux
2012-01-12 14:41 ` Nicolas Ferre
2012-01-12 19:36 ` Russell King - ARM Linux
2012-01-13 0:38 ` Rob Lee
2012-01-13 9:29 ` Daniel Lezcano
2012-01-13 10:22 ` Russell King - ARM Linux
2012-01-13 15:48 ` Arnd Bergmann
2012-01-13 17:25 ` Rob Lee [this message]
2012-01-11 14:55 ` [PATCH 6/7] at91 : group selfrefresh functions Daniel Lezcano
2012-01-11 16:56 ` Russell King - ARM Linux
2012-01-11 14:55 ` [PATCH 7/7] at91 : fix compilation warning Daniel Lezcano
2012-01-11 15:23 ` [PATCH 0/7] at91 : pm.h cleanups Arnd Bergmann
2012-01-11 16:29 ` Daniel Lezcano
2012-01-23 6:29 ` Jean-Christophe PLAGNIOL-VILLARD
2012-01-11 16:57 ` Russell King - ARM Linux
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=CAMXH7KEtc6PJNEUH6a-wxtC9zJk3RL8n4mi6Kfw3_AS3C0UYew@mail.gmail.com \
--to=rob.lee@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).