aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2008-01-22 06:47:15 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-02-01 17:35:05 -0500
commit3edbc986509888fa9977cc180c1fe458d2f89076 (patch)
treed80fa46312676df21cf89af632f15e1ac94c9f82 /drivers/usb
parentb0a239da17beb34354181bebb744c0b0d534967f (diff)
USB: kl5kusb105 don't flush to logically disconnected devices
If disconnect() is called for a logical disconnect, no more IO must be done after disconnect() returns, or the old and new drivers may conflict. This patch avoids this by using the flag and lock introduced by the earlier patch for the mos7720 driver. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/kl5kusb105.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index 90e3216abd1f..55736df7d2f4 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -461,17 +461,21 @@ static void klsi_105_close (struct usb_serial_port *port, struct file *filp)
461 461
462 dbg("%s port %d", __FUNCTION__, port->number); 462 dbg("%s port %d", __FUNCTION__, port->number);
463 463
464 /* send READ_OFF */ 464 mutex_lock(&port->serial->disc_mutex);
465 rc = usb_control_msg (port->serial->dev, 465 if (!port->serial->disconnected) {
466 usb_sndctrlpipe(port->serial->dev, 0), 466 /* send READ_OFF */
467 KL5KUSB105A_SIO_CONFIGURE, 467 rc = usb_control_msg (port->serial->dev,
468 USB_TYPE_VENDOR | USB_DIR_OUT, 468 usb_sndctrlpipe(port->serial->dev, 0),
469 KL5KUSB105A_SIO_CONFIGURE_READ_OFF, 469 KL5KUSB105A_SIO_CONFIGURE,
470 0, /* index */ 470 USB_TYPE_VENDOR | USB_DIR_OUT,
471 NULL, 0, 471 KL5KUSB105A_SIO_CONFIGURE_READ_OFF,
472 KLSI_TIMEOUT); 472 0, /* index */
473 if (rc < 0) 473 NULL, 0,
474 err("Disabling read failed (error = %d)", rc); 474 KLSI_TIMEOUT);
475 if (rc < 0)
476 err("Disabling read failed (error = %d)", rc);
477 }
478 mutex_unlock(&port->serial->disc_mutex);
475 479
476 /* shutdown our bulk reads and writes */ 480 /* shutdown our bulk reads and writes */
477 usb_kill_urb(port->write_urb); 481 usb_kill_urb(port->write_urb);