1 Mar 2008 01:13
Re: Fundamental flaw in system suspend, exposed by freezer removal
Rafael J. Wysocki <rjw <at> sisk.pl>
2008-03-01 00:13:11 GMT
2008-03-01 00:13:11 GMT
On Friday, 29 of February 2008, Alan Stern wrote: > On Fri, 29 Feb 2008, Rafael J. Wysocki wrote: > > > I'm still not sure if this particular race would happen if only the registering > > of children of already suspended partents were blocked. > > That's different. Before you were talking about acquiring > dev->power.lock _before_ calling the suspend method. Now you're > talking about blocking child registration _after_ the parent is already > suspended. Hm, perhaps I don't understand the issue correctly, so please let me restate it. We have the design issue that it's possible to register a child of a device that was taken for suspend or even suspended which, in turn, leads to a wrong ordering of devices on dpm_active. Namely, suppose that device dev is taken from the end of dpm_active and suspend_device(dev, state) is going to be called If at the same time a child of dev is being registered and suspend_device(dev, state) returns 0, dev will be taken out of dpm_active, but the new device (its child) will be added to the end of dpm_active and subsequently we'll attempt to suspend it. That will be wrong. Also, if a dev's child is registered after suspending all devices, it will go to the end of dpm_active, so after the subsequent resume dev will end up closer to the end of the list than the new child. Thus, during the next suspend it will be taken for suspending before this child and that will be wrong either. Note that this situation need not look dangerously from the driver's perspective, since it doesn't know of the dpm_active ordering issue. One of the possible solutions is to require suspend_device(dev, state) to(Continue reading)
RSS Feed