]> git.karo-electronics.de Git - karo-tx-linux.git/commit
pcmcia: move unbind/rebind into dev_pm_ops.complete
authorChristian Lamparter <chunkeey@googlemail.com>
Tue, 14 Aug 2012 03:22:27 +0000 (13:22 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 20 Aug 2012 07:08:00 +0000 (17:08 +1000)
commit19ad5c324c5a9753eed524ff811bada8450e1e21
tree18b7d053ed16312642751a122ec7fb6ba6c21264
parent0b8e0e85368c1263f50654ce429e11e85f597eca
pcmcia: move unbind/rebind into dev_pm_ops.complete

Move the device rebind procedures for cardbus devices from the pm.resume
into the pm.complete callback.

The reason for moving the code is: "[...] The PM code needs to send
suspend and resume messages to every device in the right order, and it
can't do that if new devices are being added at the same time.  [...]"

However the situation really isn't quite that rigid.  In particular,
adding new children during a resume callback shouldn't cause much of
problem because the children don't need to be resumed anyway (since they
were never suspended).  On the other hand, if you do it you will get a
dev_warn() from the PM core, something like 'parent should not be
sleeping'.

Still, it is considered bad form and should be avoided if possible."

(Alan Stern's full comment about the topic can
be found here: <https://lkml.org/lkml/2012/7/10/254>)

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/pcmcia/cs.c