Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp201766imw; Tue, 12 Jul 2022 17:46:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ssQtNNBaQNMFso9EUq5sInoBKop/vyoiZjvuDlKiFVzIJ2CB0E+OsJnvCX3qaF7zoih0Dx X-Received: by 2002:a17:907:7395:b0:72b:86f2:4fd5 with SMTP id er21-20020a170907739500b0072b86f24fd5mr856208ejc.332.1657673183593; Tue, 12 Jul 2022 17:46:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657673183; cv=none; d=google.com; s=arc-20160816; b=DfnJ7ToCFsHRS4nzzVj8yHzM5bzYjsd0SYIlRrNLXu1kfDEAisoArwUEvYsnk+y8bu XGFBdJzVdpSZwahrry0MuK6aaM4YZEq6p2EOmr7T/ugLCx/4R7xIjUT2AghKqcBX4J+i AzURD5qTAcNd870enU9Ft0l6HV9sf4nllbVw0D0Q8bFsaTQIr+/Hoo5fYPJGIO/Rgl4y C8LyizL7Pac3KkmNJ04iHEjfgo1oy6j2YmhZEE78bbEQ97EKn80heEwEfZlFHvP4XhWB jzB4VgsxRSp9epD+PBB5+Kx2ltWQoWAfU6phrDxWkPTefSD4lV7TIl5Wi/6svH172Lj8 9arQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=qOyFfpgyEs6TjmSz4DphLJfxU0C1RiCtDCMaIsEBq8w=; b=nr+OT1NCig2W21qrM1Ta7VueW/wKvAtcFEqJiPrLbBSjOk01RqJV50+94JlbgeS8A0 xVAt9MOfZtQqqfEEelco/17//wADZ9IFMfWMaV3H60Dtvcvn4+EvPq2bdMsLoyFztc8R R0GQfA7LwEQYesuwBt6CKqbzBr3MdNBIHjo+VrNMmhrgNcuF7VwNTRpiGhq6mfGaQZfZ 7vk0W2kUBZ15CK5ZpT82rznjA6R1MdRYDy2Z5cPB28nIYF4lG6jDoGLg+hv4AiO894zj UiX/jYBhC/V8j0VctG9jAe0wdiU9Qpi06XodA/kYkwKE0NhsmNvw1LsUw1zgKWLxvsy0 BRqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=zXYcAjHT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb34-20020a1709076da200b0072b36dc02dfsi3356498ejc.262.2022.07.12.17.45.51; Tue, 12 Jul 2022 17:46:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=zXYcAjHT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231852AbiGMAgN (ORCPT + 99 others); Tue, 12 Jul 2022 20:36:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230491AbiGMAf5 (ORCPT ); Tue, 12 Jul 2022 20:35:57 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 261718688A; Tue, 12 Jul 2022 17:35:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1657672557; x=1689208557; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=qOyFfpgyEs6TjmSz4DphLJfxU0C1RiCtDCMaIsEBq8w=; b=zXYcAjHTaQcdHFS/ki9qIA3A7uZP1cezlCVOkuaOL2/kcGhzmKh7Mb7W TMxdLR8y1Rpixfp6lOC47RyszAPHUxLlUSLCK7/XCXpbr5lIg7p/oO8RM MSP7J/JFgBeI6WP6YlTAr8x4IQh91ciV53bggjtIn017EeHx2OjzMupF9 g=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-01.qualcomm.com with ESMTP; 12 Jul 2022 17:35:54 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jul 2022 17:35:54 -0700 Received: from nalasex01b.na.qualcomm.com (10.47.209.197) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 12 Jul 2022 17:35:37 -0700 Received: from hu-wcheng-lv.qualcomm.com (10.49.16.6) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 12 Jul 2022 17:35:37 -0700 From: Wesley Cheng To: , CC: , , , , Wesley Cheng Subject: [PATCH v2 5/5] usb: dwc3: gadget: Increase DWC3 controller halt timeout Date: Tue, 12 Jul 2022 17:35:23 -0700 Message-ID: <20220713003523.29309-6-quic_wcheng@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220713003523.29309-1-quic_wcheng@quicinc.com> References: <20220713003523.29309-1-quic_wcheng@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nalasex01b.na.qualcomm.com (10.47.209.197) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since EP0 transactions need to be completed before the controller halt sequence is finished, this may take some time depending on the host and the enabled functions. Increase the controller halt timeout, so that we give the controller sufficient time to handle EP0 transfers. Fixes: 861c010a2ee1 ("usb: dwc3: gadget: Refactor pullup()") Suggested-by: Thinh Nguyen Signed-off-by: Wesley Cheng --- Link: https://lore.kernel.org/linux-usb/4988ed34-04a4-060a-ccef-f57790f76a2b@synopsys.com/ drivers/usb/dwc3/gadget.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 41b7007358de..e32d7293c447 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2476,6 +2476,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend) dwc3_gadget_dctl_write_safe(dwc, reg); do { + msleep(1); reg = dwc3_readl(dwc->regs, DWC3_DSTS); reg &= DWC3_DSTS_DEVCTRLHLT; } while (--timeout && !(!is_on ^ !reg));