diff options
Diffstat (limited to 'drivers/usb/serial/symbolserial.c')
-rw-r--r-- | drivers/usb/serial/symbolserial.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c index cb7e95f9fcbf..b282c0f2d8e5 100644 --- a/drivers/usb/serial/symbolserial.c +++ b/drivers/usb/serial/symbolserial.c | |||
@@ -165,34 +165,36 @@ static void symbol_throttle(struct tty_struct *tty) | |||
165 | { | 165 | { |
166 | struct usb_serial_port *port = tty->driver_data; | 166 | struct usb_serial_port *port = tty->driver_data; |
167 | struct symbol_private *priv = usb_get_serial_data(port->serial); | 167 | struct symbol_private *priv = usb_get_serial_data(port->serial); |
168 | unsigned long flags; | ||
169 | 168 | ||
170 | dbg("%s - port %d", __func__, port->number); | 169 | dbg("%s - port %d", __func__, port->number); |
171 | spin_lock_irqsave(&priv->lock, flags); | 170 | spin_lock_irq(&priv->lock); |
172 | priv->throttled = true; | 171 | priv->throttled = true; |
173 | spin_unlock_irqrestore(&priv->lock, flags); | 172 | spin_unlock_irq(&priv->lock); |
174 | } | 173 | } |
175 | 174 | ||
176 | static void symbol_unthrottle(struct tty_struct *tty) | 175 | static void symbol_unthrottle(struct tty_struct *tty) |
177 | { | 176 | { |
178 | struct usb_serial_port *port = tty->driver_data; | 177 | struct usb_serial_port *port = tty->driver_data; |
179 | struct symbol_private *priv = usb_get_serial_data(port->serial); | 178 | struct symbol_private *priv = usb_get_serial_data(port->serial); |
180 | unsigned long flags; | ||
181 | int result; | 179 | int result; |
180 | bool was_throttled; | ||
182 | 181 | ||
183 | dbg("%s - port %d", __func__, port->number); | 182 | dbg("%s - port %d", __func__, port->number); |
184 | 183 | ||
185 | spin_lock_irqsave(&priv->lock, flags); | 184 | spin_lock_irq(&priv->lock); |
186 | priv->throttled = false; | 185 | priv->throttled = false; |
186 | was_throttled = priv->actually_throttled; | ||
187 | priv->actually_throttled = false; | 187 | priv->actually_throttled = false; |
188 | spin_unlock_irqrestore(&priv->lock, flags); | 188 | spin_unlock_irq(&priv->lock); |
189 | 189 | ||
190 | priv->int_urb->dev = port->serial->dev; | 190 | priv->int_urb->dev = port->serial->dev; |
191 | result = usb_submit_urb(priv->int_urb, GFP_ATOMIC); | 191 | if (was_throttled) { |
192 | if (result) | 192 | result = usb_submit_urb(priv->int_urb, GFP_KERNEL); |
193 | dev_err(&port->dev, | 193 | if (result) |
194 | "%s - failed submitting read urb, error %d\n", | 194 | dev_err(&port->dev, |
195 | "%s - failed submitting read urb, error %d\n", | ||
195 | __func__, result); | 196 | __func__, result); |
197 | } | ||
196 | } | 198 | } |
197 | 199 | ||
198 | static int symbol_startup(struct usb_serial *serial) | 200 | static int symbol_startup(struct usb_serial *serial) |