Re: [PATCH 2/2] PM: fix async resume following suspend failure

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

 



On Sat, 18 Jun 2011, Rafael J. Wysocki wrote:

> > @@ -596,7 +597,7 @@ void dpm_resume(pm_message_t state)
> >  
> >  	list_for_each_entry(dev, &dpm_suspended_list, power.entry) {
> >  		INIT_COMPLETION(dev->power.completion);
> > -		if (is_async(dev)) {
> > +		if (is_async(dev) && dev->power.is_suspended) {
> 
> If we check dev->power.is_suspended here, we won't complete the
> device's power.completion, which is necessary if the device is someone's
> parent.  Moreover, I think we should clear the device's is_prepared
> flage at this point.

Yes.  I was trying to avoid starting up unnecessary threads, but 
clearly that is less important than being correct.

> > @@ -881,6 +882,7 @@ static int __device_suspend(struct devic
> >  	}
> >  
> >   End:
> > +	dev->power.is_suspended = !error;
> >  	device_unlock(dev);
> >  	complete_all(&dev->power.completion);
> 
> This change doesn't seem to be correct too, because error is 0 if
> async_error is true, but the device won't be suspended in that case
> too.

Okay; I should have been more careful.  Thanks for fixing this up.

Alan Stern

_______________________________________________
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