Oliver Neukum <oliver@xxxxxxxxxx> writes: > 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. Yes, but that could never have worked for blocking operations. > 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. OK, that makes sense. Guess that means that there is no way around this except defining a new WDM_RESETTING flag with that exact meaning? None of the existing flags seem to fit. Bjørn -- 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