From patchwork Wed Feb 3 01:08:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Youn X-Patchwork-Id: 8196711 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 24069BEEE5 for ; Wed, 3 Feb 2016 01:08:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 539F220251 for ; Wed, 3 Feb 2016 01:08:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [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 65D3720219 for ; Wed, 3 Feb 2016 01:08:28 +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 1aQlvl-0001yK-Mr; Wed, 03 Feb 2016 01:08:25 +0000 Received: from smtprelay4.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aQlvk-0001wB-BB for linux-rockchip@lists.infradead.org; Wed, 03 Feb 2016 01:08:24 +0000 Received: from dc8secmta1.synopsys.com (dc8secmta1.synopsys.com [10.13.218.200]) by smtprelay.synopsys.com (Postfix) with ESMTP id DFCAD24E1094; Tue, 2 Feb 2016 17:08:02 -0800 (PST) Received: from dc8secmta1.internal.synopsys.com (dc8secmta1.internal.synopsys.com [127.0.0.1]) by dc8secmta1.internal.synopsys.com (Service) with ESMTP id D30F427113; Tue, 2 Feb 2016 17:08:02 -0800 (PST) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by dc8secmta1.internal.synopsys.com (Service) with ESMTP id 8922E27102; Tue, 2 Feb 2016 17:08:02 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 6DBAFD13; Tue, 2 Feb 2016 17:08:02 -0800 (PST) Received: from us01wehtc1.internal.synopsys.com (us01wehtc1-vip.internal.synopsys.com [10.12.239.236]) by mailhost.synopsys.com (Postfix) with ESMTP id 1A699D05; Tue, 2 Feb 2016 17:08:02 -0800 (PST) Received: from US01WEMBX2.internal.synopsys.com ([fe80::e4b6:5520:9c0d:250b]) by us01wehtc1.internal.synopsys.com ([::1]) with mapi id 14.03.0195.001; Tue, 2 Feb 2016 17:08:01 -0800 From: John Youn To: Caesar Wang , John Youn Subject: Re: [Bug] usb: dwc2: Add functions to set and clear force mode Thread-Topic: [Bug] usb: dwc2: Add functions to set and clear force mode Thread-Index: AQHRWDFuu5C0z9MHP0KJ6E5GOWNqAQ== Date: Wed, 3 Feb 2016 01:08:01 +0000 Message-ID: <2B3535C5ECE8B5419E3ECBE30077290901DC4322F0@US01WEMBX2.internal.synopsys.com> References: <56A7603C.1000409@rock-chips.com> <56A8277F.9@gmail.com> <56AF3D80.90807@gmail.com> <56AF3DCB.20808@gmail.com> <2B3535C5ECE8B5419E3ECBE30077290901DC42FD26@US01WEMBX2.internal.synopsys.com> <56B01785.3030803@163.com> <56B01A0C.3070801@gmail.com> <2B3535C5ECE8B5419E3ECBE30077290901DC431FDB@US01WEMBX2.internal.synopsys.com> <56B14B6D.1060808@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.10.161.156] MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160202_170824_422328_41E90FAF X-CRM114-Status: GOOD ( 10.33 ) X-Spam-Score: -2.3 (--) 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: "Huang, Tao" , Heiko Stuebner , Doug Anderson , Felipe Balbi , "open list:ARM/Rockchip SoC..." , =?gb2312?B?zuLBvLfl?= Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 On 2/2/2016 4:36 PM, Caesar Wang wrote: > Hi John, > > ? 2016?02?03? 08:03, John Youn ??: >> On 2/1/2016 6:53 PM, Caesar Wang wrote: >>> John, >>> >>> I will suggest the msleep(25) delay should put in >>> 'dwc2_force_dr_mode()' instead of the 'dwc2_clear_force_mode()' >>> >> Hi Caesar, >> >> Are you saying that just msleep(25) in that function like this solves >> your issue? >> >> diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c >> index 39a0fa8..e8a9688 100644 >> --- a/drivers/usb/dwc2/core.c >> +++ b/drivers/usb/dwc2/core.c >> @@ -625,6 +625,8 @@ void dwc2_force_dr_mode(struct dwc2_hsotg *hsotg) >> __func__, hsotg->dr_mode); >> break; >> } >> + >> + msleep(25); > > Yep, that will solve this issue. > Ok thanks. Though that still seems strange since you should be getting the msleep(25) from either the dwc2_force_mode() or dwc2_clear_force_mode(). Can you check if the following patch works? If so, I think we can go with that to fix the regression for now. Otherwise I'll just add the extra msleep(25) and revisit this later. Regards, John ---->8---- Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index e991d55..13c060c 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c @@ -576,7 +576,6 @@ static bool dwc2_force_mode(struct dwc2_hsotg *hsotg, bool host) gusbcfg |= set; dwc2_writel(gusbcfg, hsotg->regs + GUSBCFG); - msleep(25); return true; } @@ -596,7 +595,6 @@ static void dwc2_clear_force_mode(struct dwc2_hsotg *hsotg) * NOTE: This long sleep is _very_ important, otherwise the core will * not stay in host mode after a connector ID change! */ - msleep(25); } /* @@ -619,6 +617,8 @@ void dwc2_force_dr_mode(struct dwc2_hsotg *hsotg) __func__, hsotg->dr_mode); break; } + + msleep(25); } _______________________________________________ Linux-rockchip mailing list