Skip to content

Commit

Permalink
[PATCH] usbcore: allow suspend/resume even if drivers don't support it
Browse files Browse the repository at this point in the history
This patch (as618) changes usbcore to prevent derailing the
suspend/resume sequence when a USB driver doesn't include support for
it.  This is a workaround rather than a true fix; the core needs to be
changed so that URB submissions from suspended drivers can be refused
and outstanding URBs cancelled.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Alan Stern authored and Linus Torvalds committed Dec 21, 2005
1 parent 28120be commit 5a9191f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/usb/core/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,8 @@ static int usb_generic_suspend(struct device *dev, pm_message_t message)
mark_quiesced(intf);
} else {
// FIXME else if there's no suspend method, disconnect...
dev_warn(dev, "no %s?\n", "suspend");
dev_warn(dev, "no suspend for driver %s?\n", driver->name);
mark_quiesced(intf);
status = 0;
}
return status;
Expand Down Expand Up @@ -1460,8 +1461,10 @@ static int usb_generic_resume(struct device *dev)
}

if ((dev->driver == NULL) ||
(dev->driver_data == &usb_generic_driver_data))
(dev->driver_data == &usb_generic_driver_data)) {
dev->power.power_state.event = PM_EVENT_FREEZE;
return 0;
}

intf = to_usb_interface(dev);
driver = to_usb_driver(dev->driver);
Expand All @@ -1481,7 +1484,7 @@ static int usb_generic_resume(struct device *dev)
mark_quiesced(intf);
}
} else
dev_warn(dev, "no %s?\n", "resume");
dev_warn(dev, "no resume for driver %s?\n", driver->name);
return 0;
}

Expand Down

0 comments on commit 5a9191f

Please sign in to comment.