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

> The basic question is whether hot-plugging support is
> just too much effort for the lk 2.4 scsi subsystem and
> should be left to lk 2.5? OTOH could there be a series
> of incremental changes in lk 2.4 to support it?

There are hotplugging devices out there.
Some basic solution is needed.

> The areas of interest are:
>   1) lower level (pseudo) drivers [e.g. usb/storage + sbp2_1395]
>   2) scsi mid level
>   3) scsi upper level drivers [sd, sr, st + sg]
>   4) block + cdrom subsystems

> In area 2) we usually defer to Eric Youngdale on design
> issues. The add/remove-single-device procfs technique (as
> used by rescan-scsi-bus) is only allowed when the device
> has no open fds. To remove the user intervention requirement,

For device addition at least that is always the case.
One problem less.

> exported C calls equivalent to add/remove-single-device need
> to be added (or existing calls stretched). As for allowing
> those calls when there are open fds, there are issues:
>   a) command "in flight" or could be in error recovery
>   b) re-entrancy?
>   c) mid level resource control (e.g. Scsi_Device objects)
>   d) impact on areas 3) and 4)

Device removal seems to be the hard case.

How about the following solution:

1. A flag to mark the device hotpluggable, like the emulated flag
2. export the add/remove-device call
3. return proper error codes for the unregister calls (and the calls from 2.)
4. add a call for taking the device offline

IMO we are now at a stage where the number of open fds cannot increase, can 
it ?

5. add a status of catastrophic failure to the returnable states -> no error 
handling, get the device offline

Now we have solved the problem of how to deal with "in flight" commands.
To the upper layers unplugging is like a dreadful error whch they have to 
handle anyway.

6. add a callback (w. a private data pointer) to be called when the usage 
count drops to zero. At this time removal must work and low level drivers can 
free memory.

This scheme is not the most elegant as it leaves the issues of replugging 
with the low level drivers, but it is implementable without great changes.

	Regards
		Oliver


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

  parent reply	other threads:[~2001-01-18  9:03 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
2001-01-17 20:32 ` David Brownell
2001-01-18  0:08 ` Douglas Gilbert
2001-01-18  9:03 ` Oliver Neukum [this message]
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-97980865827872@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 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).