diff options
Diffstat (limited to 'drivers/isdn/gigaset/bas-gigaset.c')
-rw-r--r-- | drivers/isdn/gigaset/bas-gigaset.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c index 527588708948..c44950d3eb7b 100644 --- a/drivers/isdn/gigaset/bas-gigaset.c +++ b/drivers/isdn/gigaset/bas-gigaset.c | |||
@@ -617,7 +617,13 @@ static void int_in_work(struct work_struct *work) | |||
617 | if (rc == 0) | 617 | if (rc == 0) |
618 | /* success, resubmit interrupt read URB */ | 618 | /* success, resubmit interrupt read URB */ |
619 | rc = usb_submit_urb(urb, GFP_ATOMIC); | 619 | rc = usb_submit_urb(urb, GFP_ATOMIC); |
620 | if (rc != 0 && rc != -ENODEV) { | 620 | |
621 | switch (rc) { | ||
622 | case 0: /* success */ | ||
623 | case -ENODEV: /* device gone */ | ||
624 | case -EINVAL: /* URB already resubmitted, or terminal badness */ | ||
625 | break; | ||
626 | default: /* failure: try to recover by resetting the device */ | ||
621 | dev_err(cs->dev, "clear halt failed: %s\n", get_usb_rcmsg(rc)); | 627 | dev_err(cs->dev, "clear halt failed: %s\n", get_usb_rcmsg(rc)); |
622 | rc = usb_lock_device_for_reset(ucs->udev, ucs->interface); | 628 | rc = usb_lock_device_for_reset(ucs->udev, ucs->interface); |
623 | if (rc == 0) { | 629 | if (rc == 0) { |
@@ -2442,7 +2448,9 @@ static void gigaset_disconnect(struct usb_interface *interface) | |||
2442 | } | 2448 | } |
2443 | 2449 | ||
2444 | /* gigaset_suspend | 2450 | /* gigaset_suspend |
2445 | * This function is called before the USB connection is suspended. | 2451 | * This function is called before the USB connection is suspended |
2452 | * or before the USB device is reset. | ||
2453 | * In the latter case, message == PMSG_ON. | ||
2446 | */ | 2454 | */ |
2447 | static int gigaset_suspend(struct usb_interface *intf, pm_message_t message) | 2455 | static int gigaset_suspend(struct usb_interface *intf, pm_message_t message) |
2448 | { | 2456 | { |
@@ -2498,7 +2506,12 @@ static int gigaset_suspend(struct usb_interface *intf, pm_message_t message) | |||
2498 | del_timer_sync(&ucs->timer_atrdy); | 2506 | del_timer_sync(&ucs->timer_atrdy); |
2499 | del_timer_sync(&ucs->timer_cmd_in); | 2507 | del_timer_sync(&ucs->timer_cmd_in); |
2500 | del_timer_sync(&ucs->timer_int_in); | 2508 | del_timer_sync(&ucs->timer_int_in); |
2501 | cancel_work_sync(&ucs->int_in_wq); | 2509 | |
2510 | /* don't try to cancel int_in_wq from within reset as it | ||
2511 | * might be the one requesting the reset | ||
2512 | */ | ||
2513 | if (message.event != PM_EVENT_ON) | ||
2514 | cancel_work_sync(&ucs->int_in_wq); | ||
2502 | 2515 | ||
2503 | gig_dbg(DEBUG_SUSPEND, "suspend complete"); | 2516 | gig_dbg(DEBUG_SUSPEND, "suspend complete"); |
2504 | return 0; | 2517 | return 0; |