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,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 2F230C432BE for ; Thu, 26 Aug 2021 15:30:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ECAF160E0B for ; Thu, 26 Aug 2021 15:30:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org ECAF160E0B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FFKIoT2Y2IeVso9GwvmE2zHFoQ4LvnSTXMjXDHU1dbk=; b=Gc/ahzHB4lWCWg kNayvJvAXRDjwLa686n7rGfOgO1HEfdKRDst+snnIpCLfxyhm13/rQNFStj39vxPTHEfmp2tLeMcH nIRUUDDD1e5tJhL8NYDuFaxJREccpgq2fNvnvCcWDBlueJ/VmebWLcazrwYalPSJ6X62apL6tbJRH vDK4YMkyP7KzSVe6oVBTMl6PuwSti8u0iQXHLAhU9JwNYtVoMQFKP6YMwyUwnQQuPLB31EOCHUQXz BeXj2xagxvLY9VFF8f1g/kdk5zQz3Uzr+9b2PK0zxwCdrJ5lftC4lTvmZan6YDmnr8kcCkfsvPpjM 9QKPsLSINNrNl1x8gnMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJHIv-00AU3Z-Ds; Thu, 26 Aug 2021 15:28:33 +0000 Received: from netrider.rowland.org ([192.131.102.5]) by bombadil.infradead.org with smtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mJHIr-00AU2C-BG for linux-arm-kernel@lists.infradead.org; Thu, 26 Aug 2021 15:28:31 +0000 Received: (qmail 230582 invoked by uid 1000); 26 Aug 2021 11:28:24 -0400 Date: Thu, 26 Aug 2021 11:28:24 -0400 From: Alan Stern To: neal_liu Cc: Greg Kroah-Hartman , Tony Prisk , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tao Ren , BMC-SW@aspeedtech.com Subject: Re: [PATCH] usb: host: ehci: skip STS_HALT check for aspeed platform Message-ID: <20210826152824.GC228824@rowland.harvard.edu> References: <20210826071525.27651-1-neal_liu@aspeedtech.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210826071525.27651-1-neal_liu@aspeedtech.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210826_082829_581942_897CB3DC X-CRM114-Status: GOOD ( 18.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Aug 26, 2021 at 03:15:25PM +0800, neal_liu wrote: > STS_HALT also depends on ASS/PSS status for apseed. > Skip this check on startup. > > Signed-off-by: neal_liu > --- > drivers/usb/host/ehci-hcd.c | 10 +++++++++- > drivers/usb/host/ehci-platform.c | 6 ++++++ > drivers/usb/host/ehci.h | 1 + > 3 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c > index 10b0365f3439..a539e11502ef 100644 > --- a/drivers/usb/host/ehci-hcd.c > +++ b/drivers/usb/host/ehci-hcd.c > @@ -634,7 +634,15 @@ static int ehci_run (struct usb_hcd *hcd) > /* Wait until HC become operational */ > ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */ > msleep(5); > - rc = ehci_handshake(ehci, &ehci->regs->status, STS_HALT, 0, 100 * 1000); > + > + /* For Aspeed, STS_HALT also depends on ASS/PSS status. > + * Skip this check on startup. > + */ > + if (ehci->is_aspeed) > + rc = 0; > + else > + rc = ehci_handshake(ehci, &ehci->regs->status, STS_HALT, > + 0, 100 * 1000); You must not do this. You are assuming the controller will always begin operating within 5 ms of the time it is told to start. What happens if you are wrong? There must be some way for the aspeed controller's host computer to tell when the controller has started running. Find out what it is and use it. Alan Stern _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel