mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
usb: gadget: serial: resolve spinlock inconsistencies
kernel throws Possbile dead lock at f_serial completion handlers, if we use plain spinlock which dont disables interrupts. To avoid this use spinlock_irqsave instead of plain spinlock which disables interrupts. Signed-off-by: Anji Jonnala <anjir@qualcomm.com>
This commit is contained in:
parent
5f2b17e59d
commit
966c3cd67d
1 changed files with 6 additions and 4 deletions
|
@ -592,20 +592,22 @@ recycle:
|
|||
static void gs_read_complete(struct usb_ep *ep, struct usb_request *req)
|
||||
{
|
||||
struct gs_port *port = ep->driver_data;
|
||||
unsigned long flags;
|
||||
|
||||
/* Queue all received data until the tty layer is ready for it. */
|
||||
spin_lock(&port->port_lock);
|
||||
spin_lock_irqsave(&port->port_lock, flags);
|
||||
port->nbytes_from_host += req->actual;
|
||||
list_add_tail(&req->list, &port->read_queue);
|
||||
tasklet_schedule(&port->push);
|
||||
spin_unlock(&port->port_lock);
|
||||
spin_unlock_irqrestore(&port->port_lock, flags);
|
||||
}
|
||||
|
||||
static void gs_write_complete(struct usb_ep *ep, struct usb_request *req)
|
||||
{
|
||||
struct gs_port *port = ep->driver_data;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock(&port->port_lock);
|
||||
spin_lock_irqsave(&port->port_lock, flags);
|
||||
port->nbytes_to_host += req->actual;
|
||||
list_add(&req->list, &port->write_pool);
|
||||
port->write_started--;
|
||||
|
@ -628,7 +630,7 @@ static void gs_write_complete(struct usb_ep *ep, struct usb_request *req)
|
|||
break;
|
||||
}
|
||||
|
||||
spin_unlock(&port->port_lock);
|
||||
spin_unlock_irqrestore(&port->port_lock, flags);
|
||||
}
|
||||
|
||||
static void gs_free_requests(struct usb_ep *ep, struct list_head *head,
|
||||
|
|
Loading…
Reference in a new issue