Re: [PATCH v4 1/2] PM / Core: suspend_again callback for suspend_ops.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, May 18, 2011, MyungJoo Ham wrote:
> 2011/5/18 Rafael J. Wysocki <rjw@xxxxxxx>:
> > 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;

Ah, that's correct, sorry.

Thanks,
Rafael
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux