linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Tanya Brokhman" <tlinder@codeaurora.org>
To: balbi@ti.com
Cc: greg@kroah.com, linux-usb@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, ablay@codeaurora.org,
	'open list' <linux-kernel@vger.kernel.org>,
	'Sarah Sharp' <sarah.a.sharp@linux.intel.com>
Subject: RE: [PATCH v12 7/8] usb: Adding SuperSpeed support to dummy_hcd
Date: Mon, 23 May 2011 12:16:40 +0300	[thread overview]
Message-ID: <00e401cc192a$2211bb50$663531f0$@org> (raw)
In-Reply-To: <20110523083208.GM3095@legolas.emea.dhcp.ti.com>

Hi 

> > > >
> > > > You mean I don't need the module parameter? IMO it's the best way
> > > > to enable HS connection. If driver->speed=USB_SPEED_SUPER than
> > > > dummy_hcd will try to enumerate the device on the SS root hub and
> > > > if the gadget didn't provide SS descriptors - it will fail. Just
> > > > as it happened before. Finding out from
> > >
> > > then it should hand the device over to the hs_hcd ;-) Meaning it
> > > would disconnect the device, switch to hs_hcd and reconnect :-)
> >
> > Yes this will be the best solution :) But as I said, the enumeration
> > occurs not in dummy_hcd thus I'm not sure how dummy_hcd can find out
> > that it failed
> 
> take a look at xhci-ring.c for an example :-)
> 
> see that it check whether the attached device is a USB3.0 device or
> USB2.0/1.1 device and chooses hcd or shared_hcd accordingly.
> 

I ran some more tests with xhci and I think (or hope :) ) I figured this
out:
When connecting a gadget driver that is marked as SS device (the flag
CONFIG_USB_GADGET_IS_SUPER_SPEED = true) to a SS port over SS cable - 
the enumeration fails if that gadget driver doesn't provide SS descriptors. 
BUT: if I connect the same device via HS cable to SS port - the enumeration
is successful. I think that this is the case where xhci-ring handles the
device over to the HS hcd :) (By the way, I think that in xhci the
shared_hcd is SS and the main_hcd is HS)

In conclusion it seems to me that the device speed is determined by 2
things:
1. the cable used
2. whether the device HW supports SS protocol. In our scenario it can since
SS support is enabled in our udc. (We haven't released it yet.)
So when a HS device is connected to a SS port, the xHCI checks it's speed
and if necessary handles it over to the SS root hub. But this is done prior
to the enumeration phase so if the device speed is SS but it has no SS
descriptors - the enumeration will fail. The enumeration itself occurs not
in xhci but in hub.c so the xhci isn't aware of the fact that it failed and
doesn't handle this.

Since in dummy_hcd all of this is much simpler I think that the device speed
should be determined by driver->speed and "which type of cable the
connection was made over - SS or HS". The "cable type" is exactly what the
module parameter is.

My familiarity with the Linux host isn't as good as I would like it to be
(still working on that) so I might be wrong with my conclusions...

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-23  9:14 UTC|newest]

Thread overview: 60+ 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 ` [PATCH/RESEND v12 3/8] usb: Modify existing gadget drivers to use config_ep_by_speed() instead of ep_choose 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   ` [PATCH v12 4/8] usb:gadget: Add SuperSpeed support to the Gadget Framework 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:14         ` Mike Frysinger
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 ` [PATCH v12 6/8] usb:dummy_hcd: use the shared_hcd infrastructure Tatyana Brokhman
2011-05-23  6:41 ` [PATCH v12 7/8] usb: Adding SuperSpeed support to dummy_hcd 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:20       ` Tanya Brokhman
2011-05-23  7:21         ` Felipe Balbi
2011-05-23  8:18           ` Tanya Brokhman
2011-05-23  8:32             ` Felipe Balbi
2011-05-23  9:16               ` Tanya Brokhman [this message]
2011-05-23 14:22                 ` Alan Stern
2011-05-23 16:08                 ` Sarah Sharp
2011-05-23 16:28                   ` Alan Stern
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-24  5:53                           ` Tanya Brokhman
2011-05-24 10:18                             ` Felipe Balbi
2011-05-24 10:31                               ` Tanya Brokhman
2011-05-24 10:33                                 ` Felipe Balbi
2011-05-24 10:43                                   ` Tanya Brokhman
2011-05-24 14:20                                     ` Alan Stern
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:27                                               ` Felipe Balbi
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:29                                                       ` Felipe Balbi
2011-05-25 10:52                                                         ` Tanya Brokhman
2011-05-25 11:23                                                           ` Felipe Balbi
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:39                                                                 ` Alan Stern
2011-05-28 11:05                                                                   ` Tanya Brokhman
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
     [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:59                                                                         ` Alan Stern
2011-05-26  6:51                                                                           ` Tanya Brokhman
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
     [not found]       ` <20110523070556.GJ3095-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-05-23 14:18         ` Alan Stern
2011-05-23  6:41 ` [PATCH v12 8/8] usb:gadget: coding style fixes 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='00e401cc192a$2211bb50$663531f0$@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 \
    /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).