diff options
Diffstat (limited to 'drivers/usb/host/xhci-dbgtty.c')
-rw-r--r-- | drivers/usb/host/xhci-dbgtty.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/usb/host/xhci-dbgtty.c b/drivers/usb/host/xhci-dbgtty.c index 8d47b6fbf973..75f0b92694ba 100644 --- a/drivers/usb/host/xhci-dbgtty.c +++ b/drivers/usb/host/xhci-dbgtty.c | |||
@@ -92,21 +92,23 @@ static void dbc_start_rx(struct dbc_port *port) | |||
92 | static void | 92 | static void |
93 | dbc_read_complete(struct xhci_hcd *xhci, struct dbc_request *req) | 93 | dbc_read_complete(struct xhci_hcd *xhci, struct dbc_request *req) |
94 | { | 94 | { |
95 | unsigned long flags; | ||
95 | struct xhci_dbc *dbc = xhci->dbc; | 96 | struct xhci_dbc *dbc = xhci->dbc; |
96 | struct dbc_port *port = &dbc->port; | 97 | struct dbc_port *port = &dbc->port; |
97 | 98 | ||
98 | spin_lock(&port->port_lock); | 99 | spin_lock_irqsave(&port->port_lock, flags); |
99 | list_add_tail(&req->list_pool, &port->read_queue); | 100 | list_add_tail(&req->list_pool, &port->read_queue); |
100 | tasklet_schedule(&port->push); | 101 | tasklet_schedule(&port->push); |
101 | spin_unlock(&port->port_lock); | 102 | spin_unlock_irqrestore(&port->port_lock, flags); |
102 | } | 103 | } |
103 | 104 | ||
104 | static void dbc_write_complete(struct xhci_hcd *xhci, struct dbc_request *req) | 105 | static void dbc_write_complete(struct xhci_hcd *xhci, struct dbc_request *req) |
105 | { | 106 | { |
107 | unsigned long flags; | ||
106 | struct xhci_dbc *dbc = xhci->dbc; | 108 | struct xhci_dbc *dbc = xhci->dbc; |
107 | struct dbc_port *port = &dbc->port; | 109 | struct dbc_port *port = &dbc->port; |
108 | 110 | ||
109 | spin_lock(&port->port_lock); | 111 | spin_lock_irqsave(&port->port_lock, flags); |
110 | list_add(&req->list_pool, &port->write_pool); | 112 | list_add(&req->list_pool, &port->write_pool); |
111 | switch (req->status) { | 113 | switch (req->status) { |
112 | case 0: | 114 | case 0: |
@@ -119,7 +121,7 @@ static void dbc_write_complete(struct xhci_hcd *xhci, struct dbc_request *req) | |||
119 | req->status); | 121 | req->status); |
120 | break; | 122 | break; |
121 | } | 123 | } |
122 | spin_unlock(&port->port_lock); | 124 | spin_unlock_irqrestore(&port->port_lock, flags); |
123 | } | 125 | } |
124 | 126 | ||
125 | static void xhci_dbc_free_req(struct dbc_ep *dep, struct dbc_request *req) | 127 | static void xhci_dbc_free_req(struct dbc_ep *dep, struct dbc_request *req) |
@@ -327,12 +329,13 @@ static void dbc_rx_push(unsigned long _port) | |||
327 | { | 329 | { |
328 | struct dbc_request *req; | 330 | struct dbc_request *req; |
329 | struct tty_struct *tty; | 331 | struct tty_struct *tty; |
332 | unsigned long flags; | ||
330 | bool do_push = false; | 333 | bool do_push = false; |
331 | bool disconnect = false; | 334 | bool disconnect = false; |
332 | struct dbc_port *port = (void *)_port; | 335 | struct dbc_port *port = (void *)_port; |
333 | struct list_head *queue = &port->read_queue; | 336 | struct list_head *queue = &port->read_queue; |
334 | 337 | ||
335 | spin_lock_irq(&port->port_lock); | 338 | spin_lock_irqsave(&port->port_lock, flags); |
336 | tty = port->port.tty; | 339 | tty = port->port.tty; |
337 | while (!list_empty(queue)) { | 340 | while (!list_empty(queue)) { |
338 | req = list_first_entry(queue, struct dbc_request, list_pool); | 341 | req = list_first_entry(queue, struct dbc_request, list_pool); |
@@ -392,16 +395,17 @@ static void dbc_rx_push(unsigned long _port) | |||
392 | if (!disconnect) | 395 | if (!disconnect) |
393 | dbc_start_rx(port); | 396 | dbc_start_rx(port); |
394 | 397 | ||
395 | spin_unlock_irq(&port->port_lock); | 398 | spin_unlock_irqrestore(&port->port_lock, flags); |
396 | } | 399 | } |
397 | 400 | ||
398 | static int dbc_port_activate(struct tty_port *_port, struct tty_struct *tty) | 401 | static int dbc_port_activate(struct tty_port *_port, struct tty_struct *tty) |
399 | { | 402 | { |
403 | unsigned long flags; | ||
400 | struct dbc_port *port = container_of(_port, struct dbc_port, port); | 404 | struct dbc_port *port = container_of(_port, struct dbc_port, port); |
401 | 405 | ||
402 | spin_lock_irq(&port->port_lock); | 406 | spin_lock_irqsave(&port->port_lock, flags); |
403 | dbc_start_rx(port); | 407 | dbc_start_rx(port); |
404 | spin_unlock_irq(&port->port_lock); | 408 | spin_unlock_irqrestore(&port->port_lock, flags); |
405 | 409 | ||
406 | return 0; | 410 | return 0; |
407 | } | 411 | } |