diff options
Diffstat (limited to 'tty/cdc-acm-remove-dead-code.patch')
| -rw-r--r-- | tty/cdc-acm-remove-dead-code.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/tty/cdc-acm-remove-dead-code.patch b/tty/cdc-acm-remove-dead-code.patch new file mode 100644 index 00000000000000..6b587a7f169571 --- /dev/null +++ b/tty/cdc-acm-remove-dead-code.patch @@ -0,0 +1,62 @@ +From arnd@arndb.de Wed Jun 16 13:42:49 2010 +From: Arnd Bergmann <arnd@arndb.de> +Date: Tue, 1 Jun 2010 22:53:04 +0200 +Subject: cdc-acm: remove dead code +To: Greg KH <gregkh@suse.de> +Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>, Alan Cox <alan@lxorguk.ukuu.org.uk>, Frederic Weisbecker <fweisbec@gmail.com>, John Kacur <jkacur@redhat.com> +Message-ID: <1275425591-8803-25-git-send-email-arnd@arndb.de> + + +The wait_event_interruptible_timeout in acm_port_down is +never reached. Remove it to avoid possible deadlocks +with the big tty mutex if someone were to start using +the blocking version of acm_port_down. + +Signed-off-by: Arnd Bergmann <arnd@arndb.de> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/class/cdc-acm.c | 12 +++--------- + 1 file changed, 3 insertions(+), 9 deletions(-) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -636,19 +636,13 @@ static void acm_tty_unregister(struct ac + + static int acm_tty_chars_in_buffer(struct tty_struct *tty); + +-static void acm_port_down(struct acm *acm, int drain) ++static void acm_port_down(struct acm *acm) + { + int i, nr = acm->rx_buflimit; + mutex_lock(&open_mutex); + if (acm->dev) { + usb_autopm_get_interface(acm->control); + acm_set_control(acm, acm->ctrlout = 0); +- /* try letting the last writes drain naturally */ +- if (drain) { +- wait_event_interruptible_timeout(acm->drain_wait, +- (ACM_NW == acm_wb_is_avail(acm)) || !acm->dev, +- ACM_CLOSE_TIMEOUT * HZ); +- } + usb_kill_urb(acm->ctrlurb); + for (i = 0; i < ACM_NW; i++) + usb_kill_urb(acm->wb[i].urb); +@@ -664,7 +658,7 @@ static void acm_tty_hangup(struct tty_st + { + struct acm *acm = tty->driver_data; + tty_port_hangup(&acm->port); +- acm_port_down(acm, 0); ++ acm_port_down(acm); + } + + static void acm_tty_close(struct tty_struct *tty, struct file *filp) +@@ -685,7 +679,7 @@ static void acm_tty_close(struct tty_str + mutex_unlock(&open_mutex); + return; + } +- acm_port_down(acm, 0); ++ acm_port_down(acm); + tty_port_close_end(&acm->port, tty); + tty_port_tty_set(&acm->port, NULL); + } |
