Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp874196pxk; Thu, 17 Sep 2020 19:58:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfiivfXjA0LPmLhL6gV046eLwxOPduuvbBQ8vCI7T4g7HCR3tCerv3TgymCrQHqGEM7s/5 X-Received: by 2002:aa7:d88a:: with SMTP id u10mr36585113edq.217.1600397902784; Thu, 17 Sep 2020 19:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600397902; cv=none; d=google.com; s=arc-20160816; b=m+7+thXs4hgsCFas3rBlfyyhmhlX7Hon8DLUDJ5SkTJYaJSR9KhBow3dgfEpV1fKOi YRx+j+Ck85RYOChP16MhHdYoAvtxzu5U9+R0OPlEwvpTqDbNQKKJ0aKkp7aKaext9Ba+ rE12FtiRVp2Q5E8C3+qF3uJA2THe/ZTck0OGWLKiOKDwV9EDrv+SuTUOwNWLXuC67E/5 OhSDHbocwYPfud9DTMzajiO8YK2neGAoUns7xpLpTwSS0TVNszx06cNfgeFCusyKYhYH 4CptT8HXKY56oZYSR6Z0esV8vIiOUA+7WG6L8a96B4L85zv+GeoQWS0JtGayNjEUWZcH NndA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CB3aS+UD3Ng0SjdT7KmFMz2/kwzmO0q4qTQkNBYLcEI=; b=hDQOJ63kT/H+FcThyCxtKPNpQU4U6LEHunZx2/IIbUFq4onk9GlNhtZeE65//H2YVx jaOMleQ9yzlqX/5oEV/5o/fP+pz31kv7BSIghylCmlUzDpQd/wkL53zzebWvYyybpqLL +7NWXp5G8kfJpUPJ2LB1hd8AYCg2zovAaXVGFlqZxhc/LSwf5aFoTwPGQmUPFvd6+UoT yaQcYdvv8J7NL3rgz4lJtOW6YrFivBVthsAtW7x6k4rBsBJO/ISVwVhB9eZfF0lOy5pW aCw3HJjZbJfd3eJcXcDuHp4eAY92hhLYA9jmSnhTu51/8TsKNF5t3cNmiM0PCHQjUaCv OunA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GAsVb4Iq; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c24si1162535edw.144.2020.09.17.19.57.59; Thu, 17 Sep 2020 19:58:22 -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=@kernel.org header.s=default header.b=GAsVb4Iq; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728039AbgIRCzv (ORCPT + 99 others); Thu, 17 Sep 2020 22:55:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:57218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727847AbgIRCHI (ORCPT ); Thu, 17 Sep 2020 22:07:08 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 90BE0239ED; Fri, 18 Sep 2020 02:06:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394819; bh=WOo5LTIppe2Gca6xK6blC/DMnMxCfbZ0tXSNUB62nEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GAsVb4IqGr+Us9PWSUYn/9QescNw5BNmQx0SKcyNoyh8rvaNZuFFeEIrfeCU1ZgGF ML4ccihzR6eoYPfsYdlIvdGDu0Cx+43pYkP8230+ISAjo44U4OFrE3n3BT17WLs/8A wUTFUuacrQcP9rPvA5JoL6SXMrw01vr6DmHOST+M= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yu Chen , John Stultz , Li Jun , Felipe Balbi , Sasha Levin , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 285/330] usb: dwc3: Increase timeout for CmdAct cleared by device controller Date: Thu, 17 Sep 2020 22:00:25 -0400 Message-Id: <20200918020110.2063155-285-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Chen [ Upstream commit 1c0e69ae1b9f9004fd72978612ae3463791edc56 ] If the SS PHY is in P3, there is no pipe_clk, HW may use suspend_clk for function, as suspend_clk is slow so EP command need more time to complete, e.g, imx8M suspend_clk is 32K, set ep configuration will take about 380us per below trace time stamp(44.286278 - 44.285897 = 0.000381): configfs_acm.sh-822 [000] d..1 44.285896: dwc3_writel: addr 000000006d59aae1 value 00000401 configfs_acm.sh-822 [000] d..1 44.285897: dwc3_readl: addr 000000006d59aae1 value 00000401 ... ... configfs_acm.sh-822 [000] d..1 44.286278: dwc3_readl: addr 000000006d59aae1 value 00000001 configfs_acm.sh-822 [000] d..1 44.286279: dwc3_gadget_ep_cmd: ep0out: cmd 'Set Endpoint Configuration' [401] params 00001000 00000500 00000000 --> status: Successful This was originally found on Hisilicon Kirin Soc that need more time for the device controller to clear the CmdAct of DEPCMD. Signed-off-by: Yu Chen Signed-off-by: John Stultz Signed-off-by: Li Jun Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 4225544342519..809103254fc64 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -270,7 +270,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd, { const struct usb_endpoint_descriptor *desc = dep->endpoint.desc; struct dwc3 *dwc = dep->dwc; - u32 timeout = 1000; + u32 timeout = 5000; u32 saved_config = 0; u32 reg; -- 2.25.1