Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82276
b: refs/heads/master
c: 95bef01
h: refs/heads/master
v: v3
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Feb 1, 2008
1 parent a339af6 commit 4e984cf
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e33fe4d86f91127f6f7d931ff59ed6cbda06e72b
refs/heads/master: 95bef012ea4a3cce437a4fcf59bb097d14944b0d
5 changes: 4 additions & 1 deletion trunk/drivers/usb/serial/airprime.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ static void airprime_close(struct usb_serial_port *port, struct file * filp)
priv->rts_state = 0;
priv->dtr_state = 0;

airprime_send_setup(port);
mutex_lock(&port->serial->disc_mutex);
if (!port->serial->disconnected)
airprime_send_setup(port);
mutex_lock(&port->serial->disc_mutex);

for (i = 0; i < NUM_READ_URBS; ++i) {
usb_kill_urb (priv->read_urbp[i]);
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/usb/serial/cp2101.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,10 @@ static void cp2101_close (struct usb_serial_port *port, struct file * filp)
usb_kill_urb(port->write_urb);
usb_kill_urb(port->read_urb);

cp2101_set_config_single(port, CP2101_UART, UART_DISABLE);
mutex_lock(&port->serial->disc_mutex);
if (!port->serial->disconnected)
cp2101_set_config_single(port, CP2101_UART, UART_DISABLE);
mutex_unlock(&port->serial->disc_mutex);
}

/*
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,8 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp)

dbg("%s", __FUNCTION__);

if (c_cflag & HUPCL){
mutex_lock(&port->serial->disc_mutex);
if (c_cflag & HUPCL && !port->serial->disconnected){
/* Disable flow control */
if (usb_control_msg(port->serial->dev,
usb_sndctrlpipe(port->serial->dev, 0),
Expand All @@ -1212,6 +1213,7 @@ static void ftdi_close (struct usb_serial_port *port, struct file *filp)
/* drop RTS and DTR */
clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
} /* Note change no line if hupcl is off */
mutex_unlock(&port->serial->disc_mutex);

/* cancel any scheduled reading */
cancel_delayed_work(&priv->rx_work);
Expand Down
17 changes: 12 additions & 5 deletions trunk/drivers/usb/serial/garmin_gps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,19 +1020,26 @@ static void garmin_close (struct usb_serial_port *port, struct file * filp)
if (!serial)
return;

garmin_clear(garmin_data_p);
mutex_lock(&port->serial->disc_mutex);
if (!port->serial->disconnected)
garmin_clear(garmin_data_p);

/* shutdown our urbs */
usb_kill_urb (port->read_urb);
usb_kill_urb (port->write_urb);

if (noResponseFromAppLayer(garmin_data_p) ||
((garmin_data_p->flags & CLEAR_HALT_REQUIRED) != 0)) {
process_resetdev_request(port);
garmin_data_p->state = STATE_RESET;
if (!port->serial->disconnected) {
if (noResponseFromAppLayer(garmin_data_p) ||
((garmin_data_p->flags & CLEAR_HALT_REQUIRED) != 0)) {
process_resetdev_request(port);
garmin_data_p->state = STATE_RESET;
} else {
garmin_data_p->state = STATE_DISCONNECTED;
}
} else {
garmin_data_p->state = STATE_DISCONNECTED;
}
mutex_unlock(&port->serial->disc_mutex);
}


Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/usb/serial/visor.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ static void visor_close (struct usb_serial_port *port, struct file * filp)
kfree (transfer_buffer);
}
}
mutex_lock(&port->serial->disc_mutex);
mutex_unlock(&port->serial->disc_mutex);

if (stats)
dev_info(&port->dev, "Bytes In = %d Bytes Out = %d\n",
Expand Down

0 comments on commit 4e984cf

Please sign in to comment.