linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Pratham Pratap <prathampratap@codeaurora.org>
Cc: gregkh@linuxfoundation.org, rafael.j.wysocki@intel.com,
	mathias.nyman@linux.intel.com, andriy.shevchenko@linux.intel.com,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	sallenki@codeaurora.org, mgautam@codeaurora.org,
	jackp@codeaurora.org, stable@vger.kernel.org
Subject: Re: [PATCH] usb: core: Don't wait for completion of urbs
Date: Tue, 13 Oct 2020 11:24:26 -0400	[thread overview]
Message-ID: <20201013152426.GB670875@rowland.harvard.edu> (raw)
In-Reply-To: <1602586022-13239-1-git-send-email-prathampratap@codeaurora.org>

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

      parent reply	other threads:[~2020-10-13 15:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 10:47 [PATCH] usb: core: Don't wait for completion of urbs Pratham Pratap
2020-10-13 11:10 ` Greg KH
2020-10-13 11:55 ` Andy Shevchenko
2020-10-13 15:24 ` Alan Stern [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201013152426.GB670875@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jackp@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=mgautam@codeaurora.org \
    --cc=prathampratap@codeaurora.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=sallenki@codeaurora.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).