public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* Suspend without the freezer
@ 2007-07-30 20:48 Alan Stern
  2007-07-31  3:52 ` Dmitry Torokhov
  0 siblings, 1 reply; 18+ messages in thread
From: Alan Stern @ 2007-07-30 20:48 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Linux-pm mailing list

Dmitry:

I'm trying to help eliminate the need for the freezer during suspend.  
For it to work, we have to prevent threads which otherwise would have 
been frozen from trying to bind drivers to suspended devices or trying 
to register new devices whose parents are already suspended.

To help accomplish this, the PM core can acquire the device semaphores
for all existing devices before suspending any of them.  That will
prevent attempts at binding.  It would also prevent registration of new
children, _if_ the driver doing the registration had to acquire the
parent's semaphore first.  But many drivers don't do this.

One thought was to have the PM core acquire and hold the dpm_list_mutex 
throughout the suspend.  This would block registration attempts at the 
point where the new device is added to the PM core's device-list.

Unfortunately it creates several lockdep violations.  For example, the 
serio core holds serio->drv_mutex while input_register_device is 
called (which acquires dpm_list_mutex), and it acquires 
serio->drv_mutex in serio_suspend and serio_resume (which would be 
called while the PM core holds dpm_list_mutex).

I'm having trouble coming up with a way to block registrations during 
suspend that won't create a possibility for deadlock.  Do you have any 
suggestions?  A scheme that would work for the input layer ought to be 
generally applicable.

Alan Stern

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2007-08-01 20:16 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-30 20:48 Suspend without the freezer Alan Stern
2007-07-31  3:52 ` Dmitry Torokhov
2007-07-31  9:05   ` Rafael J. Wysocki
2007-07-31 15:24     ` Alan Stern
2007-07-31 19:08       ` Rafael J. Wysocki
2007-07-31 20:48         ` [RFC 1/2] PM: merge drivers/base/power/{main, suspend, resume}.c Alan Stern
2007-07-31 22:15           ` Rafael J. Wysocki
2007-07-31 20:51         ` [RFC 2/2] PM: Lock all devices during suspend/hibernate Alan Stern
2007-07-31 22:20           ` Rafael J. Wysocki
2007-08-01 14:11             ` Alan Stern
2007-08-01 15:37               ` Rafael J. Wysocki
2007-08-01 17:58                 ` Alan Stern
2007-08-01 18:59                   ` Rafael J. Wysocki
2007-08-01  3:50       ` Re: Suspend without the freezer Paul Mackerras
2007-08-01 14:33         ` Alan Stern
2007-08-01 19:08           ` Rafael J. Wysocki
2007-08-01 20:16             ` Alan Stern
2007-07-31 14:58   ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox