Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3337627imu; Sun, 11 Nov 2018 12:41:11 -0800 (PST) X-Google-Smtp-Source: AJdET5cTU4WDamlNgkY5DV5zZBmc1iriEU/MWdi0ofFsF4FP40novdNasJvtyRc8mxeoNkRY96Ys X-Received: by 2002:a17:902:b7cc:: with SMTP id v12-v6mr16513546plz.278.1541968871188; Sun, 11 Nov 2018 12:41:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968871; cv=none; d=google.com; s=arc-20160816; b=uXhg/VKfJHBywL177bKECFs4QPK3hwLgIsicMq2mfEKJl1RWHsfdMDuOOETT1JNwfc Xblvzmg3YhBRSBcMvwEvPtgdEvZfr1YMDVbngJNIrTqwaRsckNwP2noFYbk71931m9aY Ww/ko9BRQvhMIGm7IK5X//Vs7RRvi+WHO8C43S1sHa5ZQbbMoxEu+M3sGMAuF5y6m80M SQl37UQdrvhSZobk/jTM2mGnxcvHMFuS1bYwDNgQfqPI74Bxk4pEgv8pRcUppyTfiTd1 RT2g4p6gOWEaUZO2sNoAcQalNa7+K/Q8I8fgvCwccOm9Vjqe/fIQIifNVXPvIee9iOVb jBWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=5eequvbc329hHr2tt7piDHIpT+fYczhhNkpqFXYnMO4=; b=CcRzx9khO6jeK8v8uRddSZaPi0Xfd8gDzXZpPyIXBpscFkbKE5y/RwlMwmx2/XZLfo n9myErcfGcozw7Npdz62NjKOJd8anMJHv4Swp8uLp215XeY1oON+OrAkVd/yujidFS1b hQ3mT8PpEVC6v47tDYeU1szXup9CIbVwfSIbsMah8SWKCxj2VWQJrpq/hBDijbx/dZgY ehMr48FoezRh1peK4x2+vPU/pwOSDgRL2cKFU5Lb9mRn7kOW/EQCcZtNTlKDchTT3hWQ 1SrLt5eK5qi6joVZUS9yY7e7Gp/mfDVdWOHTBWtvqt0upkLpKoe6lXc9lEAVUBoRPSy+ NCqg== 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 v1-v6si14867179plo.134.2018.11.11.12.40.56; Sun, 11 Nov 2018 12:41:11 -0800 (PST) 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 S1729929AbeKLFsF (ORCPT + 99 others); Mon, 12 Nov 2018 00:48:05 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49412 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729857AbeKLFsD (ORCPT ); Mon, 12 Nov 2018 00:48:03 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsQ-0000lF-FD; Sun, 11 Nov 2018 19:58:34 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsO-0001O7-48; Sun, 11 Nov 2018 19:58:32 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Greg Kroah-Hartman" , "Maxim Moseychuk" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 026/366] usb: do not reset if a low-speed or full-speed device timed out In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 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") Signed-off-by: Maxim Moseychuk Signed-off-by: Greg Kroah-Hartman Signed-off-by: Ben Hutchings --- 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 @@ -4381,7 +4381,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 =