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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alan Stern
Date: Saturday, March 22, 2008 - 7:07 pm

On Sun, 23 Mar 2008, Rafael J. Wysocki wrote:


It doesn't help.  What _does_ help is the fact that these traversals 
are all serialized (since only one thread can carry out a system sleep 
at any time).


Yes, that is the problem.  If you try to work around it by using
list_for_each_entry_safe() then you run into a problem when a
concurrent thread removes the device _following_ the one being handled
(or when the device being handled is the last one on the list and a
concurrent thread registers a new device, which can only happen in
dpm_prepare()).

It's not hard to fix.  Just something to be aware of.

Alan Stern

P.S.: Oh yes, another related issue...  We should call get_device() and 
put_device() while holding dpm_list_mtx.  Otherwise the device 
structure might vanish when the callbacks are invoked.

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

Messages in current thread:
[RFC][PATCH] PM: Introduce new top level suspend and hiber ..., Rafael J. Wysocki, (Thu Mar 20, 5:01 pm)
Re: [linux-pm] [RFC][PATCH] PM: Introduce new top level su ..., Rafael J. Wysocki, (Thu Mar 20, 5:26 pm)
Re: [RFC][PATCH] PM: Introduce new top level suspend and h ..., Rafael J. Wysocki, (Thu Mar 20, 7:14 pm)
Re: [RFC][PATCH] PM: Introduce new top level suspend and h ..., Rafael J. Wysocki, (Sat Mar 22, 3:17 pm)
Re: [RFC][PATCH] PM: Introduce new top level suspend and h ..., Rafael J. Wysocki, (Sat Mar 22, 4:44 pm)
Re: [RFC][PATCH] PM: Introduce new top level suspend and h ..., Alan Stern, (Sat Mar 22, 7:07 pm)
Re: [RFC][PATCH] PM: Introduce new top level suspend and h ..., Rafael J. Wysocki, (Sun Mar 23, 11:41 am)
Re: [RFC][PATCH] PM: Introduce new top level suspend and h ..., Rafael J. Wysocki, (Sun Mar 23, 2:16 pm)
Re: [linux-pm] [RFC][PATCH] PM: Introduce new top level , Oliver Neukum, (Tue Mar 25, 2:49 am)
Re: [linux-pm] [RFC][PATCH] PM: Introduce new top level , Rafael J. Wysocki, (Tue Mar 25, 6:06 am)
Re: [linux-pm] [RFC][PATCH] PM: Introduce new top level , Oliver Neukum, (Tue Mar 25, 6:15 am)
Re: [linux-pm] , Alan Stern, (Tue Mar 25, 7:19 am)
Re: [linux-pm] [RFC][PATCH] PM: Introduce new top level , Oliver Neukum, (Tue Mar 25, 7:24 am)
Re: [linux-pm] [RFC][PATCH] PM: Introduce new top level , Oliver Neukum, (Tue Mar 25, 12:48 pm)
Re: [linux-pm] [RFC][PATCH] PM: Introduce new top level , Rafael J. Wysocki, (Tue Mar 25, 1:41 pm)
Re: [linux-pm] [RFC][PATCH] PM: Introduce new top level , Oliver Neukum, (Tue Mar 25, 1:49 pm)
Re: [linux-pm] [RFC][PATCH] PM: Introduce new top level , Rafael J. Wysocki, (Tue Mar 25, 1:56 pm)
Re: [linux-pm] [RFC][PATCH] PM: Introduce new top level , Oliver Neukum, (Wed Mar 26, 7:24 am)
Re: [linux-pm] [RFC][PATCH] PM: Introduce new top level , Oliver Neukum, (Wed Mar 26, 8:42 am)
Re: [linux-pm] [RFC][PATCH] PM: Introduce new top level , Rafael J. Wysocki, (Wed Mar 26, 1:46 pm)