Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5006455pxj; Tue, 22 Jun 2021 12:57:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBFsvxdlt/4gc9rOnlr6kcJoZw8fhSkmLK6e24mDG6dwFTtT9k21C4cyWHjTsGrUW6sNIR X-Received: by 2002:a05:6402:b6a:: with SMTP id cb10mr7424348edb.275.1624391868706; Tue, 22 Jun 2021 12:57:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624391868; cv=none; d=google.com; s=arc-20160816; b=RwFW2DtxNn20WF6/BrNTBl5mJE6ARXEyIzhyFHXRoL0JiWW/GUpZToZiFjTrixXFhz BWC4G7ejxTAqnZ1gho/xhyMt9cJMBGHRH1LkYC5Rnn3oj0in/XfEFnnvZjA+jMOko85w F9U0oa2fKy0N2pMB/cWzRy9h8GESYB6h5gX/CyY2A00MlK3tXgaYvq6oGz5LcgSqd5hm C9J5WueGg74aKAohvQoqXM56HJ5JU+UkQmw22GReM8hfCXA09d4l7JILxZ4vR45CI5QX ougG+iEWy4fljY2J/odk+LJOPg6mlz6Am/v/TQYCdsDDMhs1gxfdvRzbAgHXjBAp5l+O Bk4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5oNF3Efp/Hp2zOV939yZKDsZm21QzzvEluVQGcfvOd0=; b=IWBl+NdWVQnyZkB21tIix13/8de7ovup9ewvMo+b5o/1HBQZSXmxDkrvofMyJfTlg6 pvC5j4cMlckkPPen9FBj3KBLJPTg6R/PrPF1u5JY+ysWaoEKdweOkGfMQP5wpF7qTe+9 iddj5RmffcCYInQf+u3NvQaKgzaV39jx/WcRc4fakmqpcVVTqvpuz76Smmx5QEJ0ckCP YPiXQkRBGlpL9QiuCWC7eSmqtJr4r4m4+IZNhVRGfb423CXGJGjBD1TtfBrAYA+/u2RS 3+PrCV8OuCNR5cufEoQImYFI6Zp6SNYkqxVBADBG+ys4cu81sDoqT20jr/SaVfub0oz2 CQ7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nc6wVvjs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb13si3510421edb.290.2021.06.22.12.57.24; Tue, 22 Jun 2021 12:57:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nc6wVvjs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232713AbhFVT6l (ORCPT + 99 others); Tue, 22 Jun 2021 15:58:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:36798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231726AbhFVT6k (ORCPT ); Tue, 22 Jun 2021 15:58:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5965F6100B; Tue, 22 Jun 2021 19:56:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624391782; bh=LyYRwhLs+JRdEP5xKhL9L3kwtUp9LtMKTUuL1voWUnI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nc6wVvjslJbKHAsLCOm5PtRWWXx7gVsFj8vTiTi3OfX7IVzIunNVftSgFaLe6xtlP bgeOA6xb167WmvUxlavsFjSMiU0tTK9DOwVbf08UnSF6bSZQFygtAdsiJ6kQG+QpNW CHofzexvPV2vA46eGeG/KvAK530z7fFcPwF9HSQk= Date: Tue, 22 Jun 2021 21:56:20 +0200 From: Greg Kroah-Hartman To: Daehwan Jung Cc: Mathias Nyman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: usb: host: Reduce xhci_handshake timeout in xhci_reset Message-ID: References: <1624361096-41282-1-git-send-email-dh10.jung@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1624361096-41282-1-git-send-email-dh10.jung@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 22, 2021 at 08:24:56PM +0900, Daehwan Jung wrote: > It seems 10 secs timeout is too long in general case. A core would wait for > 10 secs without doing other task and it can be happended on every device. Only if the handshake does not come back sooner, right? What is causing your device to timeout here? > It's better to reduce timeout for general case and use new quirk if needed. What new quirk? And why 1 second, where did that number come from? > > Signed-off-by: Daehwan Jung > --- > drivers/usb/host/xhci.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c > index 9248ce8..0a1b6be 100644 > --- a/drivers/usb/host/xhci.c > +++ b/drivers/usb/host/xhci.c > @@ -196,7 +196,7 @@ int xhci_reset(struct xhci_hcd *xhci) > udelay(1000); > > ret = xhci_handshake(&xhci->op_regs->command, > - CMD_RESET, 0, 10 * 1000 * 1000); > + CMD_RESET, 0, 1 * 1000 * 1000); > if (ret) > return ret; > > @@ -210,7 +210,7 @@ int xhci_reset(struct xhci_hcd *xhci) > * than status until the "Controller Not Ready" flag is cleared. > */ > ret = xhci_handshake(&xhci->op_regs->status, > - STS_CNR, 0, 10 * 1000 * 1000); > + STS_CNR, 0, 1 * 1000 * 1000); With this change, what "goes faster"? What is currently causing problems with your host controller that this timeout value actually matters? Why is it failing? thanks, greg k-h