On Tuesday 19 Aug 2003 21:57, Greg KH wrote: > On Tue, Aug 19, 2003 at 05:14:28PM +0100, Ian Abbott wrote: > > The attached patch (usb-2.4-ftdi_sio-wbcbfix.patch) reinstates > > the port->open_count check in the ftdi_write_bulk_callback > > function, and should be applied after my earlier patch > > 'usb-2.4-ftdi_sio-wbcleanup.patch'. > > So you're just really getting rid of the "serial" pointer check, > right? That's fine, but can you send me just one patch that does > this instead?
The attached patch combines the changes, but apart from a tiny reduction in code size, it doesn't achieve anything, but doesn't seem to cause any harm either. I'll leave it to your discretion whether or not to apply it. As I mentioned previously, leaving the port->open_count check in (to only schedule a soft interrupt when the port is open) seems to prevent an oops, but I suppose it just makes the oops less likely to happen rather than eliminate it entirely. -- -=( Ian Abbott @ MEV Ltd. E-mail: <[EMAIL PROTECTED]> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
# This is a BitKeeper generated patch for the following project: # Project Name: greg k-h's linux 2.4 USB kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1108 -> 1.1109 # drivers/usb/serial/ftdi_sio.c 1.47 -> 1.48 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/08/20 [EMAIL PROTECTED] 1.1109 # For ftdi_sio, omitted a paranoid check in the write bulk callback function that doesn't matter. # -------------------------------------------- # diff -Nru a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c --- a/drivers/usb/serial/ftdi_sio.c Wed Aug 20 10:59:43 2003 +++ b/drivers/usb/serial/ftdi_sio.c Wed Aug 20 10:59:43 2003 @@ -17,6 +17,9 @@ * See http://ftdi-usb-sio.sourceforge.net for upto date testing info * and extra documentation * + * (19/Aug/2003) Ian Abbott + * Omitted some paranoid checks in write bulk callback that don't matter. + * * (05/Aug/2003) Ian Abbott * Added VID/PID for ID TECH IDT1221U USB to RS-232 adapter. * VID/PID provided by Steve Briggs. @@ -1451,33 +1454,21 @@ static void ftdi_write_bulk_callback (struct urb *urb) { struct usb_serial_port *port = (struct usb_serial_port *)urb->context; - struct usb_serial *serial; - - dbg("%s", __FUNCTION__); if (port_paranoia_check (port, __FUNCTION__)) return; + dbg("%s - port %d", __FUNCTION__, port->number); + if (urb->status) { dbg("nonzero write bulk status received: %d", urb->status); return; } - serial = get_usb_serial (port, __FUNCTION__); - if (!serial) { - dbg("%s - bad serial pointer, exiting", __FUNCTION__); - return; - } - - /* Have to check for validity of queueing up the tasks */ - dbg("%s - port->open_count = %d", __FUNCTION__, port->open_count); - if (port->open_count > 0){ queue_task(&port->tqueue, &tq_immediate); mark_bh(IMMEDIATE_BH); - } - - return; + } } /* ftdi_write_bulk_callback */
