public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* Possible problem with device_move()
@ 2007-07-28 15:36 Alan Stern
  2007-07-30  6:42 ` Cornelia Huck
  2007-07-30  6:53 ` Marcel Holtmann
  0 siblings, 2 replies; 30+ messages in thread
From: Alan Stern @ 2007-07-28 15:36 UTC (permalink / raw)
  To: Cornelia Huck, Marcel Holtmann; +Cc: Linux-pm mailing list

Cornelia and Marcel:

The only places in the kernel that call device_move() are in 
drivers/s390/cio/device.c and net/bluetooth/rfcomm/tty.c, so I want to 
check with the two of you.

I'm in the midst of changing the Power Management core to make it
acquire the device semaphore of every device during a suspend and
resume.  The order of acquisition is the order of device registration, 
which normally agrees with the way locks are acquired when going 
through the device tree (i.e., parents before children).

But when you call device_move() that might no longer be true.  If a 
device is moved so that its new parent was registered _after_ it was, 
then the two orders will disagree.  This raises the possibility of a 
deadlock if any thread ever tries to lock the device while holding the 
new parent's lock -- as might happen during an unregistration, for 
example.

Can you tell whether this will ever cause a problem?  Or is it known to
be safe because whenever you call device_move(), the new parent was
registered before the device being moved?

Thanks,

Alan Stern

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

end of thread, other threads:[~2007-08-06 13:53 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-28 15:36 Possible problem with device_move() Alan Stern
2007-07-30  6:42 ` Cornelia Huck
2007-07-30 17:34   ` Alan Stern
2007-07-31  8:33     ` Cornelia Huck
2007-07-31 15:11       ` Alan Stern
2007-07-31 15:27         ` Rafael J. Wysocki
2007-07-31 15:30         ` Cornelia Huck
2007-07-31 18:17           ` Alan Stern
2007-07-31 19:12             ` Rafael J. Wysocki
2007-07-31 20:37               ` Alan Stern
2007-08-01 13:03                 ` Cornelia Huck
2007-08-01 15:22                   ` Alan Stern
2007-08-01 17:04                     ` Cornelia Huck
2007-08-01 17:35                       ` Alan Stern
2007-08-01 19:25                         ` Rafael J. Wysocki
2007-08-01 20:27                           ` Alan Stern
2007-08-02  8:06                             ` Cornelia Huck
2007-08-02 14:19                               ` Alan Stern
2007-08-02 14:50                                 ` Cornelia Huck
2007-08-02 11:21                             ` Rafael J. Wysocki
2007-08-02 14:24                               ` Alan Stern
2007-08-02 14:58                                 ` Rafael J. Wysocki
2007-08-02 15:23                                   ` Alan Stern
2007-08-02 22:39                                     ` Rafael J. Wysocki
2007-08-03 14:56                                       ` Alan Stern
2007-08-03 21:39                                         ` Rafael J. Wysocki
2007-08-06  9:31                                           ` Cornelia Huck
2007-08-06 13:53                                             ` Alan Stern
2007-07-30  6:53 ` Marcel Holtmann
2007-07-30 17:37   ` Alan Stern

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