login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
January
»
7
Re: [PATCH] PM: Acquire device locks on suspend
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Rafael J. Wysocki
Subject:
Re: [PATCH] PM: Acquire device locks on suspend
Date: Monday, January 7, 2008 - 9:51 am
On Monday, 7 of January 2008, Alan Stern wrote:
quoted text
> Let's try to summarize the main issues here: > > 1. We want the PM core to lock all devices during suspend and > hibernation. This implies that registration and unregistration > at such times can't work, because they need to lock the > device sem in order to make probe and remove method calls. > > 2. Registration calls can be failed, with an error message in the > system log. However unregistration calls cannot fail. They > _can_ block until the system resumes, but if the unregistration > call was made from within a suspend or resume method it will > deadlock. This seems inescapable, but at least we should print > an error in the log so the offending driver can be identified. > > 3. In response to 2, the PM core should have a special routine for > unregistering devices while a suspend is in progress. Rafael > proposed that the core should unlock the device to permit the > call to go through. This seems dangerous to me; I would prefer > to leave the locks in place and defer the unregistration until > after the system is back up and the locks have all been > dropped. This would avoid all sorts of locking, deadlock, and > mutual exclusion problems. > > (As a side note: destroy_suspended_device() has a rather limited > interface anyway, since it can handle only devices that were created by > create_device().) > > 4. Rafael pointed out that unregistration can occur concurrently > with system suspend. When this happens we can end up trying to > suspend a device which has already been through > bus_remove_device(), because it hasn't yet been removed from > the dpm_active list. He proposes we make unregistration block > system suspend, just as registration does. > > I don't see 4 as a real problem. Starting an unregistration before > the suspend and finishing it afterward should be okay. Once a device > has gone through bus_remove_device() it hasn't got a suspend method any > more, so trying to suspend it won't do anything at all -- the tests in > suspend_device() will all fail. Conversely, if bus_remove_device() > hasn't run yet then we would end up calling the driver's suspend method > before the device_del() call returns. As Johannes pointed out, this is > a normal race that would exist anyway. > > On the other hand, having unregistration block system suspend wouldn't > actually be wrong. I simply don't think it is necessary. But note > that making the two mutually exclusive would complicate Rafael's > synchronous approach for destroy_suspended_device(). > > 5. All the discussion about pm_sleep_rwsem and so on is > implementation details. Once we have settled on the correct > approach for 1-4, the implementation should be relatively easy.
Please see the patch at:
http://lkml.org/lkml/2008/1/6/298
. It represents my current idea about how to do that. Thanks, Rafael --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
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, 11:36 am)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Sat Jan 5, 1:08 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Sat Jan 5, 1:19 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Sat Jan 5, 1:39 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Sat Jan 5, 2:13 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Sat Jan 5, 2:41 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Sat Jan 5, 2:58 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Sat Jan 5, 9:04 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Sun Jan 6, 6:19 am)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Sun Jan 6, 10:06 am)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Sun Jan 6, 12:05 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Sun Jan 6, 12:57 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Sun Jan 6, 3:11 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Sun Jan 6, 3:19 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Sun Jan 6, 3:21 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Sun Jan 6, 3:31 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Sun Jan 6, 3:34 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Sun Jan 6, 3:47 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Mon Jan 7, 9:16 am)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Mon Jan 7, 9:51 am)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Mon Jan 7, 10:23 am)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Mon Jan 7, 11:01 am)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Mon Jan 7, 12:29 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Mon Jan 7, 1:37 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Mon Jan 7, 2:32 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Mon Jan 7, 5:25 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Wed Jan 9, 2:01 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Wed Jan 9, 3:14 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Wed Jan 9, 3:46 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Wed Jan 9, 4:29 pm)
Re: [PATCH] PM: Acquire device locks on suspend
, Rafael J. Wysocki
, (Thu Jan 10, 9:59 am)
Re: [PATCH] PM: Acquire device locks on suspend
, Alan Stern
, (Thu Jan 10, 10:04 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Tony Luck
Re: Hardware Error Kernel Mini-Summit
James Bottomley
Re: [PATCH -mm 1/2] scsi: remove dma_is_consistent usage in 53c700
Andrey Borzenkov
Re: [possible regression] 2.6.22 reiserfs/libata sporadically hangs on resume from...
Jeffrey V. Merkey
Re: Versioning file system
David Miller
Re: NO_HZ: timer interrupt stuck
git
:
Oliver Kullmann
Re: how to move with history?
Junio C Hamano
Re: [PATCH 2/3] git-add--interactive: remove hunk coalescing
Morten Welinder
Re: [PATCH] use xrealloc in help.c
Miles Bader
Re: way to automatically add untracked files?
Alex Riesen
Re: git exclude patterns for directory
linux-netdev
:
David Miller
Re: [2.6.30-rc3] powerpc: compilation error of mace module
Andreas Sundstrom
Re: ~60k interrupts/sec for 1Gb/s iperf with r8169
Denys Fedoryshchenko
Re: circular locking, mirred, 2.6.24.2
Pavel Emelyanov
Re: [PATCH 7/8] af_unix: Allow credentials to work across user and pid namespaces.
David Shwatrz
[PATCH net-next-2.6] XFRM: remove unused member in xfrm_encap_tmpl.
git-commits-head
:
Linux Kernel Mailing List
V4L/DVB: tm6000: add special usb request to quit i2c tuner transfer
Linux Kernel Mailing List
OMAP: DSS2: SDI driver
Linux Kernel Mailing List
PCI: introduce pci_pcie_cap()
Linux Kernel Mailing List
m68k: amiga - Mouse platform device conversion
Linux Kernel Mailing List
drivers/acpi: use kasprintf
openbsd-misc
:
frantisek holop
Re: mount ffs as msdos, system hangs
Ted Bullock
Re: Proliant DL380 G3 cannot get on network
Úlfar M. E. Johnson
installing openbsd in xen
Eric Furman
Re: Defending OpenBSD Performance
Damien Miller
Re: Patching a SSH 'Weakness'
Colocation donated by:
Syndicate