Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3064305imm; Sun, 1 Jul 2018 11:24:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKFnQcfDnjQ3jelXs4QBfG392AwwvKUjbWeX8SZj+7IDcW8gZKuQRUmmOHRMg1UT4YrRQcJ X-Received: by 2002:a17:902:3124:: with SMTP id w33-v6mr22909363plb.235.1530469465571; Sun, 01 Jul 2018 11:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530469465; cv=none; d=google.com; s=arc-20160816; b=Ngdc8DxCs1JcFhtf9ScF8WSc8d3XnkMQjFE+mK62yTNYAoqkiChKMYSWOXZuDJdIHi Tw17egsoqnjpQ6LVy/F9OXfQ833HaGWk30igTX2ySLe2zjazuaXA0nHKZnA46waWk3rO Eyifnkl2g91Tt6jK2d46poskhSsPp5600OVCOdC+M4iCIH625rvJNg+csUIdm5p/zd4V SOi+xktM+m5E+ZOSRbF0I88QBaF+T3+JP6baNsIW26mluUjaJhKdjtCf0PKtiamkMb+d amWGebTdqCByjRLjmaRpDRqfSOjczdVsLtN/8jMaXD1O0pBSPXW3IIddurjPjmBbhjeY WgkA== 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=guScQ2jqcGRF79dT7ONkXBpRTIHJAylXPBK5PrWTNc0=; b=EJy7gPXHIZ2QjBYiO5FpKBkDFCXkmEDqt1FL2FEvTjJVLLsrL388QFVhlAr4W/aGFD YHLxj8jszoc8u7I212miIU6OKCqdNgCOb2YOPrfJw+ruKzxSGGOu3DY4+xecXoqYL/4Z X+R5ED2BBtwqHAUd/G40mn6NBOnFbebIZg6E651Fy7YEXc+YVWWt6uB8kowcnk9OMzfC XJ8hEmvTWg4rrbQjCQxoNr3MaLG09WvDeKLCDh6mvmiGY09eu+wFxOx0K0XapieJwfQS R7sqyA86k3OoGeTpSBMG3QCi2xfAOPL9MnlLDRUlxNe8U+CR5ay8T11cBrpCzWrQHDp8 vktw== 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 f8-v6si15561858plb.381.2018.07.01.11.24.11; Sun, 01 Jul 2018 11:24:25 -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 S933792AbeGAQY1 (ORCPT + 99 others); Sun, 1 Jul 2018 12:24:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33428 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753508AbeGAQYV (ORCPT ); Sun, 1 Jul 2018 12:24:21 -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 7C911AD8; Sun, 1 Jul 2018 16:24:20 +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.9 010/101] usb: do not reset if a low-speed or full-speed device timed out Date: Sun, 1 Jul 2018 18:20:56 +0200 Message-Id: <20180701160757.551199326@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160757.138608453@linuxfoundation.org> References: <20180701160757.138608453@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.9-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 @@ -4509,7 +4509,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 =