On Thu, 30 Mar 2000, Johannes Erdfelt wrote:
> On Thu, Mar 30, 2000, Matthew Dharm <[EMAIL PROTECTED]> wrote:
> > On Thu, 30 Mar 2000, Johannes Erdfelt wrote:
> >
> > > I haven't tested the code (not even tried compiling it), but I think it
> > > should work. I know the above code won't work on a root hub (it'll
> > > oops).
> >
> > Hrm... we'll need a solution that works on root hubs, also.
>
> It'll work on devices connected to a root hub (I think), but it won't
> work on a root hub itself since there is no parent (dev->parent is
> NULL).
>
> What are you plans for resetting the root hub?
Oh, I thought you meant that it wouldn't work for devices attached to the
root hub. I have no need to reset the root hub at all. In that case,
this limitation should be fine (tho a quick check to avoid an OOPS might
be good).
> > > The device should disconnect and then reconnect. This will cause it to
> > > go through the normal connect and disconnect code paths. This means that
> > > dev, after calling the function is invalid.
> >
> > Will this disconnect and reconnect be serialized? Transactions which go
> > through hubs are serialized, so I expect so. But I've been wrong before,
> > so I want to ask explicitly.
>
> Yeah, it'll go through the normal code path which is pretty much
> serialized right now (only non case is the remove HC path).
>
> I have a patch that truly serializes everything. (Rebuilding some of my
> patches after my development system corrupted some of my sources, grr)
Excellent! If that's the case, I can drop a bunch of spin_lock_irqsave()
calls all over the place. I presume that probes and disconnects will be
serialized into one stream?
> > Also, will the disconnect and reconnect occur before the function returns?
> > Just the disconnect? Neither?
>
> Dunno. It's a race condition. I'd suggest being done with the device
> structure before calling the function.
That's an important point to make. There should definately be a note in
the comments about that.
> > > usb_set_port_feature is part of hub.c (declared static) so you may want
> > > to throw the function in hub.c and export the symbol from there.
> >
> > Probably a good idea. Or, perhaps it could go into usb.c -- tho in either
> > case it winds up in the core module.
>
> You could put it in usb.c, but you'd have to play with prototypes, etc.
I hate to take the wimpy way out of this, but I think I'll leave it in
your capable hands. :)
Matt Dharm
--
Matthew Dharm Home: [EMAIL PROTECTED]
Engineer, Qualcomm, Inc. Work: [EMAIL PROTECTED]
I don't have a left mouse button. I only have one mouse and it's on my right.
-- Customer
User Friendly, 2/13/1999
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]