lkml.org 
[lkml]   [2005]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 2/2] usbcore: allow suspend/resume even if drivers don't support it
From: Alan Stern <stern@rowland.harvard.edu>

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>

---
drivers/usb/core/usb.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

--- gregkh-2.6.orig/drivers/usb/core/usb.c
+++ gregkh-2.6/drivers/usb/core/usb.c
@@ -1432,7 +1432,8 @@ static int usb_generic_suspend(struct de
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;
@@ -1460,8 +1461,10 @@ static int usb_generic_resume(struct 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);
@@ -1481,7 +1484,7 @@ static int usb_generic_resume(struct 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;
}

-
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/
\
 
 \ /
  Last update: 2005-12-21 23:31    [W:4.966 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site