2.6.35-longterm review patch.  If anyone has any objections, please let me know.

------------------
From: Ming Lei <[email protected]>

commit b0786b430c982dffbb44d8030e6b6088671ce745 upstream.

Since usbnet already took usb runtime pm, we have to
enable runtime pm for usb interface of usbnet, otherwise
usb_autopm_get_interface may return failure and cause
'ifconfig usb0 up' failed if USB_SUSPEND(RUNTIME_PM) is
enabled.

Cc: David Brownell <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Ben Hutchings <[email protected]>
Cc: Joe Perches <[email protected]>
Cc: Oliver Neukum <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Andi Kleen <[email protected]>

---
 drivers/net/usb/usbnet.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

Index: linux/drivers/net/usb/usbnet.c
===================================================================
--- linux.orig/drivers/net/usb/usbnet.c
+++ linux/drivers/net/usb/usbnet.c
@@ -44,6 +44,7 @@
 #include <linux/usb.h>
 #include <linux/usb/usbnet.h>
 #include <linux/slab.h>
+#include <linux/pm_runtime.h>
 
 #define DRIVER_VERSION         "22-Aug-2005"
 
@@ -1272,6 +1273,16 @@ usbnet_probe (struct usb_interface *udev
        struct usb_device               *xdev;
        int                             status;
        const char                      *name;
+       struct usb_driver       *driver = to_usb_driver(udev->dev.driver);
+
+       /* usbnet already took usb runtime pm, so have to enable the feature
+        * for usb interface, otherwise usb_autopm_get_interface may return
+        * failure if USB_SUSPEND(RUNTIME_PM) is enabled.
+        */
+       if (!driver->supports_autosuspend) {
+               driver->supports_autosuspend = 1;
+               pm_runtime_enable(&udev->dev);
+       }
 
        name = udev->dev.driver->name;
        info = (struct driver_info *) prod->driver_info;

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to