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] [day] [month] [year] [list]
Date:	Thu, 09 Oct 2014 06:24:13 -0700
From:	Guenter Roeck <linux@...ck-us.net>
To:	Pavel Machek <pavel@....cz>
CC:	linux-kernel@...r.kernel.org,
	adi-buildroot-devel@...ts.sourceforge.net,
	devel@...verdev.osuosl.org, devicetree@...r.kernel.org,
	lguest@...ts.ozlabs.org, linux-acpi@...r.kernel.org,
	linux-alpha@...r.kernel.org, linux-am33-list@...hat.com,
	linux-cris-kernel@...s.com, linux-efi@...r.kernel.org,
	linux-hexagon@...r.kernel.org, linux-m32r-ja@...linux-m32r.org,
	linuxppc-dev@...ts.ozlabs.org, linux-s390@...r.kernel.org,
	linux-tegra@...r.kernel.org, linux-xtensa@...ux-xtensa.org,
	openipmi-developer@...ts.sourceforge.net,
	user-mode-linux-devel@...ts.sourceforge.net,
	linux-arm-kernel@...ts.infradead.org, linux-c6x-dev@...ux-c6x.org,
	linux-ia64@...r.kernel.org, linux-m68k@...ts.linux-m68k.org,
	linux-metag@...r.kernel.org, linux-mips@...ux-mips.org,
	linux-parisc@...r.kernel.org, linux-pm@...r.kernel.org,
	linux-sh@...r.kernel.org, xen-devel@...ts.xenproject.org,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Len Brown <len.brown@...el.com>
Subject: Re: [PATCH 03/44] hibernate: Call have_kernel_poweroff instead of
 checking pm_power_off

On 10/09/2014 03:32 AM, Pavel Machek wrote:
> On Mon 2014-10-06 22:28:05, Guenter Roeck wrote:
>> Poweroff handlers may now be installed with register_poweroff_handler.
>> Use the new API function have_kernel_poweroff to determine if a poweroff
>> handler has been installed.
>>
>> Cc: Rafael J. Wysocki <rjw@...ysocki.net>
>> Cc: Pavel Machek <pavel@....cz>
>> Cc: Len Brown <len.brown@...el.com>
>> Signed-off-by: Guenter Roeck <linux@...ck-us.net>
>> ---
>>   kernel/power/hibernate.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
>> index a9dfa79..20353c5 100644
>> --- a/kernel/power/hibernate.c
>> +++ b/kernel/power/hibernate.c
>> @@ -602,7 +602,7 @@ static void power_down(void)
>>   	case HIBERNATION_PLATFORM:
>>   		hibernation_platform_enter();
>>   	case HIBERNATION_SHUTDOWN:
>> -		if (pm_power_off)
>> +		if (have_kernel_poweroff())
>>   			kernel_power_off();
>>   		break;
>
> poweroff -> power_off.
>
As mentioned in my other reply, that was on purpose to distinguish
existing functions from poweroff handler functions.

> But if you are playing with this, anyway... does it make sense to
> introduce kernel_power_off() that just works, no need to check
> have_..?
> 									Pavel

I am trying not to change existing behavior.

kernel_power_off is an existing function which does some cleanup
before calling machine_power_off which in turn calls do_kernel_poweroff
(or currently pm_power_off and may do some other machine specific stuff.

Sure, poweroff handling could be unified further. We could decide to
enter an endless loop if machine_power_off() returns, or we could decide
to dump a warning or panic in this case. But that is all separate from
the issue I am trying to solve here, which is to provide a capability to
register more than one poweroff handler. It would also not be that simple,
since some architectures call machine_power_off() directly from various
places.

Guenter

--
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