Re: [PATCH] PM: Acquire device locks on suspend

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Rafael J. Wysocki <rjw@...>
Cc: Johannes Berg <johannes@...>, Greg KH <gregkh@...>, Andrew Morton <akpm@...>, Len Brown <lenb@...>, Ingo Molnar <mingo@...>, ACPI Devel Maling List <linux-acpi@...>, LKML <linux-kernel@...>, pm list <linux-pm@...>
Date: Monday, January 7, 2008 - 3:29 pm

On Mon, 7 Jan 2008, Rafael J. Wysocki wrote:


Right.


I was thinking that it might be called before lock_all_devices().

However let's ignore that possibility and simplify the discussion by 
assuming that destroy_suspended_device() is never called except by a 
suspend or resume method for that device or one of its ancestors.  
(This still leaves the possibility that it might get called by mistake 
during a runtime suspend or resume...)


The same problem affects the synchronous approach.  We can fix it by
having dpm_suspend() do the list_move() before calling
suspend_device().  Then if the suspend fails move the device back.


I think it's done this way to avoid having a window where the device 
isn't on a PM list and is still owned by the bus and the driver.  But 
if a suspend occurs during that window, it shouldn't matter that the 
device will be left unsuspended.  After all, the same thing would have 
happened if the suspend occurred after bus_remove_device().

So no, there shouldn't be a problem with moving the call.

Alan Stern

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

Messages in current thread:
[PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Sat Jan 5, 2:36 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Sat Jan 5, 4:08 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Sat Jan 5, 4:19 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Sat Jan 5, 4:39 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Sat Jan 5, 5:13 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Sat Jan 5, 5:41 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Sat Jan 5, 5:58 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Sun Jan 6, 12:04 am)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Sun Jan 6, 9:19 am)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Sun Jan 6, 1:06 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Sun Jan 6, 3:05 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Sun Jan 6, 6:11 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Sun Jan 6, 6:24 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Sun Jan 6, 6:31 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Sun Jan 6, 3:57 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Sun Jan 6, 6:21 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Sun Jan 6, 6:34 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Sun Jan 6, 6:39 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Sun Jan 6, 6:47 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Mon Jan 7, 12:16 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Mon Jan 7, 12:51 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Mon Jan 7, 1:23 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Mon Jan 7, 2:01 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Mon Jan 7, 3:29 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Mon Jan 7, 4:37 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Mon Jan 7, 5:32 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Mon Jan 7, 8:25 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Wed Jan 9, 5:01 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Wed Jan 9, 6:14 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Wed Jan 9, 6:46 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Wed Jan 9, 7:29 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Thu Jan 10, 11:35 am)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Thu Jan 10, 12:59 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Alan Stern, (Thu Jan 10, 1:04 pm)
Re: [PATCH] PM: Acquire device locks on suspend, Rafael J. Wysocki, (Sun Jan 6, 6:19 pm)