Subject: Re: more ulpt!
To: Lennart Augustsson <lennart@augustsson.net>
From: Alfred Perlstein <bright@mu.org>
List: tech-kern
Date: 02/25/2002 17:49:48
* Lennart Augustsson <lennart@augustsson.net> [020225 17:39] wrote:
> Alfred Perlstein wrote:
> 
> > GRRR!
> >
> > It seems that if I use the /dev/ulpt0 interface, when I do an open(2)
> > on the device, the first time it's ok, however subsequent times
> > hang the process while trying to issue the reset request inside
> > of ulpt_reset().
> >
> > The usbdi.c code takes a "default timeout", shouldn't these requests
> > somehow timeout?
> 
> Yes.

Well they are not. :)  I see processes hung in 'usbsyn' trying
to issue the reset command.

> >  In usbd_transfer() there's a tsleep loop that
> > doesn't use a timeout, is it the responsibility of the
> > pipe->methods->transfer() method to use some sort of callout
> > callback to implement the timeout?
> 
> The transfer() method should handle the timeout (in whatever way
> it likes).

The question is.. is it?

I'm going to investigate some more, but it looks like it's not
doing it properly.

> >  Or do we need to pass an
> > arg to tsleep?
> 
> Shouldn't be necessary.

Yes, I noticed that we are passing the timeout to a callout_reset
which _should_ do something to wake us...

> > Shouldn't the default timeout be a bit shorter it seems to hang
> > forever...
> 
> The USB 1.0 spec allows a device 5s to respond.

Yes, found that out as well, it's just that the code isn't getting
me out of 'usbsyn'.

I'll try some more to track this down.

-Alfred