All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tanya Brokhman" <tlinder@codeaurora.org>
To: balbi@ti.com
Cc: 'Alan Stern' <stern@rowland.harvard.edu>,
	'Sarah Sharp' <sarah.a.sharp@linux.intel.com>,
	greg@kroah.com, linux-usb@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, ablay@codeaurora.org,
	'open list' <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v12 7/8] usb: Adding SuperSpeed support to dummy_hcd
Date: Wed, 25 May 2011 13:52:15 +0300	[thread overview]
Message-ID: <01b401cc1ac9$d1c57870$75506950$@org> (raw)
In-Reply-To: <20110525102945.GN14556@legolas.emea.dhcp.ti.com>

Hi Felipe,

> >
> > You want to remove the following change from in composite.c:
> >
> > @@ -1386,6 +1604,9 @@ int usb_composite_probe(struct
> > usb_composite_driver *driver,
> >  		driver->iProduct = driver->name;
> >  	composite_driver.function =  (char *) driver->name;
> >  	composite_driver.driver.name = driver->name;
> > +#ifdef CONFIG_USB_GADGET_SUPERSPEED
> > +	composite_driver.speed = USB_SPEED_SUPER; #endif /*
> > +CONFIG_USB_GADGET_SUPERSPEED */
> >  	composite = driver;
> >  	composite_gadget_bind = bind;
> >
> > Right? I'm sorry, but I really don't understand why... :( Removing it
> > is the same as not defining CONFIG_USB_GADGET_SUPERSPEED.
> 
> we still want to build a SuperSpeed dummy_hcd but have HS gadget
> drivers
> :-)

But we do! I'm sorry, I'm getting a bit frustrated from not understanding
what bothers you here...
The above change in usb_composite_probe() doesn't prevent HS gadgets from
working with SS dummy_hcd.
Here is an example of the tests I ran on this patch series:
In my build CONFIG_USB_GADGET_SUPERSPEED=true so composite_driver.speed =
USBSPEED_SUPER.
1)
$> modprobe g_zero
G_zero was enumerated over HS root hub as a HS device. I ran our HS test
suite (from the UT framework) to test its functionality. It includes (HS)
descriptors verification, connect/disconnect and bulk in/out tests.

2) 
$> modprobe dummy_hcd is_super_speed=1
$> modprobe g_zero
In this case the enumeration fails since g_zero didn't provide SS
descriptors!

I prepared another build, in which I used our generate_ss_descriptors() to
automaticly generate SS descriptors for g_zero gadget.
CONFIG_USB_GADGET_SUPERSPEED is still true:

3)
$> modprobe g_zero
G_zero was enumerated over HS root hub as a HS device although it has SS
descriptors. All HS UT that I described above passed

4) 
$> modprobe dummy_hcd is_super_speed=1
$> modprobe g_zero
G_zero enumerated over SS root hub as a SS device. I verified that it's
functional with the SS test suite. It also verifies (SS) descriptors,
connect/disconnect and bulk in/out tests.

Please give me an example of what WOUN'T work with the above change.

> 
> > > we should be to compile dummy_hcd in SuperSpeed and still have
> high-
> > > speed gadget drivers :-)
> >
> > But this is the case right now. Or do you mean that you want to load
> > (not
> > compile) the dummy_hcd with is_super_speed=1 and still be able to
> > enumerate HS gadgets?
> 
> that too.

Well you can if at compile time you don't set CONFIG_USB_GADGET_SUPERSPEED
to true.

