[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <53196414.8090703@intel.com>
Date: Fri, 07 Mar 2014 14:15:48 +0800
From: "xinhui.pan" <xinhuix.pan@...el.com>
To: linux-kernel@...r.kernel.org
CC: gregkh@...uxfoundation.org, stern@...land.harvard.edu,
sarah.a.sharp@...ux.intel.com, dan.j.williams@...el.com,
burzalodowa@...il.com, yanmin_zhang@...ux.intel.com
Subject: [PATCH] usb/core/hub.c: return immediately when hub_port_init hits
timedout
From: "xinhui.pan" <xinhuiX.pan@...el.com>
some devices go crasy, we can't resume it even after reset. This case will
cause timeout again and again. What is worse, if there is a watchdog,
panic will be generated as timer expires. To prevent this, we just return
-ENODEV immediately. Later it will be re-enumerated.
Signed-off-by: xinhui.pan <xinhuiX.pan@...el.com>
---
drivers/usb/core/hub.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 64ea219..c5d0d8d 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -4141,7 +4141,7 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
r = -EPROTO;
break;
}
- if (r == 0)
+ if (r == 0 || r == -ETIMEDOUT)
break;
}
udev->descriptor.bMaxPacketSize0 =
@@ -4161,6 +4161,10 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
if (r != -ENODEV)
dev_err(&udev->dev, "device descriptor read/64, error %d\n",
r);
+ if (r == -ETIMEDOUT) {
+ retval = -ENODEV;
+ goto fail;
+ }
retval = -EMSGSIZE;
continue;
}
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists