Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2965400imm; Sun, 1 Jul 2018 09:18:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKEUCE3uXpFNFO+LFZMQtkoniLFXZq3XVMSroCGVPiysUHwmlSGeBRLws7w6H+Qh6DNrBPw X-Received: by 2002:a17:902:e209:: with SMTP id ce9-v6mr22472046plb.233.1530461883191; Sun, 01 Jul 2018 09:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530461883; cv=none; d=google.com; s=arc-20160816; b=xvtQanhNYN+JyMj1i9F/0tQiR3jksZsKt/9uV2XClD4VCcuttSbfZSymmDxuLFzZIw 9VT5wCQts984KCKdGl8dpkV1hCmKHyGAJzt8TgmIppREPEK+m/Gr+PcEdfPE73tFfyFx 5n0lQlO7Z9mFfJeYblpuy1O+fbxFt7w+PCua6s3C1a32Mg/uISOWGQrStgXSc//k8xHF VtZ3oxzLBTY3FgBZ3dqo4j2Fg9/pBluVyOLVRpyK8ot7+SG9agbVdiFq9YjDshrFP0Vl DIG+8DySW6A5ynbVBeEGXM63TkXAvmnZi8J2+A0Mkj8hNCboEhFGqFStUPaq5cokwrOB MDsQ== 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=+Fftu4hy6qFi6/CBoZswAuXehxEdFqUrGSAcU6Pr/t4=; b=wt7nuZD8xDGIbaA07tcY1s6iVRvod5K1ZdqYhucjKjrwT03niskEcL//DRzKqDCWu9 q4zYiTU9tHu6jDF50D+vHF6RIBO1M1rLs9xsUM9TdiWmEg4v3zRtWgDvpT6QUlRRT5rs sOAdH4S1Wf+eG4zTeFcX6mXDN3fieuy1Sx5ZU7jTr/AmrwuW0yI65Z8nI+qoFZmkZSkU 2bcNuwY7fRr8eufkENSZQjvH8xIl1IwB7sCZoDl1dBODxAWh0Vh27CR6M2GF52GpnarB CGrPyevPlqITRAa9F1ANW3NEd2SERhKK3yuJAyacT+MaAjM2GP0nnaJW5+08WMrqOF+f rBqQ== 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 f5-v6si13699021plr.56.2018.07.01.09.17.49; Sun, 01 Jul 2018 09:18:03 -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 S933480AbeGAQQT (ORCPT + 99 others); Sun, 1 Jul 2018 12:16:19 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60740 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933324AbeGAQQO (ORCPT ); Sun, 1 Jul 2018 12:16:14 -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 CB0A0AEF; Sun, 1 Jul 2018 16:16:13 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Moseychuk Subject: [PATCH 4.4 030/105] usb: do not reset if a low-speed or full-speed device timed out Date: Sun, 1 Jul 2018 18:01:40 +0200 Message-Id: <20180701153151.484757877@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701153149.382300170@linuxfoundation.org> References: <20180701153149.382300170@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 4.4-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 @@ -4442,7 +4442,9 @@ hub_port_init(struct usb_hub *hub, struc * 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 =