On Sun, 2016-11-06 at 10:07 +0100, Ladislav Michl wrote: > + if (test_bit(EVENT_RX_STALL, &acm->flags)) { > + status = usb_autopm_get_interface(acm->data); > + if (!status) { > + for (i = 0; i < acm->rx_buflimit; i++) { > + usb_kill_urb(acm->read_urbs[i]); > + set_bit(i, &acm->read_urbs_free); > + } > + status = usb_clear_halt(acm->dev, acm->in); > + usb_autopm_put_interface(acm->data); > + if (!status) > + acm_submit_read_urbs(acm, GFP_KERNEL);
Hi, almost. Two issues left with this section. 1. It makes no sense to check the results of usb_clear_halt() If it fails, we cannot do anything sensible. We have to restart IO and hope for the best. Not doing it that way risks introducing a regression. 2. usb_autopm_put_interface() must be after acm_submit_read_urbs() because the URBs are to be killed when the device is suspended. And on a related note: 3. The device may be reset externally before the work queue is executed. pre_reset() needs to clear the flag EVENT_RX_STALL. Regards Oliver -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html