All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Oliver.Neukum@lrz.uni-muenchen.de>
To: linux-hotplug@vger.kernel.org
Subject: Re: SCSI Patches - mostly on/off-line stuff
Date: Thu, 11 Jan 2001 22:43:58 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-97925306511197@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-97925037703688@msgid-missing>

On Thu, 11 Jan 2001, Douglas Gilbert wrote:

> Max TenEyck Woodbury wrote:
> > [snip]
> > 3) Add scsi force-device-online and force-device-offline
> >    commands to the /proc/scsi/scsi interface.
> > [snip]
> 
> This patch from Max got me thinking about hot-plugging
> issues. Now there are 2 things a hotplug-tolerant scsi
> (pseudo) adapter might do if it detected the removal of
> a device, calls that do the equivalent of:
>    1) echo "scsi remove-single-device <h> <b> <t> <l>" > /proc/scsi/scsi
>    2) echo "scsi force-device-offline <h> <b> <t> <l>" > /proc/scsi/scsi
> 
> 
> Option 1) is pretty absolute and is currently disallowed
> if there are any open fds on that device. With some work 
> this restriction could be relaxed.

It need not be effective at once. Most drivers would probably happy with
a flag/call to signal a vanished device and a callback once all fds are
gone to free the memory associated. In fact that would be preferable.
It's not a drivers business to know what to do in this case.
A driver's duty should be to report that condition.

> Seen from a scsi upper level driver's point of view (e.g.
> sd or sg) option 1) would be a detach(device) call. 
> Taking the case of sg (a character device) what should 
> it return on subsequent calls to read(), write(), 
> ioctl() on a fd associated with the detached device? [My
> guess: ENODEV]. How about a poll() involving such a

Could be confusing, but it's probably right.

> as sd should do in response to a premature detach() 
> on an open fd.

As a suggestion:
Wait for a few minutes and return errors to open() only.
After a timeout return errors. If it is reattached some kind
of checksumming might be a good idea.

> Option 2) allows for the device to be brought back
> online with its state being maintained. It could be

How ? Is there a way to know internal state has been maintained.
For sd it might not matter, for sg a disconnected device must be
considered gone for good by default.

Those drivers with these problems probably register themselves as
host controllers for each device/bridge. These register/unregister
calls need the same attention as above.

> that system commands (e.g. read() and write()) are 
> put into a wait state for up to a minute, say, to 
> give the device a chance to come back online.

That choice must be left to the high level drivers.
Do really want to use off-line for that ?

	Regards
		Oliver



_______________________________________________
Linux-hotplug-devel mailing list
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  reply	other threads:[~2001-01-11 22:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-11 21:56 SCSI Patches - mostly on/off-line stuff Douglas Gilbert
2001-01-11 22:43 ` Oliver.Neukum [this message]
2001-01-17 20:32 ` David Brownell
2001-01-18  0:08 ` Douglas Gilbert
2001-01-18  9:03 ` Oliver Neukum
2001-01-18  9:25 ` Miles Lane
2001-01-18 15:37 ` Eric Youngdale
2001-01-18 16:20 ` Venkatesh Ramamurthy
2001-01-18 16:49 ` Prasenjit Sarkar
2001-01-18 16:50 ` Venkatesh Ramamurthy
2001-01-18 17:03 ` Venkatesh Ramamurthy
2001-01-18 18:14 ` David Brownell
2001-01-18 19:12 ` Oliver Neukum
2001-01-18 19:20 ` Prasenjit Sarkar
2001-01-18 19:45 ` Miles Lane
2001-01-18 21:08 ` Douglas Gilbert
2001-01-18 21:41 ` Miles Lane
2001-01-18 22:07 ` David Brownell
2001-01-18 22:15 ` David Brownell
2001-01-18 22:45 ` Oliver Neukum
2001-01-18 23:10 ` Oliver Neukum
2001-01-18 23:25 ` Miles Lane
2001-01-18 23:37 ` Oliver Neukum
2001-01-19  2:08 ` David Brownell
2001-01-19  2:10 ` Bob Frey
2001-01-19  2:16 ` Venkatesh Ramamurthy

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=marc-linux-hotplug-97925306511197@msgid-missing \
    --to=oliver.neukum@lrz.uni-muenchen.de \
    --cc=linux-hotplug@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.