Re: [PATCH 3/3] USB: cdc-wdm: timeout blocking reads to allow driver to shutdown on device removal

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

 



Am Montag, 16. Januar 2012, 12:41:49 schrieb Bjørn Mork:
> Setting the WDM_READ bit in wdm_disconnect() is useless, as wdm_disconnect()
> won't be called at all as long as wdm_read() is blocking waiting for this bit.

Yes, and this shows that wdm_read() must be woken at this point.

> Use wait_event_interruptible_timeout for blocking reads to allow the USB
> subsystem to call wdm_disconnect, and thereby allow a blocking read to
> complete on device removal.

No, playing around with timeout is evil.
This shows that there's a wake_up_all() missing in disconnect()
between setting the flags and taking the mutex.
> 
> Without this, a blocking read will prevent a device from being removed.

The diagnosis is very good, but the fix is too ugly to let live, let
alone let pass pass a review. Would you please redo this patch?

	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