mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-29 23:53:55 +08:00
USB: serial: io_ti: use irqsave() in USB's complete callback
The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Signed-off-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
parent
dd1fae5276
commit
6778b0cbdb
@ -1729,6 +1729,7 @@ static void edge_bulk_in_callback(struct urb *urb)
|
|||||||
struct edgeport_port *edge_port = urb->context;
|
struct edgeport_port *edge_port = urb->context;
|
||||||
struct device *dev = &edge_port->port->dev;
|
struct device *dev = &edge_port->port->dev;
|
||||||
unsigned char *data = urb->transfer_buffer;
|
unsigned char *data = urb->transfer_buffer;
|
||||||
|
unsigned long flags;
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
int port_number;
|
int port_number;
|
||||||
int status = urb->status;
|
int status = urb->status;
|
||||||
@ -1780,13 +1781,13 @@ static void edge_bulk_in_callback(struct urb *urb)
|
|||||||
|
|
||||||
exit:
|
exit:
|
||||||
/* continue read unless stopped */
|
/* continue read unless stopped */
|
||||||
spin_lock(&edge_port->ep_lock);
|
spin_lock_irqsave(&edge_port->ep_lock, flags);
|
||||||
if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING)
|
if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING)
|
||||||
retval = usb_submit_urb(urb, GFP_ATOMIC);
|
retval = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
else if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPING)
|
else if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPING)
|
||||||
edge_port->ep_read_urb_state = EDGE_READ_URB_STOPPED;
|
edge_port->ep_read_urb_state = EDGE_READ_URB_STOPPED;
|
||||||
|
|
||||||
spin_unlock(&edge_port->ep_lock);
|
spin_unlock_irqrestore(&edge_port->ep_lock, flags);
|
||||||
if (retval)
|
if (retval)
|
||||||
dev_err(dev, "%s - usb_submit_urb failed with result %d\n", __func__, retval);
|
dev_err(dev, "%s - usb_submit_urb failed with result %d\n", __func__, retval);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user