Hi,
* David Brownell <[EMAIL PROTECTED]> [070529 18:02]:
> On Tuesday 29 May 2007, Tony Lindgren wrote:
>
> > > > (Peripheral maintains _both_ b_hnp_enable set by
> > > > a_host and user preference on b_device on using
> > > > b_hnp_enable)
> > >
> > > That "user preference" is problematic. What do you
> > > end up with if that requirement for a user choice is
> > > removed ... ?
> >
> > How else do you tell when to use HNP then? It's the
> > b-device that needs to have that configured in, and
> > having HNP always enabled on b-device make sense either.
>
> I don't see why it wouldn't. In fact, I what's always
> puzzled me is the notion of HNP under program control.
>
> (And it's puzzled most everyone else I've asked about
> it too. At this year's embedded systems conference
> the show floor had a lot more people who actually
> knew OTG ... a first. But nobody had a better use
> case for HNP than fixing the "hook cable up wrong"
> scenario.)
>
>
> Think of it this way: USB has had a *LOT* of effort
> put into its design to avoid the need for user error.
> Cables are keyed so there's no way to insert them
> the wrong way. Autoconfiguration. (A notion that
> Microsoft abhors, but that's their bug ... they want
> people to ship driver disks.) Power is delivered over
> the bus, so it's routine not to need a power brick
> (or batteries). And more. One of the basic design
> constraints of OTG is "no silent errors"; one part of
> that is exposing diagnostics, but another is minimizing
> even the potential for errors which need for them.
>
>
> Question: where would *needing* any user choice for HNP
> enter that picture? Answer: It doesn't.
OK I've run some tests with USB HS OPT and you're right,
it assumes HNP to happen automatically like the older
FS tester. So my older patch is not needed.
To support two similar devices, the right way is to
have the device itself on it's own whitelist to avoid
having HNP happen when they are connected togeter :)
Here's an experimental patch just FYI I've done to get
most OPT HS A tests to run, I'll be working on it more
in August.
I'm still having issues with some HS A tests with OPT
claiming "Did not receive an SOF before suspend detected"
although a sniffer shows SOFs...
Regards,
Tony
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1378,6 +1378,8 @@ int usb_new_device(struct usb_device *udev)
err = __usb_port_suspend(udev, udev->bus->otg_port);
if (err < 0)
dev_dbg(&udev->dev, "HNP fail, %d\n", err);
+ else
+ msleep(150); /* Needed for OPT A tests */
}
err = -ENODEV;
goto fail;
@@ -2250,15 +2252,19 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
buf->bMaxPacketSize0;
kfree(buf);
- retval = hub_port_reset(hub, port1, udev, delay);
- if (retval < 0) /* error or disconnect */
- goto fail;
- if (oldspeed != udev->speed) {
- dev_dbg(&udev->dev,
- "device reset changed speed!\n");
- retval = -ENODEV;
- goto fail;
- }
+ /* Reset makes most OPT A tests fail */
+ if (port1 != udev->bus->otg_port) {
+ retval = hub_port_reset(hub, port1, udev, delay);
+ if (retval < 0) /* error or disconnect */
+ goto fail;
+ if (oldspeed != udev->speed) {
+ dev_dbg(&udev->dev,
+ "device reset changed speed!\n");
+ retval = -ENODEV;
+ goto fail;
+ }
+ } else
+ msleep(100); /* Needed for OPT A tests */
if (r) {
dev_err(&udev->dev, "device descriptor "
"read/%s, error %d\n",
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel