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 - 4:28 pm

On Sat, 22 Mar 2008, Rafael J. Wysocki wrote:


Are you talking about this comment?


It isn't wrong.  device_add() may indeed be called with a device 
semaphore held -- just not the semaphore for the device being added.  
Quite often it is called with device's parent's semaphore held.  The 
implication is not that we may deadlock in bus_attach_device(); rather 
it is that the order of acquisition must always be device semaphore 
first, dev_list_mutex second.


No, you have missed the entire point.  The problem doesn't exist in the
current code; it exists only if we switch over to using a single list.  
Routines like dpm_suspend() won't be able to use list_for_each_entry()
to traverse the list because entries may be removed by other threads
during the traversal.  Even list_for_each_entry_safe() won't work
correctly without careful attention to details.

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 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 ..., Alan Stern, (Sat Mar 22, 4:28 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 ..., 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)