lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 28 Aug 2008 17:32:57 -0700
From:	David Brownell <david-b@...bell.net>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux-kernel@...r.kernel.org, Stefan.Becker@...ia.com, rjw@...k.pl
Subject: Re: [patch 2.6.27-rc4] rtc-cmos: wakes again from S5

On Thursday 28 August 2008, Andrew Morton wrote:
> On Thu, 28 Aug 2008 11:29:35 -0700
> David Brownell <david-b@...bell.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



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists