Re: pl2303/usb-serial driver problem in 2.4.27-pre6

From: Paul Fulghum
Date: Wed Oct 27 2004 - 15:28:22 EST


On Sat, 2004-10-23 at 19:14, Paul Fulghum wrote:
> This change fits the reported symptom (loss of receive data).
>
> The change preserves line status errors
> across multiple read interrupt callbacks until the error
> can be applied to the contents of the next read bulk callback.
>
> What looks wrong to me is that the line status error,
> which should be associated with an individual character,
> is applied to the entire contents of the next bulk read.
> Wouldn't this potentially invalidate good data?
>
> I'm not familiar with the operation of USB-serial converters,
> so I don't know exactly how the flow of read interrupt and
> read bulk callbacks are implemented to handle character errors.
>
> If I was to guess, before the change, errors were lost
> (overwritten by the next read interrupt callback)
> so the mask was added to preserve the error.
> But the error is applied to more data than it should,
> causing loss of valid receive data.

USB CDC 1.1 does not specify how these error indications
relate to subsequent bulk data packets. I could not find
manufacturer info that helps. BSD drivers don't do
error processing at all.

Here is a patch that applies the error only to the
next receive byte instead of all bytes in the
next read bulk packet.

Greg: Any comment?

Oleksiy: Can you try this patch?

Thanks,
Paul

--
Paul Fulghum
paulkf@xxxxxxxxxxxxx

--- linux-2.4.28-pre4/drivers/usb/serial/pl2303.c 2004-08-07 18:26:05.000000000 -0500
+++ linux-2.4.28-pre4-mg/drivers/usb/serial/pl2303.c 2004-10-27 15:09:09.000000000 -0500
@@ -799,6 +799,7 @@ static void pl2303_read_bulk_callback (s
tty_flip_buffer_push(tty);
}
tty_insert_flip_char (tty, data[i], tty_flag);
+ tty_flag = TTY_NORMAL;
}
tty_flip_buffer_push (tty);
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/