Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2007563imm; Thu, 18 Oct 2018 07:42:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV62oree8oFIbuVpWrN/q05F1ydW953CB0aObiQmn0wlIDVr9gcdZElu42hKr+M+7d6moWELt X-Received: by 2002:a63:184a:: with SMTP id 10-v6mr28344690pgy.81.1539873739859; Thu, 18 Oct 2018 07:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539873739; cv=none; d=google.com; s=arc-20160816; b=Ct8zkOjIebNtxyUeB+kNg4aStuLDjQ6DQQXCyStrXQHxYE5IMVfYPJAO5bTYFWd+tE HfsSbi70aosnk/PYU2XGG8v8jQmJ9CTw1wcKRN0LDapr1Y2D8Laa3sGG2I3/p2P1KSXQ 8+ZLQwge5ZV2/QnEluPIHFH0T9wn930k58qkngXCE2xGaIUQvoIhvJipFN0WmDG9eSAQ 32+NQsd34SIKE5l9ekoYXk3h2PvVP7dfL5MrDR5C+McmD6WCXDz8ulqSkx6ncuPDa2Vb hJJc1r6FluFwAHLjzYVQ+lbvm/vo78h+MEDMl7Qk+lRNYmS7gMh1Qv+KaWFdEQK/AK8K f8Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=j1S/bw1W1Z0VEuYCPl9j6pqpozVNtrVPXUyJeY7w39M=; b=rPD14Nq9g6muI19qDYlaLmR64vfi7EJTxe1TzOoVraLEdG2XD/HOXkgai0kMSpzNQf fAg3MmZW0I52Lp3a4ZPvJQEv9q0c81k6wDs9ZxDo79c+lAe03fLBl74atitTQ5NJf1xk qn6wVwjPMUo+fDe1Rd2NbfthM9sdYg61Iy+RYBfFJnLsHaEJcs0UUKI8H8z2cbTEuC5J ArcFd5v2/wMBQ8v6vJrlJrdwKiuBdegjafDt/7g6eoPNha8B23lGj9MFCM9gJwgiLKKH /ET9yW5DrozMoG+n25xO2yafnyunykOmnlyMBwwxNiqPpzbwjG3Jc8i8qGgAxw0jO7AT HpCQ== 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 m17-v6si21474698pfe.187.2018.10.18.07.42.03; Thu, 18 Oct 2018 07:42:19 -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 S1728224AbeJRWNj (ORCPT + 99 others); Thu, 18 Oct 2018 18:13:39 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:45880 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1727711AbeJRWNj (ORCPT ); Thu, 18 Oct 2018 18:13:39 -0400 Received: (qmail 1665 invoked by uid 2102); 18 Oct 2018 10:12:26 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 18 Oct 2018 10:12:26 -0400 Date: Thu, 18 Oct 2018 10:12:26 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Kai-Heng Feng cc: gregkh@linuxfoundation.org, , Subject: Re: [PATCH] USB: Wait for extra delay time after USB_PORT_FEAT_RESET for quirky hub In-Reply-To: <20181018074247.6858-1-kai.heng.feng@canonical.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 18 Oct 2018, Kai-Heng Feng wrote: > Devices connected under Terminus Technology Inc. Hub (1a40:0101) may > fail to work after the system resumes from suspend: > [ 206.063325] usb 3-2.4: reset full-speed USB device number 4 using xhci_hcd > [ 206.143691] usb 3-2.4: device descriptor read/64, error -32 > [ 206.351671] usb 3-2.4: device descriptor read/64, error -32 > > Info for this hub: > T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=480 MxCh= 4 > D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1 > P: Vendor=1a40 ProdID=0101 Rev=01.11 > S: Product=USB 2.0 Hub > C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA > I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub > > Some expirements indicate that the USB devices connected to the hub are > innocent, it's the hub itself is to blame. The hub needs extra delay > time after it resets its port. > > Hence wait for extra delay, if the device is connected to this quirky > hub. > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -2891,6 +2891,11 @@ static int hub_port_reset(struct usb_hub *hub, int port1, > if (udev) { > struct usb_hcd *hcd = bus_to_hcd(udev->bus); > > + /* Hub needs extra delay after resetting its port. */ > + if (udev->parent && > + udev->parent->quirks & USB_QUIRK_HUB_SLOW_RESET) There's no need to test udev->parent, or even to put this code under the "if (udev)" test. You should simply use hub->hdev instead; it will always be defined. Alan Stern > + msleep(100); > + > update_devnum(udev, 0); > /* The xHC may think the device is already reset, > * so ignore the status.