From: Johan Hovold Date: Tue, 19 Mar 2013 08:21:19 +0000 (+0100) Subject: USB: mos7840: fix broken TIOCMIWAIT X-Git-Tag: v3.2.44~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=928ab2854c082067496ca91c0495a60b17d7bf9e;p=thirdparty%2Fkernel%2Fstable.git USB: mos7840: fix broken TIOCMIWAIT commit e670c6af12517d08a403487b1122eecf506021cf upstream. Make sure waiting processes are woken on modem-status changes. Currently processes are only woken on termios changes regardless of whether the modem status has changed. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings --- diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 43a38aab24e54..30ef604766e63 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -453,6 +453,9 @@ static void mos7840_handle_new_msr(struct moschip_port *port, __u8 new_msr) icount->rng++; smp_wmb(); } + + mos7840_port->delta_msr_cond = 1; + wake_up_interruptible(&mos7840_port->delta_msr_wait); } } @@ -2073,8 +2076,6 @@ static void mos7840_change_port_settings(struct tty_struct *tty, mos7840_port->read_urb_busy = false; } } - wake_up(&mos7840_port->delta_msr_wait); - mos7840_port->delta_msr_cond = 1; dbg("mos7840_change_port_settings mos7840_port->shadowLCR is End %x", mos7840_port->shadowLCR); }