public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Benjamin Block <bblock@linux.ibm.com>, Oliver Neukum <oneukum@suse.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Hannes Reinecke <hare@suse.de>, Maxime Bizon <mbizon@freebox.fr>,
	linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net,
	linux-scsi@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: Reproducible deadlock when usb-storage scsi command timeouts twice
Date: Wed, 3 May 2023 15:54:45 +0200	[thread overview]
Message-ID: <d25bfa50-b5a0-bd0e-fd14-94967e374033@suse.com> (raw)
In-Reply-To: <20230503125137.GA1032383@t480-pf1aa2c2.fritz.box>

On 03.05.23 14:51, Benjamin Block wrote:

>> usb-storage can do a reset only on the USB device level,
>> which translates to a bus reset on the SCSI level.
>>
>> And we are supposed to cancel any communication with the device
>> before that.
> 
> Is that a limitation of the devices or drivers? Because then you don't
> match SCSI semantics for LU reset - which aborts all running commands

We do not support a LUN reset. That's a limitation of the protocol.
If something goes wrong you need to reset the whole USB device, which
corresponds to a host adaptor on the SCSI level.

> on that scope among things. Which might explain the reason/choice behind
> this unexpected behavior for you.

For the device a reset presumably does wipe out the command currently
under execution. The problem is within the driver. It thinks that
a command is still active. And we are limited to one command at a time
(on the whole bus - again protocol limitation)

> On random thought I had: in theory you could implement your own EH
> strategy handler if the default one doesn't work for you. ATA and SAS do so.
> [drivers/scsi/scsi_error.c:2285 `shost->transportt->eh_strategy_handler()`]
> This can re-use parts/all of the existing escalation sequence in
> `scsi_eh_ready_devs()`.
> 
> But that's no short-term fix.

That looks like using a sledge hammer.

	Regards
		Oliver


  reply	other threads:[~2023-05-03 13:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ZEllnjMKT8ulZbJh@sakura>
2023-04-26 19:20 ` Reproducible deadlock when usb-storage scsi command timeouts twice Alan Stern
2023-04-26 23:06   ` Maxime Bizon
2023-04-30 19:39   ` Bart Van Assche
2023-04-30 21:10     ` Alan Stern
2023-05-03 10:24   ` Benjamin Block
2023-05-03 10:55     ` Oliver Neukum
2023-05-03 12:51       ` Benjamin Block
2023-05-03 13:54         ` Oliver Neukum [this message]
2023-05-03 14:25           ` Alan Stern
2023-05-04  8:52             ` Benjamin Block
2023-05-04 14:05               ` Alan Stern
2023-05-04 14:41                 ` Maxime Bizon
2023-05-04 20:25                   ` Alan Stern

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=d25bfa50-b5a0-bd0e-fd14-94967e374033@suse.com \
    --to=oneukum@suse.com \
    --cc=bblock@linux.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mbizon@freebox.fr \
    --cc=stern@rowland.harvard.edu \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /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