Re: [RFC][PATCH] PM: Introduce new top level suspend and hibernation callbacks (rev. 3)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Rafael J. Wysocki <rjw@...>
Cc: pm list <linux-pm@...>, ACPI Devel Maling List <linux-acpi@...>, Greg KH <greg@...>, Len Brown <lenb@...>, LKML <linux-kernel@...>, Alexey Starikovskiy <astarikovskiy@...>, David Brownell <david-b@...>, Pavel Machek <pavel@...>, Benjamin Herrenschmidt <benh@...>
Date: Monday, March 24, 2008 - 4:14 pm

On Mon, 24 Mar 2008, Rafael J. Wysocki wrote:

...

It would be okay to wait until after the last prepare() method is
called.  I don't know if it makes any difference in the end, however.


Can we also have a DPM_PREPARING state, set when ->prepare() is about
to be called?  The PM core wouldn't make use of it but some drivers
would.  (I can't think of any use at all for the analogous
DPM_COMPLETING state, however.)

...

Clearer to say: if (dev->parent->power.status >= DPM_SUSPENDING) {

...

Log a warning here?  If this ever happened, it would be the sort of 
unexpected regression that people get all excited about.

...


Clearer to say: if (dev->power.status >= DPM_OFF) {

Note that if dev->power.status is equal to DPM_SUSPENDING then you 
don't want to call resume_device(), but you still do want to change 
dev->power.status to DPM_RESUMING so that new children can be 
registered.


A little problem here: You refer to dev after calling put_device().


This isn't the way I imagined doing it (your extra "list"), but it's 
fine.

...
...

Same problem with use-after-put.  Also present in dpm_prepare().


...
...

Use-after-put again.


Instead you could eliminate the list_splice_init() above and put here:

	list_splice(&list, dpm_list->prev);

This will move the entries from list to the end of dpm_list.


On the whole it looks quite good.

Alan Stern

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC][PATCH] PM: Introduce new top level suspend and hiberna..., Rafael J. Wysocki, (Mon Mar 24, 1:39 pm)
Re: [RFC][PATCH] PM: Introduce new top level suspend and hib..., Alan Stern, (Mon Mar 24, 4:14 pm)
Re: [RFC][PATCH] PM: Introduce new top level suspend and hib..., Rafael J. Wysocki, (Mon Mar 24, 6:18 pm)
Re: [RFC][PATCH] PM: Introduce new top level suspend and hib..., Rafael J. Wysocki, (Tue Mar 25, 4:39 pm)
Re: [RFC][PATCH] PM: Introduce new top level suspend and hib..., Rafael J. Wysocki, (Tue Mar 25, 8:40 am)
Re: [RFC][PATCH] PM: Introduce new top level suspend and hib..., Rafael J. Wysocki, (Mon Mar 24, 5:18 pm)
Re: [RFC][PATCH] PM: Introduce new top level suspend and hib..., Rafael J. Wysocki, (Tue Mar 25, 4:35 pm)
Re: [RFC][PATCH] PM: Introduce new top level suspend and hib..., Rafael J. Wysocki, (Wed Mar 26, 4:26 pm)
Re: [RFC][PATCH] PM: Introduce new top level suspend and hib..., Rafael J. Wysocki, (Wed Mar 26, 4:54 pm)