linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq-l0cyMroinI0@public.gmane.org>
To: Li Jun <b47624-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org,
	balbi-l0cyMroinI0@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	jun.li-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
	mathias.nyman-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org,
	Joao.Pinto-HKixBCOQz3hWk0Htik3J/w@public.gmane.org,
	abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v4 07/13] usb: otg: add OTG core
Date: Thu, 10 Sep 2015 17:14:08 +0300	[thread overview]
Message-ID: <55F19030.9090800@ti.com> (raw)
In-Reply-To: <20150910092854.GA7703@shlinux2>

On 10/09/15 12:28, Li Jun wrote:
> On Wed, Sep 09, 2015 at 01:01:14PM +0300, Roger Quadros wrote:
> ... ...
> 
>>>>>> +	return -EINVAL;
>>>>>
>>>>> Return non-zero, then if err, do we need call usb_otg_add_hcd() after
>>>>> usb_otg_register_hcd() fails?
>>>>
>>>> You should not call usb_otg_register_hcd() but usb_add_hcd().
>>>> If that fails then you fail as ususal.
>>>
>>> My point is if we use usb_add_hcd(), but failed in usb_otg_register_hcd(),
>>> then usb_otg_add_hcd() will be called in *all* error case, is this your
>>> expectation?
>>> 	if (usb_otg_register_hcd(hcd, irqnum, irqflags, &otg_hcd_intf))
>>> 		return usb_otg_add_hcd(hcd, irqnum, irqflags);
>>>
>>
>> Yes, my intention was that if otg fails then it is a non otg HCD so register normally.
>> Let me correct my previous statement. If you are absolutely sure
>> that the HCD is for otg/dual-role usage then you should call usb_otg_register_hcd().
>>
> 
> I think this is not just about a statement, in your usb_otg_register_hcd()
> implementation, there are several places will return error, I think only
> the first two are for a non-otg HCD case, the following error cases seems
> mean this is for otg usage, but it fails in middle of registration, if that
> is the case, is it reasonable to call usb_otg_add_hcd()?

OK. We need to check the return value then and differentiate if it is non-otg
or otg with failure.
If it is non-otg then only we must call usb_otg_add_hcd().

I will fix usb_add_hcd().

