lkml.org 
[lkml]   [2008]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC][PATCH] PM: Make PM core handle device registrations concurrent with suspend/hibernation
Date
On Thursday, 6 of March 2008, Alan Stern wrote:
> On Thu, 6 Mar 2008, Rafael J. Wysocki wrote:
>
> > > I thought of one more thing you might want to add: device_pm_add()
> > > doesn't handle the case where dev->parent is NULL.
> >
> > I'm not sure what you mean.
> >
> > If dev->parent is NULL, we get into the "successful" branch where the device is
> > added to dpm_active. Do you think we should add any extra handling of this
> > case?
>
> If a device is registered after dpm_suspend() has returned, the
> device won't be suspended properly before the system goes to sleep.
>
> If the device has a parent then you're okay, because the parent must
> already be suspended and so device_pm_add() will fail. But if the
> device doesn't have a parent then device_pm_add() will succeed, which
> you don't want.

Well, can it happen in practice? If it can, then what way can it happen?

> > > You could put in that static "all_devices_sleeping" flag, which gets set at
> > > the end of dpm_suspend() and cleared at the start of dpm_resume().
> >
> > Well, I don't think it's necessary. dpm_active is empty in that case and
> > we can use the list_empty(&dpm_active) check instead.
>
> What would happen the very first time the system registers a device
> during startup?

For any other uses than in device_pm_add(), the list_empty(&dpm_active) test
should be sufficient, IMHO.

It seems to me that we're discussing purely academic stuff here. If it turns
out to be of any practical relevance, it will be trivial to add the handling of
it in the future.

Thanks,
Rafael


\
 
 \ /
  Last update: 2008-03-06 21:23    [W:0.061 / U:0.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site