Re: [PATCH] usb: cdc-wdm: cannot wait forever for blocking read/write on reset

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

 



Am Dienstag, 31. Januar 2012, 14:58:07 schrieb Bjørn Mork:
> We need to ensure that no URBs are submitted during reset.  Taking any of
> the mutexes can deadlock against either wdm_read or wdm_write. Use the
> WDM_SUSPENDING flag instead to indicate that no IO is possible, as the
> requirements for suspend and reset are similar

No, the requirements are not similar. wdm_write() can resume a device.
During a reset you must wait (or -EAGAIN in the non-blocking case).
The device has been reset or is being reset. This means that previous
settings may have been erased.

So we must
a) return an error for read and write
b) accept no new write until the reset is finished (wait or -EAGAIN)

The mutex allowed this, but we a problem you have noted.
But you cannot use WDM_SUSPENDING for this because it is not tested
when it would need to be tested. And we need to wait in the write() code
path.

	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