All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Hans de Goede <hdegoede@redhat.com>,
	Hui Wang <hui.wang@canonical.com>,
	linux-usb@vger.kernel.org, gregkh@linuxfoundation.org
Subject: Re: [PATCH] USB: UAS: don't unbind and rebind the driver during usb_reset_device
Date: Mon, 22 Feb 2021 08:59:02 +0100	[thread overview]
Message-ID: <ad6601a93f8fc4ec4d1451df5457e51aadf37301.camel@suse.com> (raw)
In-Reply-To: <b1fe6cf4-b48f-c7e6-17c0-2ed04d8f3aa1@redhat.com>

Am Sonntag, den 21.02.2021, 11:20 +0100 schrieb Hans de Goede:
> Hi,

Hi,

> 
> On 2/21/21 9:51 AM, Hui Wang wrote:
> > Once pre_reset() or post_reset() returns non-zero, the disconnect()
> > and probe() of the usb_driver will be called. In the disconnect(),
> > the scsi_host will be removed and be freed after scsi_host_put(), in
> > the probe(), the new scsi_host and uas_dev_info will be created.
> > 
> > If the usb_reset_device() is triggered by eh_device_reset_handler(),
> > and pre_reset()/post_reset() returns non-zero, the disconnect() and
> > probe() will be called, then returns to the eh_device_reset_handler(),
> > it still accesses old scsi related variables and uas_dev_info, and so
> > do its caller functions.
> > 
> > Here change the pre_reset() and post_reset() to let them only return
> > 0, after this change, the usb_reset_device() will only reset this
> > usb devcie from its hub port, will not execute unbind and rebind
> > usb_driver during reset.
> 
> We only return non 0 from the pre/post reset handles if we failed
> to ensure the device is in a known state.

correct. Technically it is a bit unfortunate that UAS devices react
a bit different to other SCSI devices, but we definitely cannot hide
a failure. Arguably we should go into OFFLINE state.
But that needs a
good reason beyond theoretical considerations.

	Regards
		Oliver



  parent reply	other threads:[~2021-02-22  7:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21  8:51 [PATCH] USB: UAS: don't unbind and rebind the driver during usb_reset_device Hui Wang
2021-02-21 10:20 ` Hans de Goede
2021-02-21 13:23   ` Hui Wang
2021-02-22  7:59   ` Oliver Neukum [this message]
2021-02-22 12:40     ` Hui Wang
2021-02-22 12:51       ` Oliver Neukum
2021-02-22 13:02         ` Hui Wang
2021-02-22 13:50           ` Oliver Neukum
2021-02-22 15:14             ` Hui Wang

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=ad6601a93f8fc4ec4d1451df5457e51aadf37301.camel@suse.com \
    --to=oneukum@suse.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=hui.wang@canonical.com \
    --cc=linux-usb@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.