From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756582AbbCSOcA (ORCPT ); Thu, 19 Mar 2015 10:32:00 -0400 Received: from mail-bn1on0138.outbound.protection.outlook.com ([157.56.110.138]:16608 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756477AbbCSObz (ORCPT ); Thu, 19 Mar 2015 10:31:55 -0400 Date: Thu, 19 Mar 2015 22:09:00 +0800 From: Li Jun To: Roger Quadros CC: Peter Chen , , , , , , , , , Subject: Re: [RFC][PATCH 2/9] usb: gadget: add usb_gadget_start/stop() Message-ID: <20150319140859.GA7950@shlinux1.ap.freescale.net> References: <1426686963-11613-1-git-send-email-rogerq@ti.com> <1426686963-11613-3-git-send-email-rogerq@ti.com> <20150319032944.GA2476@shlinux2> <550AA18F.2000106@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <550AA18F.2000106@ti.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-EOPAttributedMessage: 0 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=b47624@freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(51704005)(189002)(479174004)(199003)(24454002)(62966003)(46102003)(2950100001)(77156002)(47776003)(23726002)(83506001)(93886004)(76176999)(92566002)(54356999)(85426001)(50986999)(87936001)(97756001)(6806004)(50466002)(19580395003)(33656002)(19580405001)(104016003)(106466001)(110136001)(105606002)(46406003)(77096005);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0301MB1229;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1229; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5002010)(5005006);SRVR:DM2PR0301MB1229;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1229; X-Forefront-PRVS: 052017CAF1 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2015 14:15:59.6892 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB1229 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 19, 2015 at 12:14:39PM +0200, Roger Quadros wrote: > On 19/03/15 05:30, Peter Chen wrote: > > On Wed, Mar 18, 2015 at 03:55:56PM +0200, Roger Quadros wrote: > >> The OTG state machine needs a mechanism to start and > >> stop the gadget controller. Add usb_gadget_start() > >> and usb_gadget_stop(). > >> > >> Signed-off-by: Roger Quadros > >> --- > >> drivers/usb/gadget/udc/udc-core.c | 166 +++++++++++++++++++++++++++++++++++--- > >> include/linux/usb/gadget.h | 3 + > >> 2 files changed, 158 insertions(+), 11 deletions(-) > >> > >> diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c > >> index 5a81cb0..69b4123 100644 > >> --- a/drivers/usb/gadget/udc/udc-core.c > >> +++ b/drivers/usb/gadget/udc/udc-core.c > >> @@ -35,6 +35,8 @@ > >> * @dev - the child device to the actual controller > >> * @gadget - the gadget. For use by the class code > >> * @list - for use by the udc class driver > >> + * @running - udc is running > > > > Doesn't OTG FSM should know it? > > Not really, as the gadget driver might not have been loaded yet or userspace might > have disabled softconnect when the OTG FSM wants UDC to start. > > So only UDC knows if it has really started or not based on this flag. > why this can not be known by check the otg fsm state? i.e. if the device in b_peripheral or a_peripheral state, udc should had started, isn't it? Li Jun > cheers, > -roger > > > > > Peter > >> + * @softconnect - sysfs softconnect says OK to connect > >> * > > > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Li Jun Subject: Re: [RFC][PATCH 2/9] usb: gadget: add usb_gadget_start/stop() Date: Thu, 19 Mar 2015 22:09:00 +0800 Message-ID: <20150319140859.GA7950@shlinux1.ap.freescale.net> References: <1426686963-11613-1-git-send-email-rogerq@ti.com> <1426686963-11613-3-git-send-email-rogerq@ti.com> <20150319032944.GA2476@shlinux2> <550AA18F.2000106@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <550AA18F.2000106-l0cyMroinI0@public.gmane.org> Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Roger Quadros Cc: Peter Chen , gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, balbi-l0cyMroinI0@public.gmane.org, stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org, dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, jun.li-KZfg59tc24xl57MIdRCFDg@public.gmane.org, mathias.nyman-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-omap@vger.kernel.org On Thu, Mar 19, 2015 at 12:14:39PM +0200, Roger Quadros wrote: > On 19/03/15 05:30, Peter Chen wrote: > > On Wed, Mar 18, 2015 at 03:55:56PM +0200, Roger Quadros wrote: > >> The OTG state machine needs a mechanism to start and > >> stop the gadget controller. Add usb_gadget_start() > >> and usb_gadget_stop(). > >> > >> Signed-off-by: Roger Quadros > >> --- > >> drivers/usb/gadget/udc/udc-core.c | 166 +++++++++++++++++++++++++++++++++++--- > >> include/linux/usb/gadget.h | 3 + > >> 2 files changed, 158 insertions(+), 11 deletions(-) > >> > >> diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c > >> index 5a81cb0..69b4123 100644 > >> --- a/drivers/usb/gadget/udc/udc-core.c > >> +++ b/drivers/usb/gadget/udc/udc-core.c > >> @@ -35,6 +35,8 @@ > >> * @dev - the child device to the actual controller > >> * @gadget - the gadget. For use by the class code > >> * @list - for use by the udc class driver > >> + * @running - udc is running > > > > Doesn't OTG FSM should know it? > > Not really, as the gadget driver might not have been loaded yet or userspace might > have disabled softconnect when the OTG FSM wants UDC to start. > > So only UDC knows if it has really started or not based on this flag. > why this can not be known by check the otg fsm state? i.e. if the device in b_peripheral or a_peripheral state, udc should had started, isn't it? Li Jun > cheers, > -roger > > > > > Peter > >> + * @softconnect - sysfs softconnect says OK to connect > >> * > > > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html