From patchwork Mon Feb 15 23:30:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Youn X-Patchwork-Id: 8319851 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 70AD69F6E4 for ; Mon, 15 Feb 2016 23:25:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8DD42202EC for ; Mon, 15 Feb 2016 23:25:34 +0000 (UTC) Received: from bombadil.infradead.org (unknown [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A6C4820390 for ; Mon, 15 Feb 2016 23:25:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVSW5-00010V-IJ; Mon, 15 Feb 2016 23:25:17 +0000 Received: from smtprelay2.synopsys.com ([198.182.60.111] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aVSW1-00083Z-2t for linux-rockchip@lists.infradead.org; Mon, 15 Feb 2016 23:25:15 +0000 Received: from dc8secmta2.synopsys.com (dc8secmta2.synopsys.com [10.13.218.202]) by smtprelay.synopsys.com (Postfix) with ESMTP id C137610C1319; Mon, 15 Feb 2016 15:24:51 -0800 (PST) Received: from dc8secmta2.internal.synopsys.com (dc8secmta2.internal.synopsys.com [127.0.0.1]) by dc8secmta2.internal.synopsys.com (Service) with ESMTP id B41B1A4112; Mon, 15 Feb 2016 15:24:51 -0800 (PST) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by dc8secmta2.internal.synopsys.com (Service) with ESMTP id 79F8EA4102; Mon, 15 Feb 2016 15:24:51 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 63A58BC8; Mon, 15 Feb 2016 15:24:51 -0800 (PST) Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) by mailhost.synopsys.com (Postfix) with ESMTP id 4E359BC7; Mon, 15 Feb 2016 15:24:50 -0800 (PST) Received: from US01WEHTC1.internal.synopsys.com (10.12.239.235) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 15 Feb 2016 15:24:50 -0800 Received: from (10.10.161.83) by us01wehtc1.internal.synopsys.com (10.12.239.231) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 15 Feb 2016 15:24:42 -0800 Received: by (sSMTP sendmail emulation); Mon, 15 Feb 2016 15:30:20 -0800 Date: Mon, 15 Feb 2016 15:30:20 -0800 Message-ID: <205d8514e547231b928b14c4e61d12feb2e9a0c3.1455576846.git.johnyoun@synopsys.com> From: John Youn To: Felipe Balbi Subject: [PATCH v2] usb: dwc2: Add extra delay when forcing dr_mode MIME-Version: 1.0 X-Originating-IP: [10.10.161.83] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160215_152513_153238_05615DFB X-CRM114-Status: GOOD ( 10.96 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Caesar Wang , Tao Huang , Heiko Stuebner , linux-usb@vger.kernel.org, Doug Anderson , John.Youn@synopsys.com, linux-rockchip@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RDNS_NONE,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixes an issue found on rockchip rk3036 and rk3188 SOC platforms. For some reason, the existing msleep(25) is not enough after the force mode. The following patch was reported to fix the issue. This does increase the probe delay again slightly, but not up to the level it was before the original series of patches that this fixes. It does not cause any other issues when tested on Synopsys HAPS and Altera socfpga platforms. Need to revisit this series next release to see if we can address these issues without having an unconditional delay. Fixes: 09c96980dc72 ("usb: dwc2: Add functions to set and clear force mode") Reported-by: Caesar Wang Reported-by: Michael Niewoehner Tested-by: Caesar Wang Signed-off-by: John Youn --- Hi Felipe, This fixes a problem introduced in 4.5-rc1. Could you please queue for the next -rc? Thanks, John v2: - Upped the delay to 50 ms for rk3188. Reported by Michael Niewoehner. drivers/usb/dwc2/core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index e991d55..46c4ba7 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c @@ -619,6 +619,12 @@ void dwc2_force_dr_mode(struct dwc2_hsotg *hsotg) __func__, hsotg->dr_mode); break; } + + /* + * NOTE: This is required for some rockchip soc based + * platforms. + */ + msleep(50); } /*