Signed-off-by: Alan Cox <[EMAIL PROTECTED]>

diff -u --new-file --recursive --exclude-from /usr/src/exclude 
linux.vanilla-2.6.25-rc2-mm1/drivers/usb/serial/ti_usb_3410_5052.c 
linux-2.6.25-rc2-mm1/drivers/usb/serial/ti_usb_3410_5052.c
--- linux.vanilla-2.6.25-rc2-mm1/drivers/usb/serial/ti_usb_3410_5052.c  
2008-02-19 11:03:01.000000000 +0000
+++ linux-2.6.25-rc2-mm1/drivers/usb/serial/ti_usb_3410_5052.c  2008-02-20 
11:53:06.000000000 +0000
@@ -1022,14 +1022,17 @@
        unsigned int result;
        unsigned int msr;
        unsigned int mcr;
+       unsigned long flags;
 
        dbg("%s - port %d", __FUNCTION__, port->number);
 
        if (tport == NULL)
                return -ENODEV;
 
+       spin_lock_irqsave(&tport->tp_lock, flags);
        msr = tport->tp_msr;
        mcr = tport->tp_shadow_mcr;
+       spin_unlock_irqrestore(&tport->tp_lock, flags);
 
        result = ((mcr & TI_MCR_DTR) ? TIOCM_DTR : 0)
                | ((mcr & TI_MCR_RTS) ? TIOCM_RTS : 0)
@@ -1050,12 +1053,14 @@
 {
        struct ti_port *tport = usb_get_serial_port_data(port);
        unsigned int mcr;
+       unsigned long flags;
 
        dbg("%s - port %d", __FUNCTION__, port->number);
 
        if (tport == NULL)
                return -ENODEV;
 
+       spin_lock_irqsave(&tport->tp_lock, flags);
        mcr = tport->tp_shadow_mcr;
 
        if (set & TIOCM_RTS)
@@ -1071,6 +1076,7 @@
                mcr &= ~TI_MCR_DTR;
        if (clear & TIOCM_LOOP)
                mcr &= ~TI_MCR_LOOP;
+       spin_unlock_irqrestore(&tport->tp_lock, flags);
 
        return ti_set_mcr(tport, mcr);
 }
@@ -1358,14 +1364,17 @@
 
 static int ti_set_mcr(struct ti_port *tport, unsigned int mcr)
 {
+       unsigned long flags;
        int status;
 
        status = ti_write_byte(tport->tp_tdev,
                tport->tp_uart_base_addr + TI_UART_OFFSET_MCR,
                TI_MCR_RTS | TI_MCR_DTR | TI_MCR_LOOP, mcr);
 
+       spin_lock_irqsave(&tport->tp_lock, flags);
        if (!status)
                tport->tp_shadow_mcr = mcr;
+       spin_unlock_irqrestore(&tport->tp_lock, flags);
 
        return status;
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to