History

Revert "USB / PM: Allow USB devices to remain runtime-suspended when sleeping"

This reverts commit e3345db85068ddb937fc0ba40dfc39c293dad977, which broke system resume for a large class of devices. Devices that after having been reset during resume need to be rebound due to a missing reset_resume callback, are now left in a suspended state. This specifically broke resume of common USB-serial devices, which are now unusable after system suspend (until disconnected and reconnected) when USB persist is enabled. During resume, usb_resume_interface will set the needs_binding flag for such interfaces, but unlike system resume, run-time resume does not honour it.

Johan Hovold committed 10 years ago

Commit 9be427e1 parent 550af792 files · +1 −13Browse files

Unified · Split

2 files
  1. drivers/usb/core/port.c +0 −6
  2. drivers/usb/core/usb.c +1 −7
drivers/usb/core/port.c+0−6
@@ -249,18 +249,12 @@ static int usb_port_runtime_suspend(struct device *dev) · 248 unmodified lines
249 249
250 return retval;250 return retval;
251}251}
252
253static int usb_port_prepare(struct device *dev)
254{
255 return 1;
256}
257#endif252#endif
258 253
259static const struct dev_pm_ops usb_port_pm_ops = {254static const struct dev_pm_ops usb_port_pm_ops = {
260#ifdef CONFIG_PM255#ifdef CONFIG_PM
261 .runtime_suspend = usb_port_runtime_suspend,256 .runtime_suspend = usb_port_runtime_suspend,
262 .runtime_resume = usb_port_runtime_resume,257 .runtime_resume = usb_port_runtime_resume,
263 .prepare = usb_port_prepare,
264#endif258#endif
265};259};
266 260
drivers/usb/core/usb.c+1−7
@@ -312,13 +312,7 @@ static int usb_dev_uevent(struct device *dev, struct kobj_uevent_env *env) · 311 unmodified lines
312 312
313static int usb_dev_prepare(struct device *dev)313static int usb_dev_prepare(struct device *dev)
314{314{
315 struct usb_device *udev = to_usb_device(dev);315 return 0; /* Implement eventually? */
316
317 /* Return 0 if the current wakeup setting is wrong, otherwise 1 */
318 if (udev->do_remote_wakeup != device_may_wakeup(dev))
319 return 0;
320
321 return 1;
322}316}
323 317
324static void usb_dev_complete(struct device *dev)318static void usb_dev_complete(struct device *dev)