> 
> > > > following:
> > > > 1. if CONFIG_USB_GADGET_SUPERSPEED=true, existing gadget drivers
> > > > are still functional with dummy_hcd since as I already mentioned,
> > > > they will be enumerated through HS root hub and thus the
> > > > gadget.speed will
> > > be set to HS.
> > > > This is true for all gadget drivers, including the once that
> don't
> > > > define SS descriptors.
> > >
> > > only due the module parameter, right ?
> >
> > Due to the module parameter default value being FALSE, yes.
> 
> Ok, so let's take your approach but change the speed in the gadget
> driver structure, put your ifdef somewhere like here:
> 
> diff --git a/drivers/usb/gadget/composite.c
> b/drivers/usb/gadget/composite.c index 1ba4bef..d02d6e8 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -1224,7 +1224,11 @@ composite_resume(struct usb_gadget *gadget)  /*-
> -----------------------------------------------------------------------
> -*/
> 
>  static struct usb_gadget_driver composite_driver = {
> +#ifdef CONFIG_USB_GADGET_SUPERSPEED
> +       .speed          = USB_SPEE_SUPER,
> +#else
>         .speed          = USB_SPEED_HIGH,
> +#endif
> 
>         .unbind         = composite_unbind,
> 

I have no problem updating static struct usb_gadget_driver composite_driver
as you suggested but it seems the same as updating it @
usb_composite_probe()...


Best regards,
Tanya Brokhman
Consultant for Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

WARNING: multiple messages have this Message-ID (diff)
From: "Tanya Brokhman" <tlinder@codeaurora.org>
To: <balbi@ti.com>
Cc: "'Alan Stern'" <stern@rowland.harvard.edu>,
	"'Sarah Sharp'" <sarah.a.sharp@linux.intel.com>, <greg@kroah.com>,
	<linux-usb@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
	<ablay@codeaurora.org>,
	"'open list'" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v12 7/8] usb: Adding SuperSpeed support to dummy_hcd
Date: Wed, 25 May 2011 13:52:15 +0300	[thread overview]
Message-ID: <01b401cc1ac9$d1c57870$75506950$@org> (raw)
In-Reply-To: <20110525102945.GN14556@legolas.emea.dhcp.ti.com>

Hi Felipe,

> >
> > You want to remove the following change from in composite.c:
> >
> > @@ -1386,6 +1604,9 @@ int usb_composite_probe(struct
> > usb_composite_driver *driver,
> >  		driver->iProduct = driver->name;
> >  	composite_driver.function =  (char *) driver->name;
> >  	composite_driver.driver.name = driver->name;
> > +#ifdef CONFIG_USB_GADGET_SUPERSPEED
> > +	composite_driver.speed = USB_SPEED_SUPER; #endif /*
> > +CONFIG_USB_GADGET_SUPERSPEED */
> >  	composite = driver;
> >  	composite_gadget_bind = bind;
> >
> > Right? I'm sorry, but I really don't understand why... :( Removing it
> > is the same as not defining CONFIG_USB_GADGET_SUPERSPEED.
> 
> we still want to build a SuperSpeed dummy_hcd but have HS gadget
> drivers
> :-)

But we do! I'm sorry, I'm getting a bit frustrated from not understanding
what bothers you here...
The above change in usb_composite_probe() doesn't prevent HS gadgets from
working with SS dummy_hcd.
Here is an example of the tests I ran on this patch series:
In my build CONFIG_USB_GADGET_SUPERSPEED=true so composite_driver.speed =
USBSPEED_SUPER.
1)
$> modprobe g_zero
G_zero was enumerated over HS root hub as a HS device. I ran our HS test
suite (from the UT framework) to test its functionality. It includes (HS)
descriptors verification, connect/disconnect and bulk in/out tests.

2) 
$> modprobe dummy_hcd is_super_speed=1
$> modprobe g_zero
In this case the enumeration fails since g_zero didn't provide SS
descriptors!

I prepared another build, in which I used our generate_ss_descriptors() to
automaticly generate SS descriptors for g_zero gadget.
CONFIG_USB_GADGET_SUPERSPEED is still true:

3)
$> modprobe g_zero
G_zero was enumerated over HS root hub as a HS device although it has SS
descriptors. All HS UT that I described above passed

4) 
$> modprobe dummy_hcd is_super_speed=1
$> modprobe g_zero
G_zero enumerated over SS root hub as a SS device. I verified that it's
functional with the SS test suite. It also verifies (SS) descriptors,
connect/disconnect and bulk in/out tests.

Please give me an example of what WOUN'T work with the above change.

> 
> > > we should be to compile dummy_hcd in SuperSpeed and still have
> high-
> > > speed gadget drivers :-)
> >
> > But this is the case right now. Or do you mean that you want to load
> > (not
> > compile) the dummy_hcd with is_super_speed=1 and still be able to
> > enumerate HS gadgets?
> 
> that too.

Well you can if at compile time you don't set CONFIG_USB_GADGET_SUPERSPEED
to true.

