[lkml]   [2020]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] usb: core: Don't wait for completion of urbs
On Tue, Oct 13, 2020 at 04:17:02PM +0530, Pratham Pratap wrote:
> Consider a case where host is trying to submit urbs to the
> connected device while holding the us->dev_mutex and due to
> some reason it is stuck while waiting for the completion of
> the urbs. Now the scsi error mechanism kicks in and it calls

Are you talking about usb-storage? You should describe the context
better -- judging by the patch title, it looks like you're talking
about a core driver instead.

> the device reset handler which is trying to acquire the same
> mutex causing a deadlock situation.

That isn't supposed to happen. The SCSI error handler should always
cancel all the outstanding commands before invoking the device reset
handler. Cancelling the commands will cause the URBs to complete.

If you found a test case where this doesn't happen, it probably means
there's a bug in the SCSI core code or the USB host controller driver.
That bug should be fixed; don't introduce random timeout values to try
and work around it.

Alan Stern

 \ /
  Last update: 2020-10-13 17:25    [W:0.101 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site