Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3021073imm; Sun, 1 Jul 2018 10:27:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIIYa7tC4HjpPgoq99DNLlqNEfMbQyH94kr6PMxtqxMz8J/YKz12Ilg6dXHOa6QTO/tCDIw X-Received: by 2002:a17:902:9681:: with SMTP id n1-v6mr23511590plp.244.1530466062980; Sun, 01 Jul 2018 10:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530466062; cv=none; d=google.com; s=arc-20160816; b=xyFR8sUpEmBMaFWJkHCiMUttisqf6K8nMBJ3yklhnzfchem3BHpOZRbUzS+hL2myJH M0POf/n1sgMbdg5LMFMF0mw7sj4v5NKw8gkAfffWj46E8v5xgRW7eOOwxt0CGzR5kFnQ pvpOOKg9HAoqj+2KR0Pnfxc4Ong5DbHO3MWJGUjsHNuV2TVpXf6PyYN5OyGj2nSKizlD 4H1OINvdh/IqCCZapBBXYNikRGKTrxcNiQVrPV57fqxp9OjH6XK9T4PQtC6/x8ojmF/n tQzdxCxLADRkvNQ3Zl59n1yUbyuMA/rTf3h1YB9mQ2SnLYJSgNgr3ii5Q7VfdR/PFQwZ esYQ== 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=270HdzVMXI5MHsmKxUNuwBHcIWjv0Y9SFedgsnl1Dm0=; b=Q9wWI9ps9TPDktD4ESocfCt9qbxzQKg9MP//NMnj7DMFkolxo0Wakacp3I4+0o6ABC fkmMrxlvvHZJ5Xl6FTmbk8tylPAzBcjraHITnvjxhczN2OGG/uZpYYjgJ6x+N5X9hJn8 nUMM1hU986n16s6HB8yQ1FpKBWIrKbjvVcl4znln9+QxF9GgAul2IsM4RhQIypiqfEGd m9puqQSRxZuKMVyOMY1l2bW9DdZgKYfwql7DSEQLNpLSAdU0yxGtXmayPjbrVvV7VBxg S3mg/1goBXZkm5xYR2m09kpj0dR0AZAizZM0qNkg4xmsJlPo8pEARH9NhTf7usE2QZgl VZzA== 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 p18-v6si14139960pfe.150.2018.07.01.10.27.28; Sun, 01 Jul 2018 10:27:42 -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 S1031202AbeGAR0a (ORCPT + 99 others); Sun, 1 Jul 2018 13:26:30 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36304 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031434AbeGAQhc (ORCPT ); Sun, 1 Jul 2018 12:37:32 -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 B68E8AA6; Sun, 1 Jul 2018 16:37:31 +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.17 024/220] usb: do not reset if a low-speed or full-speed device timed out Date: Sun, 1 Jul 2018 18:20:48 +0200 Message-Id: <20180701160909.361263127@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@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.17-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 @@ -4551,7 +4551,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 =