[RFC] status error patch
Roman Kagan
rkagan at mail.ru
Tue May 17 16:38:50 EDT 2005
On Mon, May 16, 2005 at 11:07:47PM +0200, matthieu castet wrote:
> Duncan Sands wrote:
> >On Mon, 2005-05-16 at 11:25 +0200, castet.matthieu at free.fr wrote:
> >>What I am saying is that -EILSEQ errors happen for each packet that have
> >>actual_length = 0. So it is happen a lot when you don't download at full
> >>time
> >>(most of the time).
> >
> >Is this a problem with the modem, or with your host controller? I guess
> >you can find out by plugging in some other device with an isoc endpoint.
> >
> No, other people (at least 4) have the same errors.
Do you see this with uhci only, or ohci too?
There seems to be a certain difference between the two drivers when it
comes to handling iso transfers: uhci returns in urb->status the last
non-zero ->status of the iso packets in this urb, while ohci doesn't
fill urb->status in for iso transfers _at_all_.
OTOH drivers/usb/host/ohci-q.c contains:
/* calculate transfer length/status and update the urb
* PRECONDITION: irqsafe (only for urb->status locking)
*/
static void td_done (struct ohci_hcd *ohci, struct urb *urb, struct td *td)
{
...
/* ISO ... drivers see per-TD length/status */
if (tdINFO & TD_ISO) {
...
if (usb_pipeout (urb->pipe))
dlen = urb->iso_frame_desc [td->index].length;
else {
/* short reads are always OK for ISO */
if (cc == TD_DATAUNDERRUN)
cc = TD_CC_NOERROR;
dlen = tdPSW & 0x3ff;
}
urb->actual_length += dlen;
urb->iso_frame_desc [td->index].actual_length = dlen;
urb->iso_frame_desc [td->index].status = cc_to_error [cc];
...
which suggests that what you see - zero length iso packets - are
actually short reads, and should perhaps be treated as no error at all,
but at the _hcd_ level.
So I suggest, instead of patching usbatm, patch
a) uhci-q.c - to ignore short reads like ohci does
b) ohci-q.c - to propagate iso packet status into urb status
and see if USB experts are OK with it. Then usbatm should be fine (BTW
why do you need to workaround other error conditions but -EILSEQ?).
Unfortunately I'm totally busy these days, I'll only have a chance to
code something on the coming weekend...
Cheers,
Roman.
More information about the Usbatm
mailing list