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/iuu_phoenix.c 
linux-2.6.25-rc2-mm1/drivers/usb/serial/iuu_phoenix.c
--- linux.vanilla-2.6.25-rc2-mm1/drivers/usb/serial/iuu_phoenix.c       
2008-02-19 11:03:01.000000000 +0000
+++ linux-2.6.25-rc2-mm1/drivers/usb/serial/iuu_phoenix.c       2008-02-20 
11:52:43.000000000 +0000
@@ -148,20 +148,21 @@
                        unsigned int set, unsigned int clear)
 {
        struct iuu_private *priv = usb_get_serial_port_data(port);
-       struct tty_struct *tty;
-       tty = port->tty;
+       unsigned long flags;
 
+       /* FIXME: locking on tiomstatus */
        dbg("%s (%d) msg : SET = 0x%04x, CLEAR = 0x%04x ", __FUNCTION__,
            port->number, set, clear);
+
+       spin_lock_irqsave(&priv->lock, flags);
        if (set & TIOCM_RTS)
                priv->tiostatus = TIOCM_RTS;
 
        if (!(set & TIOCM_RTS) && priv->tiostatus == TIOCM_RTS) {
                dbg("%s TIOCMSET RESET called !!!", __FUNCTION__);
                priv->reset = 1;
-               return 0;
        }
-
+       spin_unlock_irqrestore(&priv->lock, flags);
        return 0;
 }
 
@@ -173,7 +174,14 @@
 static int iuu_tiocmget(struct usb_serial_port *port, struct file *file)
 {
        struct iuu_private *priv = usb_get_serial_port_data(port);
-       return priv->tiostatus;
+       unsigned long flags;
+       int rc;
+       
+       spin_lock_irqsave(&priv->lock, flags);
+       rc = priv->tiostatus;
+       spin_unlock_irqrestore(&priv->lock, flags);
+
+       return rc;
 }
 
 static void iuu_rxcmd(struct urb *urb)
-
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