From: David Brownell <david-b@pacbell.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Stefan.Becker@nokia.com, rjw@sisk.pl
Subject: Re: [patch 2.6.27-rc4] rtc-cmos: wakes again from S5
Date: Thu, 28 Aug 2008 17:32:57 -0700 [thread overview]
Message-ID: <200808281732.57394.david-b@pacbell.net> (raw)
In-Reply-To: <20080828172206.5e083817.akpm@linux-foundation.org>
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.
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.
- Dave
next prev parent reply other threads:[~2008-08-29 0:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-28 18:29 [patch 2.6.27-rc4] rtc-cmos: wakes again from S5 David Brownell
2008-08-29 0:22 ` Andrew Morton
2008-08-29 0:32 ` David Brownell [this message]
2008-08-29 17:34 ` Rafael J. Wysocki
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=200808281732.57394.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=Stefan.Becker@nokia.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
/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