linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Oliver Neukum <oneukum@suse.com>
Cc: EJ Hsu <ejh@nvidia.com>, linux-usb@vger.kernel.org
Subject: Re: [PATCH v2] usb: uas: fix a plug & unplug racing
Date: Thu, 23 Jan 2020 19:19:58 +0100	[thread overview]
Message-ID: <20200123181958.GA1930162@kroah.com> (raw)
In-Reply-To: <1579762922.2841.0.camel@suse.com>

On Thu, Jan 23, 2020 at 08:02:02AM +0100, Oliver Neukum wrote:
> Am Dienstag, den 21.01.2020, 23:43 -0800 schrieb EJ Hsu:
> > When a uas disk is plugged into an external hub, uas_probe()
> > will be called by the hub thread to do the probe. It will
> > first create a SCSI host and then do the scan for this host.
> > During the scan, it will probe the LUN using SCSI INQUERY command
> > which will be packed in the URB and submitted to uas disk.
> > 
> > There might be a chance that this external hub with uas disk
> > attached is unplugged during the scan. In this case, uas driver
> > will fail to submit the URB (due to the NOTATTACHED state of uas
> > device) and try to put this SCSI command back to request queue
> > waiting for next chance to run.
> > 
> > In normal case, this cycle will terminate when hub thread gets
> > disconnection event and calls into uas_disconnect() accordingly.
> > But in this case, uas_disconnect() will not be called because
> > hub thread of external hub gets stuck waiting for the completion
> > of this SCSI command. A deadlock happened.
> > 
> > In this fix, uas will call scsi_scan_host() asynchronously to
> > avoid the blocking of hub thread.
> > 
> > Signed-off-by: EJ Hsu <ejh@nvidia.com>
> Acked-by: Oliver Neukum <oneukum@suse.com>

EJ can you resend this with Oliver's ack as I lost the original patch in
my archives now as it was so long ago...

thanks,

greg k-h

      reply	other threads:[~2020-01-23 18:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22  7:43 [PATCH v2] usb: uas: fix a plug & unplug racing EJ Hsu
2020-01-23  7:02 ` Oliver Neukum
2020-01-23 18:19   ` Greg KH [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=20200123181958.GA1930162@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=ejh@nvidia.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    /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).