• P
    [PATCH] USB: ub 04 Loss of timer and a hang · b31f821c
    Pete Zaitcev 提交于
    If SCSI commands are submitted while other commands are still processed,
    the dispatch loop turns, and we stop the work_timer. Then, if URB fails
    to complete, ub hangs until the device is unplugged.
    
    This does not happen often, becase we only allow one SCSI command per
    block device, but does happen (on multi-LUN devices, for example).
    
    The fix is to stop timer only when we actually going to change the state.
    
    The nicest code would be to have the timer stopped in URB callback, but
    this is impossible, because it can be called from inside a timer, through
    the urb_unlink. Then we get BUG in timer.c:cascade(). So, we do it a
    little dirtier.
    Signed-off-by: NPete Zaitcev <zaitcev@redhat.com>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
    b31f821c
ub.c 67.1 KB