> 
> > > > following:
> > > > 1. if CONFIG_USB_GADGET_SUPERSPEED=true, existing gadget drivers
> > > > are still functional with dummy_hcd since as I already mentioned,
> > > > they will be enumerated through HS root hub and thus the
> > > > gadget.speed will
> > > be set to HS.
> > > > This is true for all gadget drivers, including the once that
> don't
> > > > define SS descriptors.
> > >
> > > only due the module parameter, right ?
> >
> > Due to the module parameter default value being FALSE, yes.
> 
> Ok, so let's take your approach but change the speed in the gadget
> driver structure, put your ifdef somewhere like here:
> 
> diff --git a/drivers/usb/gadget/composite.c
> b/drivers/usb/gadget/composite.c index 1ba4bef..d02d6e8 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -1224,7 +1224,11 @@ composite_resume(struct usb_gadget *gadget)  /*-
> -----------------------------------------------------------------------
> -*/
> 
>  static struct usb_gadget_driver composite_driver = {
> +#ifdef CONFIG_USB_GADGET_SUPERSPEED
> +       .speed          = USB_SPEE_SUPER,
> +#else
>         .speed          = USB_SPEED_HIGH,
> +#endif
> 
>         .unbind         = composite_unbind,
> 

I have no problem updating static struct usb_gadget_driver composite_driver
as you suggested but it seems the same as updating it @
usb_composite_probe()...


Best regards,
Tanya Brokhman
Consultant for Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum





  reply	other threads:[~2011-05-25 10:50 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23  6:41 [PATCH v12 0/8] usb gadget: Add SuperSpeed support to the Gadget Framework Tatyana Brokhman
2011-05-23  6:41 ` [PATCH v12 2/8] usb: Configure endpoint according to gadget speed Tatyana Brokhman
2011-05-23  6:41   ` Tatyana Brokhman
2011-05-23  6:41 ` [PATCH/RESEND v12 3/8] usb: Modify existing gadget drivers to use config_ep_by_speed() instead of ep_choose Tatyana Brokhman
2011-05-23  6:41   ` Tatyana Brokhman
     [not found] ` <1306132882-9668-1-git-send-email-tlinder-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2011-05-23  6:41   ` [PATCH/RESEND v12 1/8] usb: Add usb_endpoint_descriptor to be part of the struct usb_ep Tatyana Brokhman
2011-05-23  6:41     ` Tatyana Brokhman
2011-05-23  6:41   ` [PATCH v12 4/8] usb:gadget: Add SuperSpeed support to the Gadget Framework Tatyana Brokhman
2011-05-23  6:41     ` Tatyana Brokhman
2011-05-23 12:31     ` Sebastian Andrzej Siewior
2011-05-23 22:18       ` Mike Frysinger
2011-05-24  5:10       ` Tanya Brokhman
2011-05-24  5:10         ` Tanya Brokhman
2011-05-24  5:14         ` Mike Frysinger
2011-05-24  5:37           ` Tanya Brokhman
2011-05-24  5:37             ` Tanya Brokhman
2011-05-24 17:12             ` Mike Frysinger
2011-05-23  6:41 ` [PATCH/RESEND v12 5/8] usb: Add streams support to the gadget framework Tatyana Brokhman
2011-05-23  6:41   ` Tatyana Brokhman
2011-05-23  6:41 ` [PATCH v12 6/8] usb:dummy_hcd: use the shared_hcd infrastructure Tatyana Brokhman
2011-05-23  6:41   ` Tatyana Brokhman
2011-05-23  6:41 ` [PATCH v12 7/8] usb: Adding SuperSpeed support to dummy_hcd Tatyana Brokhman
2011-05-23  6:41   ` Tatyana Brokhman
     [not found]   ` <1306132882-9668-8-git-send-email-tlinder-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2011-05-23  7:05     ` Felipe Balbi
2011-05-23  7:05       ` Felipe Balbi
2011-05-23  7:20       ` Tanya Brokhman
2011-05-23  7:20         ` Tanya Brokhman
2011-05-23  7:21         ` Felipe Balbi
2011-05-23  8:18           ` Tanya Brokhman
2011-05-23  8:18             ` Tanya Brokhman
2011-05-23  8:32             ` Felipe Balbi
2011-05-23  9:16               ` Tanya Brokhman
2011-05-23  9:16                 ` Tanya Brokhman
2011-05-23 14:22                 ` Alan Stern
2011-05-23 14:22                   ` Alan Stern
2011-05-23 16:08                 ` Sarah Sharp
2011-05-23 16:08                   ` Sarah Sharp
2011-05-23 16:28                   ` Alan Stern
2011-05-23 16:28                     ` Alan Stern
2011-05-23 21:06                     ` Felipe Balbi
2011-05-23 21:06                       ` Felipe Balbi
     [not found]                       ` <BD27AEAC-1E6D-480C-9E18-A970B992AD75-l0cyMroinI0@public.gmane.org>
2011-05-23 21:21                         ` Alan Stern
2011-05-23 21:21                           ` Alan Stern
2011-05-24  5:53                           ` Tanya Brokhman
2011-05-24  5:53                             ` Tanya Brokhman
2011-05-24 10:18                             ` Felipe Balbi
2011-05-24 10:31                               ` Tanya Brokhman
2011-05-24 10:31                                 ` Tanya Brokhman
2011-05-24 10:33                                 ` Felipe Balbi
2011-05-24 10:33                                   ` Felipe Balbi
2011-05-24 10:43                                   ` Tanya Brokhman
2011-05-24 10:43                                     ` Tanya Brokhman
2011-05-24 14:20                                     ` Alan Stern
2011-05-24 14:20                                       ` Alan Stern
2011-05-25  4:46                                       ` Tanya Brokhman
2011-05-25  4:46                                         ` Tanya Brokhman
2011-05-25  9:21                                         ` Felipe Balbi
     [not found]                                           ` <20110525092124.GI14556-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-05-25  9:26                                             ` Tanya Brokhman
2011-05-25  9:26                                               ` Tanya Brokhman
2011-05-25  9:27                                               ` Felipe Balbi
2011-05-25  9:43                                                 ` Tanya Brokhman
2011-05-25  9:43                                                   ` Tanya Brokhman
2011-05-25  9:49                                                   ` Felipe Balbi
2011-05-25 10:03                                                     ` Tanya Brokhman
2011-05-25 10:03                                                       ` Tanya Brokhman
2011-05-25 10:29                                                       ` Felipe Balbi
2011-05-25 10:52                                                         ` Tanya Brokhman [this message]
2011-05-25 10:52                                                           ` Tanya Brokhman
2011-05-25 11:23                                                           ` Felipe Balbi
2011-05-25 11:33                                                             ` Tanya Brokhman
2011-05-25 11:33                                                               ` Tanya Brokhman
2011-05-25 12:42                                                               ` Felipe Balbi
2011-05-25 14:23                                                               ` Alan Stern
2011-05-25 14:23                                                                 ` Alan Stern
2011-05-25 14:39                                                                 ` Alan Stern
2011-05-25 14:39                                                                   ` Alan Stern
2011-05-28 11:05                                                                   ` Tanya Brokhman
2011-05-28 11:05                                                                     ` Tanya Brokhman
2011-05-28 14:15                                                                     ` Alan Stern
2011-05-28 14:15                                                                       ` Alan Stern
2011-06-07 10:33                                                                   ` Felipe Balbi
2011-05-25 17:07                                                                 ` Brokhman Tatyana
2011-05-25 17:29                                                                   ` Alan Stern
2011-05-25 17:29                                                                     ` Alan Stern
     [not found]                                                                     ` <Pine.LNX.4.44L0.1105251316170.1987-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2011-05-25 18:13                                                                       ` Brokhman Tatyana
2011-05-25 18:13                                                                         ` Brokhman Tatyana
2011-05-25 18:59                                                                         ` Alan Stern
2011-05-25 18:59                                                                           ` Alan Stern
2011-05-26  6:51                                                                           ` Tanya Brokhman
2011-05-26  6:51                                                                             ` Tanya Brokhman
2011-05-26 14:31                                                                             ` Alan Stern
2011-05-26 14:31                                                                               ` Alan Stern
2011-05-26 16:15                                                                               ` Brokhman Tatyana
2011-05-25  9:20                                       ` Felipe Balbi
2011-05-23 15:55               ` Sarah Sharp
     [not found]           ` <20110523072142.GK3095-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-05-23 14:20             ` Alan Stern
2011-05-23 14:20               ` Alan Stern
     [not found]       ` <20110523070556.GJ3095-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-05-23 14:18         ` Alan Stern
2011-05-23 14:18           ` Alan Stern
2011-05-23  6:41 ` [PATCH v12 8/8] usb:gadget: coding style fixes Tatyana Brokhman
2011-05-23  6:41   ` Tatyana Brokhman

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='01b401cc1ac9$d1c57870$75506950$@org' \
    --to=tlinder@codeaurora.org \
    --cc=ablay@codeaurora.org \
    --cc=balbi@ti.com \
    --cc=greg@kroah.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sarah.a.sharp@linux.intel.com \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.