From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751872AbcFWHmR (ORCPT ); Thu, 23 Jun 2016 03:42:17 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:39725 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750954AbcFWHmN convert rfc822-to-8bit (ORCPT ); Thu, 23 Jun 2016 03:42:13 -0400 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'208";a="214075904" From: Yoshihiro Shimoda To: Roger Quadros , Felipe Balbi , Peter Chen CC: "peter.chen@freescale.com" , "tony@atomide.com" , "gregkh@linuxfoundation.org" , "dan.j.williams@intel.com" , "mathias.nyman@linux.intel.com" , "Joao.Pinto@synopsys.com" , "sergei.shtylyov@cogentembedded.com" , "jun.li@freescale.com" , "grygorii.strashko@ti.com" , "robh@kernel.org" , "nsekhar@ti.com" , "b-liu@ti.com" , "joe@perches.com" , "linux-usb@vger.kernel.org" , "linux-omap@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" Subject: RE: [PATCH v11 08/14] usb: otg: add OTG/dual-role core Thread-Topic: [PATCH v11 08/14] usb: otg: add OTG/dual-role core Thread-Index: AQHRxUkw4Sfo3DxzBkaeMKGjdEeIRZ/yBN6AgABEDACAAAVcgIABLOuAgAAWjgCAABxlAIAAD3eAgAAy6QCAAStIAIAADvSAgAFvmeA= Date: Thu, 23 Jun 2016 07:42:05 +0000 Message-ID: References: <1465564043-27163-1-git-send-email-rogerq@ti.com> <1465564043-27163-9-git-send-email-rogerq@ti.com> <575E672E.5070603@ti.com> <87h9coxq04.fsf@linux.intel.com> <20160620114904.GC26936@shlinux2> <8737o8qd00.fsf@linux.intel.com> <20160621060517.GA5108@shlinux2> <877fdjovef.fsf@linux.intel.com> <20160621090738.GD5108@shlinux2> <87h9cmoo4s.fsf@linux.intel.com> <20160621130512.GF5108@shlinux2> <87por9lnjd.fsf@linux.intel.com> <576A4321.6020209@ti.com> In-Reply-To: <576A4321.6020209@ti.com> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yoshihiro.shimoda.uh@renesas.com; x-originating-ip: [211.11.155.144] x-ms-office365-filtering-correlation-id: 00536a03-6361-4bf8-436e-08d39b39dfc0 x-microsoft-exchange-diagnostics: 1;SG2PR06MB0920;20:lsRPEAherM5KwP43dCa5Tc5d4R9g1dC5De4MGeJsXqc2bsNhaQdRsz1INJ8KRmd7gW0DmBxqgonKg3kY7aKsu4wORpvw8BmNtKXYM1P1N+E/q6/6owDQUEmICHjN/MkXU9Hs1fC2OQ4xBcFqJNUrJqMwKa5KllHy9vwaKlPps0Q= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB0920; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(17755550239193); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026);SRVR:SG2PR06MB0920;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB0920; x-forefront-prvs: 098291215C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(199003)(189002)(3660700001)(54356999)(76176999)(10400500002)(9686002)(50986999)(8936002)(106116001)(3280700002)(7736002)(106356001)(5002640100001)(8676002)(86362001)(19580405001)(87936001)(19580395003)(189998001)(92566002)(3846002)(6116002)(586003)(305945005)(101416001)(4326007)(97736004)(102836003)(74316001)(2906002)(5001770100001)(105586002)(2950100001)(2900100001)(122556002)(77096005)(8666005)(81166006)(81156014)(76576001)(66066001)(7696003)(7846002)(33656002)(68736007)(93886004)(5003600100003)(7059030);DIR:OUT;SFP:1102;SCL:1;SRVR:SG2PR06MB0920;H:SG2PR06MB0919.apcprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jun 2016 07:42:05.7860 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0920 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Roger-san, < snip > > >>>> commit 11c011a5e777c83819078a18672543f04482b3ec > >>>> Author: Srinivas Kandagatla > >>>> Date: Thu May 19 11:12:56 2016 +0100 > >>>> > >>>> usb: echi-hcd: Add ehci_setup check before echi_shutdown > >>>> > >>>> > >>>> > >>>> In some cases, the USB code (gadget/hcd->start/stop) needs to be called > >>>> during the role swap. For example, if you have mux driver, you may > >>>> need to call usb_remove_hcd when ID from 0 to 1. Without Roger's framework, > >>>> how can we do that? > >>> > >>> You don't really need to remove the gadget. Just mask its interrupts and > >>> ignore any calls to any gadget_driver ops, right? Likewise for > >>> XHCI. Just clear RUN/STOP and no events will ever reach XHCI. But, from > >>> the point of view of dwc3, it's simpler to unregister the platform > >>> device we create for xhci-plat.c. I need no changes in XHCI to do that > >>> and driver model will make sure to call xhci-plat's ->remove() which > >>> will handle everything for me correctly. > >>> > >> > >> I admit it can do in a IP driver, eg both host and peripheral for the > >> single IP, eg chipidea, dwc3, etc. But how can we clear RUN/STOP bit > >> or what else for HCD at mux driver? > > > > dwc3's OTG block has control of that, however, what I'll do is > > platform_device_del() xhci-plat's device. Not one line changes inside > > XHCI. > > > > Let's talk about how non dwc3 based platforms can get it done. > > Yoshihiro-san, could you please share your platform requirements from dual-role > perspective? My platform requirements about dual-role are: - Initial settings of all host, gadget and OTG IP registers are needed before enters [AB]-device recognition procedure. - In the recognition procedures, a software needs: - to check ID pin related register in OTG - to set OTG IP registers to change the role - and then host or gadget can start. - In the disconnect detection procedures, a software needs similar checkings/settings with the recognition. Best regards, Yoshihiro Shimoda > cheers, > -roger