Hi,
The error handling in usblp_write in linux-2.6.18.1 is broken. I suspect
its also broken in 2.6.21 because the code of usblp_write didn't change
since 2.6.18. 

If I use blocking IO and any error happens which makes writeurb_status
nonzero the usblp driver will end up in an endless loop sending status
requests to the printer. The only way to leave this loop is to unplug
the printer because this sets usblp->present to zero.
This is no wonder because the error handler simply continues the loop
without trying again to send data over the USB. The writeurb status will
never change.

Here a simplified version of my problem:

while(writecount < count) {
        ...
        if (usblp->writeurb->status != 0) {
                err = usblp_check_status(usblp, err);
                continue;
        }
        ...
        err = usb_submit_urb(usblp->writeurb, GFP_KERNEL);
        ...
}

How is the intended error behaviour ? Should usblp_write simply retry
forever or should the system call return with an error ? Should there be
a retry limit ?

Jochen




-------------------------------------------------------------------------
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

Reply via email to