> 
>>>>>> + * @fsm_running: state machine running/stopped indicator
>>>>>> + */
>>>>>>  struct usb_otg {
>>>>>>  	u8			default_a;
>>>>>>  
>>>>>>  	struct phy		*phy;
>>>>>>  	/* old usb_phy interface */
>>>>>>  	struct usb_phy		*usb_phy;
>>>>>> +
>>>>>
>>>>> add a blank line?
>>>>>
>>>
>>> You missed this.
>>
>> Sorry. Did you suggest to remove that blank line
>> or add a new one before usb_phy?
>>
> 
> Remove it.

OK.

> 
>>>
>>>>>>  	struct usb_bus		*host;
>>>>>>  	struct usb_gadget	*gadget;
>>>>>>  
>>>>>>  	enum usb_otg_state	state;
>>>>>>  
>>>>>> +	struct device *dev;
>>>>>> +	struct usb_otg_caps *caps;
>>>>>> +	struct otg_fsm fsm;
>>>>>> +	struct otg_fsm_ops fsm_ops;
>>>>>> +
>>>>>> +	/* internal use only */
>>>>>> +	struct otg_hcd primary_hcd;
>>>>>> +	struct otg_hcd shared_hcd;
>>>>>> +	struct otg_gadget_ops *gadget_ops;
>>>>>> +	struct otg_timer timers[NUM_OTG_FSM_TIMERS];
>>>>>> +	struct list_head list;
>>>>>> +	struct work_struct work;
>>>>>> -- 
>>>>>> 2.1.4
>>>
--
cheers,
-roger
--
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

  reply	other threads:[~2015-09-10 14:14 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24 13:21 [PATCH v4 00/13] USB: OTG/DRD Core functionality Roger Quadros
2015-08-24 13:21 ` [PATCH v4 01/13] usb: otg-fsm: Add documentation for struct otg_fsm Roger Quadros
2015-08-24 13:21 ` [PATCH v4 02/13] usb: otg-fsm: support multiple instances Roger Quadros
2015-09-06  5:52   ` Peter Chen
2015-08-24 13:21 ` [PATCH v4 03/13] usb: otg-fsm: Prevent build warning "VDBG" redefined Roger Quadros
2015-08-24 13:21 ` [PATCH v4 04/13] otg-fsm: move usb_bus_start_enum into otg-fsm->ops Roger Quadros
2015-09-07  1:24   ` Peter Chen
2015-09-07  9:57     ` Roger Quadros
2015-09-08  6:54       ` Peter Chen
2015-09-08  8:24         ` Roger Quadros
2015-08-24 13:21 ` [PATCH v4 05/13] usb: hcd.h: Add OTG to HCD interface Roger Quadros
2015-08-24 13:21 ` [PATCH v4 06/13] usb: gadget.h: Add OTG to gadget interface Roger Quadros
2015-08-24 13:21 ` [PATCH v4 07/13] usb: otg: add OTG core Roger Quadros
2015-09-07  1:23   ` Peter Chen
2015-09-07 10:23     ` Roger Quadros
     [not found]       ` <55ED6585.5050200-l0cyMroinI0@public.gmane.org>
2015-09-08  8:31         ` Peter Chen
2015-09-08 12:25           ` Roger Quadros
     [not found]             ` <55EED3B5.5030806-l0cyMroinI0@public.gmane.org>
2015-09-08 14:34               ` Alan Stern
2015-09-08 17:29                 ` Roger Quadros
2015-09-09  2:21               ` Peter Chen
2015-09-09  9:08                 ` Roger Quadros
     [not found]                   ` <55EFF6FA.1000705-l0cyMroinI0@public.gmane.org>
2015-09-09  8:13                     ` Peter Chen
2015-09-09  9:33                       ` Roger Quadros
2015-09-09  8:45                         ` Peter Chen
2015-09-09 10:21                           ` Roger Quadros
2015-09-10  5:35                             ` Peter Chen
2015-09-10 14:17                               ` Roger Quadros
2015-09-11  1:50                                 ` Peter Chen
     [not found]   ` <1440422484-4737-8-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2015-09-07  7:40     ` Li Jun
2015-09-07 10:53       ` Roger Quadros
     [not found]         ` <55ED6C9F.2000502-l0cyMroinI0@public.gmane.org>
2015-09-09  6:20           ` Li Jun
2015-09-09 10:01             ` Roger Quadros
2015-09-10  9:28               ` Li Jun
2015-09-10 14:14                 ` Roger Quadros [this message]
2015-08-24 13:21 ` [PATCH v4 08/13] usb: doc: dt-binding: Add otg-controller property Roger Quadros
2015-08-24 13:21 ` [PATCH v4 10/13] usb: hcd: Adapt to OTG core Roger Quadros
     [not found]   ` <1440422484-4737-11-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2015-09-09  2:23     ` Peter Chen
2015-09-09  9:39       ` Roger Quadros
2015-08-24 13:21 ` [PATCH v4 12/13] usb: gadget: udc: adapt " Roger Quadros
2015-08-24 13:21 ` [PATCH v4 13/13] usb: otg: Add dual-role device (DRD) support Roger Quadros
     [not found]   ` <1440422484-4737-14-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2015-09-07  7:53     ` Li Jun
2015-09-07  9:51       ` Roger Quadros
     [not found] ` <1440422484-4737-1-git-send-email-rogerq-l0cyMroinI0@public.gmane.org>
2015-08-24 13:21   ` [PATCH v4 09/13] usb: chipidea: move from CONFIG_USB_OTG_FSM to CONFIG_USB_OTG Roger Quadros
2015-08-24 13:21   ` [PATCH v4 11/13] usb: core: hub: Notify OTG fsm when A device sets b_hnp_enable Roger Quadros
2015-08-26  6:19   ` [PATCH v4 00/13] USB: OTG/DRD Core functionality Peter Chen
2015-09-06  7:06   ` Peter Chen
2015-09-07 11:42     ` Roger Quadros
2015-12-03  8:19 ` Peter Chen
2015-12-03  8:54   ` Roger Quadros
     [not found] <Pine.LNX.4.44L0.1509081334190.1298-100000@iolanthe.rowland.org>
     [not found] ` <Pine.LNX.4.44L0.1509081334190.1298-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2015-09-09 11:10   ` [PATCH v4 07/13] usb: otg: add OTG core Roger Quadros
     [not found]     ` <55F013C1.9080400-l0cyMroinI0@public.gmane.org>
2015-09-09 15:26       ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55F19030.9090800@ti.com \
    --to=rogerq-l0cymroini0@public.gmane.org \
    --cc=Joao.Pinto-HKixBCOQz3hWk0Htik3J/w@public.gmane.org \
    --cc=abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=b47624-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=balbi-l0cyMroinI0@public.gmane.org \
    --cc=dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=jun.li-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mathias.nyman-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=peter.chen-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).