diff options
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 6bbd203f1861..bc7a2a6fc4ac 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -428,7 +428,7 @@ static void acm_read_bulk_callback(struct urb *urb) | |||
428 | /* throttle device if requested by tty */ | 428 | /* throttle device if requested by tty */ |
429 | spin_lock_irqsave(&acm->read_lock, flags); | 429 | spin_lock_irqsave(&acm->read_lock, flags); |
430 | acm->throttled = acm->throttle_req; | 430 | acm->throttled = acm->throttle_req; |
431 | if (!acm->throttled && !acm->susp_count) { | 431 | if (!acm->throttled) { |
432 | spin_unlock_irqrestore(&acm->read_lock, flags); | 432 | spin_unlock_irqrestore(&acm->read_lock, flags); |
433 | acm_submit_read_urb(acm, rb->index, GFP_ATOMIC); | 433 | acm_submit_read_urb(acm, rb->index, GFP_ATOMIC); |
434 | } else { | 434 | } else { |
@@ -1546,18 +1546,15 @@ static int acm_suspend(struct usb_interface *intf, pm_message_t message) | |||
1546 | struct acm *acm = usb_get_intfdata(intf); | 1546 | struct acm *acm = usb_get_intfdata(intf); |
1547 | int cnt; | 1547 | int cnt; |
1548 | 1548 | ||
1549 | spin_lock_irq(&acm->read_lock); | 1549 | spin_lock_irq(&acm->write_lock); |
1550 | spin_lock(&acm->write_lock); | ||
1551 | if (PMSG_IS_AUTO(message)) { | 1550 | if (PMSG_IS_AUTO(message)) { |
1552 | if (acm->transmitting) { | 1551 | if (acm->transmitting) { |
1553 | spin_unlock(&acm->write_lock); | 1552 | spin_unlock_irq(&acm->write_lock); |
1554 | spin_unlock_irq(&acm->read_lock); | ||
1555 | return -EBUSY; | 1553 | return -EBUSY; |
1556 | } | 1554 | } |
1557 | } | 1555 | } |
1558 | cnt = acm->susp_count++; | 1556 | cnt = acm->susp_count++; |
1559 | spin_unlock(&acm->write_lock); | 1557 | spin_unlock_irq(&acm->write_lock); |
1560 | spin_unlock_irq(&acm->read_lock); | ||
1561 | 1558 | ||
1562 | if (cnt) | 1559 | if (cnt) |
1563 | return 0; | 1560 | return 0; |
@@ -1573,8 +1570,7 @@ static int acm_resume(struct usb_interface *intf) | |||
1573 | struct urb *urb; | 1570 | struct urb *urb; |
1574 | int rv = 0; | 1571 | int rv = 0; |
1575 | 1572 | ||
1576 | spin_lock_irq(&acm->read_lock); | 1573 | spin_lock_irq(&acm->write_lock); |
1577 | spin_lock(&acm->write_lock); | ||
1578 | 1574 | ||
1579 | if (--acm->susp_count) | 1575 | if (--acm->susp_count) |
1580 | goto out; | 1576 | goto out; |
@@ -1600,8 +1596,7 @@ static int acm_resume(struct usb_interface *intf) | |||
1600 | rv = acm_submit_read_urbs(acm, GFP_ATOMIC); | 1596 | rv = acm_submit_read_urbs(acm, GFP_ATOMIC); |
1601 | } | 1597 | } |
1602 | out: | 1598 | out: |
1603 | spin_unlock(&acm->write_lock); | 1599 | spin_unlock_irq(&acm->write_lock); |
1604 | spin_unlock_irq(&acm->read_lock); | ||
1605 | 1600 | ||
1606 | return rv; | 1601 | return rv; |
1607 | } | 1602 | } |