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]
Message-ID: <20150703143319.1af14c99@free-electrons.com>
Date:	Fri, 3 Jul 2015 14:33:19 +0200
From:	Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
To:	Gregory CLEMENT <gregory.clement@...e-electrons.com>
Cc:	Jason Cooper <jason@...edaemon.net>, Andrew Lunn <andrew@...n.ch>,
	Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
	Ezequiel Garcia <ezequiel.garcia@...e-electrons.com>,
	linux-arm-kernel@...ts.infradead.org,
	Maxime Ripard <maxime.ripard@...e-electrons.com>,
	Boris BREZILLON <boris.brezillon@...e-electrons.com>,
	Lior Amsalem <alior@...vell.com>,
	Tawfik Bayouk <tawfik@...vell.com>,
	Nadav Haklai <nadavh@...vell.com>, linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/4] ARM: mvebu: Add standby support

Hello,

On Fri, 03 Jul 2015 14:21:09 +0200, Gregory CLEMENT wrote:

> No it is called during boot and if the method is not there then it is no
> more available for the user. I made te test and with a cat on /sys/power/state
> I only got "freeze" and "standby" but not "mem".

Argh, indeed it's called by suspend_set_ops() itself.

So now, I wonder why the heck ->valid() is a function pointer in this
case, rather than just an argument passed to suspend_set_ops(). Having
a function pointer would precisely be useful to change at runtime which
states are available, and which states are not available. It is being
called again when actually entering the state, but apparently for no
useful reason.

Another option is to have ->valid() always say that suspend to RAM is
available, and just make ->enter() return -EINVAL if we're trying to
enter the PM_SUSPEND_MEM state and the mvebu_pm_board_enter pointer is
NULL. The only drawback is that the kernel will have done all its
suspend procedure (freezing processes, suspend devices) before telling
the user that it is not possible to enter suspend to RAM. But it's
probably not a big deal.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