Hi,
For devices matching the user-specified device table, the current version doesn't initialize half the stuff used by the driver, leading to oopses when you try and use the device or disconnect it. The attached patch initializes the device the same as those matching the 8U232AM device table.
A longer description and my Signed-off-by line are in the attachment.
-- -=( Ian Abbott @ MEV Ltd. E-mail: <[EMAIL PROTECTED]> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
ftdi_sio: Initialize devices matching the user-specified device table properly to prevent oopses when trying to use it, or when the device is disconnected.
Notes:
(1) The device is initialized as an FT8U232AM, which will work okay for
FT8U232AM and FT232BM devices but not for the original SIO (FT8U100AX)
device.
(2) It is still possible to specify a "baud_base" parameter for the
user-specified device but I don't know why anyone would want to.
Signed-off-by: Ian Abbott <[EMAIL PROTECTED]>
diff -ur a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
--- a/drivers/usb/serial/ftdi_sio.c 2005-04-29 12:07:20.000000000 +0100
+++ b/drivers/usb/serial/ftdi_sio.c 2005-05-17 14:09:50.000000000 +0100
@@ -1238,25 +1238,23 @@
} /* ftdi_HE_TIRA1_startup */
-/* Startup for the 8U232AM chip */
+/* Startup for user specified 8U232AM (or 232BM) device */
static int ftdi_userdev_startup (struct usb_serial *serial)
{
struct ftdi_private *priv;
+ int err;
+
- priv = serial->port->private = kmalloc(sizeof(struct ftdi_private), GFP_KERNEL);
- if (!priv){
- err("%s- kmalloc(%Zd) failed.", __FUNCTION__, sizeof(struct ftdi_private));
- return -ENOMEM;
+ dbg("%s",__FUNCTION__);
+ /* XXX Assume it's a FT8U232AM. An FT232BM device can be used, but
+ * it will behave like a FT8U232AM. -- IJA */
+ err = ftdi_8U232AM_startup(serial);
+ if (err){
+ return (err);
}
- priv->chip_type = FT8U232AM; /* XXX: Hmm. Keep this.... -- REW */
+ priv = serial->port->private;
priv->baud_base = baud_base;
- priv->custom_divisor = 0;
- priv->write_offset = 0;
- init_waitqueue_head(&priv->delta_msr_wait);
- /* This will push the characters through immediately rather
- than queue a task to deliver them */
- priv->flags = ASYNC_LOW_LATENCY;
return (0);
}
