On Tuesday 19 Aug 2003 13:04, Ian Abbott wrote:
> Hi folks,
>
> This patch is against a local copy of Greg's usb-2.4 tree and is
> for the ftdi_sio driver.
>
> The patch tidies up the write bulk callback function a little bit
> - removing some unnecessary paranoid checks and scheduling a soft
> interrupt regardless of the port's open count (for consistency
> with other usb serial drivers).

Actually, I've just noticed that removal of the port open count 
check in the write bulk callback function sometimes results in a 
kernel oops (and sometimes doesn't) when the write bulk callbacks 
occur after a close, so I'd like to put that check back in - at 
least in the usb-2.4 version.

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

-- 
-=( 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.1109  -> 1.1110 
#	drivers/usb/serial/ftdi_sio.c	1.48    -> 1.49   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/08/19	[EMAIL PROTECTED]	1.1110
# In the ftdi_sio driver's write bulk callback function, reinstate the check that the port's
# open count is >0 before queuing the task, as this avoids a kernel oops.
# --------------------------------------------
#
diff -Nru a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
--- a/drivers/usb/serial/ftdi_sio.c	Tue Aug 19 17:11:33 2003
+++ b/drivers/usb/serial/ftdi_sio.c	Tue Aug 19 17:11:33 2003
@@ -19,7 +19,6 @@
  *
  * (19/Aug/2003) Ian Abbott
  *      Omitted some paranoid checks in write bulk callback that don't matter.
- *      Queued task in write bulk callback regardless of port's open count.
  *
  * (05/Aug/2003) Ian Abbott
  *      Added VID/PID for ID TECH IDT1221U USB to RS-232 adapter.
@@ -1466,8 +1465,10 @@
 		return;
 	}
 
-	queue_task(&port->tqueue, &tq_immediate);
-	mark_bh(IMMEDIATE_BH);
+	if (port->open_count > 0) {
+		queue_task(&port->tqueue, &tq_immediate);
+		mark_bh(IMMEDIATE_BH);
+	}
 } /* ftdi_write_bulk_callback */
 
 

Reply via email to