Re: [PATCH] PM: Acquire device locks on suspend (rev. 3)
From: Alan Stern <stern@rowland.harvard.edu>
Date: 2008-01-11 15:07:38
On Fri, 11 Jan 2008, Rafael J. Wysocki wrote:
Hi, The patch below is intended as a replacement for gregkh-driver-pm-acquire-device-locks-prior-to-suspending.patch that deadlocked suspend and hibernation on some systems. Â The present patch contains some safeguards against deadlocks in the relevant cases and a mechanism to print warnings if a deadlock is probable. Greetings, Rafael --- From: Rafael J. Wysocki <redacted>, Alan Stern <stern@rowland.harvard.edu> This patch reorganizes the way suspend and resume notifications are sent to drivers. The major changes are that now the PM core acquires every device semaphore before calling the methods, and calls to device_add() during suspends will fail, while calls to device_del() during suspends will block. It also provides a way to safely remove a suspended device with the help of the PM core, by using the device_pm_schedule_removal() callback introduced specifically for this purpose, and updates two drivers (msr and cpuid) that need to use it. Signed-off-by: Rafael J. Wysocki <redacted>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>