lkml.org 
[lkml]   [2008]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [patch 2.6.27-rc4] rtc-cmos: wakes again from S5
Date
On Friday, 29 of August 2008, David Brownell wrote:
> On Thursday 28 August 2008, Andrew Morton wrote:
> > On Thu, 28 Aug 2008 11:29:35 -0700
> > David Brownell <david-b@pacbell.net> wrote:
> >
> > > + if (system_state == SYSTEM_POWER_OFF && !cmos_poweroff(pdev))
> >
> > erp, system_state is a pretty horrid thing. It's a global with
> > relatively poorly defined transition conditions which have actually
> > changed over time.
>
> True, but it's the best we've got for this kind of thing.

Exactly.

> Globals ... yeech.
>
>
> > It was not my greatest ever idea. It was simple and expedient at the
> > time and expanded use of it was "discouraged" (rofl).
> >
> > Is there no alternative?
>
> My general belief is that there should be a set of predicates
> that drivers use to test whether or not the target system state
> satisfies various prerequisites. Like whether a clock or power
> domain must be disabled, and so on.
>
> In this specific case, a system_is_powering_down() predicate is
> the logical application of that policy to this problem.

Well, we still need to store that information somewhere and make it globally
available, this way or another.

The problem is actually deeper, because there are quirks that have to be
called in specific situations from within relatively low-level functions
(e.g. http://bugzilla.kernel.org/show_bug.cgi?id=8855#c36), so if there's
a better approach than using system_state for that, I'd like to use it. :-)

Thanks,
Rafael


\
 
 \ /
  Last update: 2008-08-29 19:33    [W:0.065 / U:9.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site