]> git.baikalelectronics.ru Git - kernel.git/commit
USB: Don't rebind before "complete" callback
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 12 Aug 2008 18:34:14 +0000 (14:34 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 21 Aug 2008 17:26:37 +0000 (10:26 -0700)
commit458c000e1f36f971fb0d5e437d2a1cddc27f4fbf
treea1ed2e8486837fd2f0751802e7602c33f3b9fe8c
parent5d7d1b36779f6d5aded8f3fadbf178ca831c3e4c
USB: Don't rebind before "complete" callback

This patch (as1130) fixes an incompatibility between the new PM
infrastructure and USB power management.  We are not allowed to call
drivers' probe routines during a system sleep transition between the
"prepare" and "complete" callbacks, but that's exactly what we do when
a driver doesn't have full suspend/resume support.  Such drivers are
unbound during the "suspend" call and reprobed during the "resume" call.

The patch causes the reprobe step to be skipped if the "complete"
callback hasn't been issued yet, i.e., if the interface's
dev.power.status field is not equal to DPM_ON.  Thus during the
"resume" callback nothing bad will happen, and during the final
"complete" callback the reprobing will occur as desired.

This fixes the problem reported in Bugzilla #11263.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/driver.c