Return-Path: Received: from mx2.suse.de ([195.135.220.15]:52628 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751678AbcBCKuS (ORCPT ); Wed, 3 Feb 2016 05:50:18 -0500 From: Oliver Neukum To: gregkh@linuxfoundation.org, stern@rowland.harvard.edu, linux-usb@vger.kernel.org Cc: Oliver Neukum , stable@vger.kernel.org Subject: [PATCH] usb: retry reset if a device times out Date: Wed, 3 Feb 2016 11:47:44 +0100 Message-Id: <1454496464-13094-1-git-send-email-oneukum@suse.com> Sender: stable-owner@vger.kernel.org List-ID: Some devices I got show an inability to operate right after power on if they are already connected. They are beyond recovery if the descriptors are requested multiple times. So in case of a timeout we rather bail early and reset again. This patch is a rework of a patch that fell through the cracks. http://www.spinics.net/lists/linux-usb/msg103263.html Signed-off-by: Oliver Neukum CC: stable@vger.kernel.org --- drivers/usb/core/hub.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index f912fe6..2124c4e 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -4496,7 +4496,12 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, r = -EPROTO; break; } - if (r == 0) + /* + * Some devices time out if they are powered on + * when already connected. They need a second + * reset. + */ + if (r == 0 || r == -ETIMEDOUT) break; } udev->descriptor.bMaxPacketSize0 = -- 2.1.4