Hi Oliver, Am 10.10.2012 20:51, schrieb Oliver Neukum: > As pre_reset() and suspend() are identical there is a problem with > resetting. > > /* kill all URBs and delayed work that might still be pending */ > usb_kill_urb(ucs->urb_ctrl); > usb_kill_urb(ucs->urb_int_in); > del_timer_sync(&ucs->timer_ctrl); > del_timer_sync(&ucs->timer_atrdy); > del_timer_sync(&ucs->timer_cmd_in); > del_timer_sync(&ucs->timer_int_in); > cancel_work_sync(&ucs->int_in_wq); > > You are calling cancel_work_sync(). However int_in_work() may itself > be resetting the device. This seems to be a situation that should be avoided. Good point. I'll have to think about that. At first sight, I can simply omit the cancel_work_sync() in the pre_reset() case. In the worst case, the uncancelled int_in_work() will call usb_clear_halt(), try to resubmit the already submitted URB, fail, and trigger another reset needlessly. Doesn't sound too bad? The alternative would be to introduce a new flag in the device state to skip the cancel_work_sync() call if int_in_work() is in the call to usb_reset_device(). Thanks, Tilman -- Tilman Schmidt E-Mail: tilman@xxxxxxx Bonn, Germany Diese Nachricht besteht zu 100% aus wiederverwerteten Bits. Ungeöffnet mindestens haltbar bis: (siehe Rückseite)
Attachment:
signature.asc
Description: OpenPGP digital signature