Linux USB
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: James Dutton <james.dutton@gmail.com>,
	Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: USB disk disconnect problems
Date: Mon, 22 Aug 2022 12:18:20 +0200	[thread overview]
Message-ID: <24b4d2af-1401-fa95-0da5-588d9bdfac5f@suse.com> (raw)
In-Reply-To: <CAAMvbhFWBhkdLW0i5pVsrkJpSKEpsN=9gbHHgaXSP2UavmwvdA@mail.gmail.com>



On 21.08.22 22:59, James Dutton wrote:
> On Sun, 21 Aug 2022 at 21:03, Matthew Dharm
> <mdharm-usb@one-eyed-alien.net> wrote:

>> In the “old days” (that is, my original design for use-storage) it
>> used to do exactly what you are looking for - based on VID, DID, and
>> SerialNumber it would “remember” devices. The SCSI host would never be
>> destroyed, and when a device re-appeared it would be re-connected to
>> the existing host.

Arguably, in case ACPI tells us that the port is internal we ought
to reintroduce that behavior. It is very much an edge case, though.

>> Honestly, I’m not even sure where you would need to begin to make this
>> work. It would require pretty radical changes is the block I/O layers
>> to differentiate different failure modes, keep a lot more data around
>> after certain types of failures, allow for specifying which devices
>> this new policy (which is assuming reconnected devices really haven’t
>> been altered) applies to, etc — it’s a big lift.

Basically like failover with multi path I'd say.

> Are there any situations where we should actually try to recover?
> What about:
> The OS has not needed to read/write to the disk in a while. The USB
> disk idles out and goes into a power save mode by itself.
> The OS then wishes to write something, but would need to go through
> some sort of wake up procedure first.

We have three issues

1) Is this the same device?
2) Has it been altered while it was disconnected?
3) What do we do in case of memory pressure causing pages to be laundered?

In case of device persistance we ignore #1 and #2 and #3
does not exist

> I don't know if that is a state that is available for USB devices, but
> if it was, would it be fair to try and recover?

That is strictly speaking not a USB question. Every device has this
issue. You just do not check on resumption from S3 or S4whether somebody
has replaced the SATA disk in your system.

	Regards
		Oliver

  parent reply	other threads:[~2022-08-22 10:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-21 11:17 USB disk disconnect problems James Dutton
2022-08-21 14:47 ` Alan Stern
2022-08-21 16:36   ` James Dutton
2022-08-21 16:40     ` James Dutton
2022-08-21 18:11       ` Alan Stern
     [not found]   ` <CAA6KcBC2wEc78fgrMLBfbyEinR3rVUY6z8HeUbE=wtv0c4BP2Q@mail.gmail.com>
2022-08-21 19:03     ` Alan Stern
2022-08-21 20:03   ` Matthew Dharm
2022-08-21 20:59     ` James Dutton
2022-08-21 21:26       ` Matthew Dharm
2022-08-21 22:56         ` James Dutton
2022-08-22 10:03           ` Oliver Neukum
2022-08-22 10:18       ` Oliver Neukum [this message]
2022-10-03 18:04 ` James Dutton
2022-10-03 18:17   ` Alan Stern
2022-10-03 20:21     ` James Dutton

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=24b4d2af-1401-fa95-0da5-588d9bdfac5f@suse.com \
    --to=oneukum@suse.com \
    --cc=james.dutton@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mdharm-usb@one-eyed-alien.net \
    --cc=stern@rowland.harvard.edu \
    /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