From: Douglas Gilbert <dougg@torque.net>
To: linux-hotplug@vger.kernel.org
Subject: Re: SCSI Patches - mostly on/off-line stuff
Date: Thu, 11 Jan 2001 21:56:38 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-97925037703688@msgid-missing> (raw)
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.
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
fd? [POLLHUP or POLLERR] And if the fd was running
async should a SIGPOLL signal be generated by the
detach() call? [with 'band' POLL_HUP if rt signal].
Most likely apps would like to be informed of such
events. I'm not clear on what a block special such
as sd should do in response to a premature detach()
on an open fd.
Option 2) allows for the device to be brought back
online with its state being maintained. It could be
nasty (for the scsi subsystem) if a USB mass storage
device was pulled out of one USB port and placed in
another.
Currently there is no mid-level call into upper level
scsi drivers to indicate that the state of 'offline'
has been flipped. [Perhaps there should be to allow
upper level drivers to generate signals.] Sg doesn't
test the state of a device's offline bit before it
tries to dispatch a scsi command to the mid level.
[Perhaps it should.] Same questions apply as to what
sg and sd should do. Another option in this case is
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.
Doug Gilbert
_______________________________________________
Linux-hotplug-devel mailing list
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next reply other threads:[~2001-01-11 21:56 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-11 21:56 Douglas Gilbert [this message]
2001-01-11 22:43 ` SCSI Patches - mostly on/off-line stuff Oliver.Neukum
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-97925037703688@msgid-missing \
--to=dougg@torque.net \
--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 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).