From: David Brownell <david-b@pacbell.net>
To: Russell King <rmk@arm.linux.org.uk>
Cc: Andrew Victor <andrew@sanpeople.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-pm@lists.linux-foundation.org
Subject: Re: [patch 2.6.23-rc2 1/2] define clk_must_disable()
Date: Tue, 7 Aug 2007 14:20:58 -0700 [thread overview]
Message-ID: <200708071420.59260.david-b@pacbell.net> (raw)
In-Reply-To: <20070807125054.GC2833@flint.arm.linux.org.uk>
On Tuesday 07 August 2007, Russell King wrote:
> Changing the function name to "clk_available_in_suspend()" addresses at
> least two of these points.
Except that it would
(a) Preclude using this function in non-suspend contexts, including the
"multiple run states" PM support that's regularly requested (and
is thus IMO in the "why not plan on it" category). The mechanism
doesn't *NEED* to be constrained to be usable only from suspend().
(b) Beg the question of which suspend state is involved ... something
which has to date been intentionally hidden, since such states are
so extremely system-specific (and since drivers misused that info).
Drivers can care about *attributes* of an upcoming state (like
whether a clock will be available, or a power domain, etc); fine.
The original notion for a name was of course clk_will_be_available(clk),
but that seemed too darn unwieldy to use. Plus, logic like
if (clk_must_disable(clk))
clk_disable(clk);
(and similar) just seems inherently less likely to confuse ... it doesn't
need to introduce even one new term or concept, and focusses exclusively
on the key point: whether clk_disable() is mandatory.
> The other two points are addressed by
> providing a way for the method to be passed the desired system suspend
> state, which may be resolved by expanding pm_message_t to contain that
> information.
You do realize that pm_message_t was created to move *AWAY* from
passing an ID for the target system state down to the drivers?
The PM core previously passed down PM_SUSPEND_* integer codes.
Personally I detest pm_message_t ... "struct pm_message *" would
have been better, much less costly to expand (if needed), no new
typedefs, no pass-struct-by-value. And in any case, there's work
afoot to have different methods for each different PM event, and
thus finally abolish pm_message_t.
> Finally, concerning merging this during the -rc phase, I'd much rather
> see the one liner simple build fix of adding the missing function
> prototype going into the -rc kernels, and then a similar patch to this
> going in during the next merge window.
If clk_must_disable() hadn't been "the plan of record" for over a
year, and already in use, I'd have been more in accord with that.
- Dave
> > /*
> > - * Call this from platform driver suspend() to see how deeply to suspend.
> > + * This is called from clk_must_disable(), to see how deeply to suspend.
> > * For example, some controllers (like OHCI) need one of the PLL clocks
> > * in order to act as a wakeup source, and those are not available when
> > * going into slow clock mode.
> > - *
> > - * REVISIT: generalize as clk_will_be_available(clk)? Other platforms have
> > - * the very same problem (but not using at91 main_clk), and it'd be better
> > - * to add one generic API rather than lots of platform-specific ones.
> > */
> > int at91_suspend_entering_slow_clock(void)
prev parent reply other threads:[~2007-08-07 21:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-06 18:11 [patch 2.6.23-rc2 1/2] define clk_must_disable() David Brownell
2007-08-06 20:04 ` Russell King
2007-08-06 20:38 ` David Brownell
2007-08-06 21:03 ` David Brownell
2007-08-06 21:48 ` Russell King
2007-08-06 23:46 ` David Brownell
2007-08-07 5:23 ` Andrew Morton
2007-08-07 12:50 ` Russell King
2007-08-07 17:21 ` Andrew Morton
2007-08-07 17:25 ` Russell King
2007-08-07 20:15 ` David Brownell
2007-08-07 20:18 ` David Brownell
2007-08-07 21:04 ` David Brownell
2007-08-07 21:17 ` David Brownell
2007-08-07 22:20 ` Rafael J. Wysocki
2007-08-07 21:20 ` David Brownell [this message]
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=200708071420.59260.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=akpm@linux-foundation.org \
--cc=andrew@sanpeople.com \
--cc=linux-pm@lists.linux-foundation.org \
--cc=rmk@arm.linux.org.uk \
/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