Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3078353imm; Sun, 1 Jul 2018 11:45:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpemMs/ZJm5igpa8eunzxcTCut/PlqJmt5fyjscMnmEV9vSUwo2+v6nZm8VbQPu6nbH6nFac X-Received: by 2002:a65:5b08:: with SMTP id y8-v6mr9942349pgq.297.1530470746778; Sun, 01 Jul 2018 11:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530470746; cv=none; d=google.com; s=arc-20160816; b=rDXdGUhjnvL1EUMTYv+O2QU04POhPGb5UiiPpK/fb19tt7qeJl6PcNdkDDblaIS6O8 t3MS0agc37XuyU9CvXHGcZaAv4QloqB1GJDMCjWIooeJDiOGluWHTpO/Ny9Dkg3HhEja cNVEaJD8LX8deWM/o1Bl8BCu6kuXu2og1TqjlTf1DSsWj3FVFuONT1iyfHTH0dh+Qjh9 1fEnW2czoCcxuKf6xuJQCsMIx6v7JnHh3KEiWZIzOWpX8JAmjOfap0h14aYO6WcPFyuX hLVC/3CGDwBKrYYEF6RyWU0oV8VF1O6dZNVouRxlT8lADXSa//PjC50GtbZE9j4nCoAw QZGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=QuHJnavdvYKw+vtLpx8S9sqtxYIwMKjK/58aNWa96Mk=; b=JCDmmRrJG++MJusD02tyzR7brEFwuPXau44zCefoREGaCXYYOwfg3yUYrinWJD8Hkx eLazS7Bv0Q0XF/BY9XmQxHxKQpmxBApm82vea/8/diiK5v3gVzPqesDl7Uw6EqNCzxKK oB94PyaQe1blbEwNCogIYPIJQOUOhunUKpV/1bc7TshCPKF8kjXeiolZj1CqWhCMC43X wPrrM8RPb2yBiGkku5tI14ftNP1Jsx8lUNh2B/ySB9mLGoPJHlExDWHf1mxhnF7xSPqY /mEyj/aWPehcLTnFU0xPgFAKEc/R+hA9W0mwGXpnkpZ00XcdPQxus5ZI3YSSiOEzpUeL 0IAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2-v6si14291453pln.395.2018.07.01.11.45.32; Sun, 01 Jul 2018 11:45:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932577AbeGASoH (ORCPT + 99 others); Sun, 1 Jul 2018 14:44:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60060 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932286AbeGAQNF (ORCPT ); Sun, 1 Jul 2018 12:13:05 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2FC7D86D; Sun, 1 Jul 2018 16:13:04 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Moseychuk Subject: [PATCH 3.18 49/85] usb: do not reset if a low-speed or full-speed device timed out Date: Sun, 1 Jul 2018 18:02:07 +0200 Message-Id: <20180701153124.308659074@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701153122.365061142@linuxfoundation.org> References: <20180701153122.365061142@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maxim Moseychuk commit 6e01827ed93947895680fbdad68c072a0f4e2450 upstream. Some low-speed and full-speed devices (for example, bluetooth) do not have time to initialize. For them, ETIMEDOUT is a valid error. We need to give them another try. Otherwise, they will never be initialized correctly and in dmesg will be messages "Bluetooth: hci0 command 0x1002 tx timeout" or similars. Fixes: 264904ccc33c ("usb: retry reset if a device times out") Cc: stable Signed-off-by: Maxim Moseychuk Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/hub.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -4405,7 +4405,9 @@ hub_port_init (struct usb_hub *hub, stru * reset. But only on the first attempt, * lest we get into a time out/reset loop */ - if (r == 0 || (r == -ETIMEDOUT && retries == 0)) + if (r == 0 || (r == -ETIMEDOUT && + retries == 0 && + udev->speed > USB_SPEED_FULL)) break; } udev->descriptor.bMaxPacketSize0 =