From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C488C2B9F4 for ; Tue, 22 Jun 2021 19:56:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E542610C7 for ; Tue, 22 Jun 2021 19:56:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232758AbhFVT6n (ORCPT ); Tue, 22 Jun 2021 15:58:43 -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