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:	Wed, 18 May 2011 18:07:50 +0900
From:	MyungJoo Ham <myungjoo.ham@...sung.com>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	linux-pm@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
	Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
	Greg Kroah-Hartman <gregkh@...e.de>, kyungmin.park@...sung.com
Subject: Re: [PATCH v4 1/2] PM / Core: suspend_again callback for suspend_ops.

2011/5/18 Rafael J. Wysocki <rjw@...k.pl>:
> On Tuesday, May 17, 2011, MyungJoo Ham wrote:
[]
>> -static int suspend_enter(suspend_state_t state)
>> +static int suspend_enter(suspend_state_t state, bool *wakeup_pending)
>
> You don't need to use the wakeup_pending argument at all.  I think you
> shouldn't use it even, because in theory there may be a wakeup event after
> you've called pm_wakeup_pending() in suspend_enter() and in that case
> you should break the loop too.

In the case where:
- at the first instance of suspend_enter, pm_wakeup_pending() returns false.
- after suspend_ops->enter(state), the pm_wakeup_pending() "wants" to
return true.
- however, suspend_again forces to loop again.
- then, at the second instance of suspend_enter, pm_wakeup_pending()
returns true.
- the suspend_again's loop breaks.

Although it did not break the loop at the first while, it breaks
without calling suspend_ops->enter again anyway.

[]
>
> So I would simply call pm_wakeup_pending() here again.
>

Besides, if we simply call pm_wakeup_pending() again at there, the
loop will NOT break with pm_wakeup_pending() is true at the first call
inside of suspend_enter(). The function pm_wakeup_pending() clears out
the pending wakeup at each call; thus, in the following example, the
loop will not break:

- At the first instance of suspend_enter in the suspend-again loop,
pm_wakeup_pending() returns true in suspend_enter().
- suspend_enter() returns without error.
- pm_wakeup_pending() is called again at the while statement along
with suspend_ops->suspend_again().
- pm_wakeup_pending() now returns false because it has already
returned true before and cleared "events_check_enabled"
- the loop continues.

Because pm_save_wakeup_count will return true only once for each
wakeup-preventing-event, the result of pm_wakeup_pending in
suspend_enter() should be relayed outside to the loop anyway.

>>
>>   Resume_devices:
>>       suspend_test_start();
>>
>
> Thanks,
> Rafael
>


Cheers!

- MyungJoo
-- 
MyungJoo Ham (함명주), Ph.D.
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: 82-10-6714-2858
--
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