Re: [PATCH 4/4] cdc-acm: clear halt condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2016-11-06 at 01:36 +0100, Ladislav Michl wrote:
>  
> @@ -475,7 +490,30 @@ static void acm_softint(struct work_struct *work)
>  {
>  	struct acm *acm = container_of(work, struct acm, work);
>  
> -	tty_port_tty_wakeup(&acm->port);
> +	dev_vdbg(&acm->data->dev, "scheduled work\n");
> +
> +	if (test_bit(EVENT_RX_STALL, &acm->flags)) {
> +		int i, 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_autopm_get_interface(acm->data);

No. If you really resume the device here, you reanimate the URBs
you just killed. The order must be inverted.

> +		if (!status) {
> +			status = usb_clear_halt(acm->dev, acm->in);
> +			usb_autopm_put_interface(acm->data);
> +		}
> +		if (!status)
> +			acm_submit_read_urbs(acm, GFP_KERNEL);

No, you would kill the device. Either do it all conditionally
or nothing.

	Regards
		Oliver


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux