public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Luben Tuikov <luben@splentec.com>
To: David Brownell <david-b@pacbell.net>
Cc: Matthew Dharm <mdharm-scsi@one-eyed-alien.net>,
	Oliver Neukum <oliver@neukum.name>,
	Mike Anderson <andmike@us.ibm.com>, Greg KH <greg@kroah.com>,
	linux-usb-devel@lists.sourceforge.net,
	Linux SCSI list <linux-scsi@vger.kernel.org>
Subject: Re: [linux-usb-devel] Re: [PATCH] USB changes for 2.5.58
Date: Mon, 20 Jan 2003 17:16:27 -0500	[thread overview]
Message-ID: <3E2C753B.3090805@splentec.com> (raw)
In-Reply-To: 3E2C5750.2040301@pacbell.net

David Brownell wrote:
> Luben Tuikov wrote:
> 
>>> The way this should work is that the LLD calls scsi_remove_device(), and
>>> that cuts off the flow of commands.  The LLD can promise to error-out 
>>> any
>>> pending commands in the device command queue.
>>
>>
>>
>> I take it you mean that the transport will tell the LLDD that the device
>> is gone and it (LLDD) call the one above, SCSI Core to remove the device.
>>
>> Hmm, more thinking needs to be done here, as shouldn't this be handled
>> by hotplugging? I.e. Targets do not *initiate* events.
> 
> 
> Not exactly, but the bus driver ("transport"?) certainly does initiate
> reports like "here's a new device on the bus" or "that device is gone".
> That's when hotplugging kicks in (both in-kernel and in-userland).
> 
> And the only way to access a device ("target") on the bus is to give a
> request to that bus driver.  If, when servicing that request, the bus
> driver notices the device is gone ... that can act a lot like a device
> initiating a "device gone" event would look.

David, when I said ``... the transport will tell the LLDD that the
device ...'' this is *exactly* what I meant.  You're just repeating
it here in a more broken-down way.

By transport I mean USB, FC, SPI, etc; LLDD is the transport portal
and the initiator (aka the initiator port).  This terminology is not
really that new, but still not that old, and described in SAM-3.

>> The transport can notify that the device is gone, but an ULP entity will
>> call scsi_remove_device() not the other way around.
> 
> 
> That's how USB works today:  khubd shuts things down.  Device drivers
> get disconnect() callbacks, just as when their modules are removed.

Pardon me, I'm not very familiar with the USB subsystem, but this only
makes sense -- why would anyone do it any other way... :-)

> EXCEPT that "khubd" is part of usbcore (roughly analagous to parts
> of the scsi mid-layer) ... so the drivers acting as host side proxies
> for the target hardware ("usb device") are purely reactive.  Their
> only roles in hotplug scenarios are to bind to devices (when a new
> one appears, using probe callbacks) or unbind from them (when one
> goes away, using disconnect callbacks).

Very nice.

> Those disconnect() callbacks have a few key responsibilities, very
> much including shutting down the entire higher level I/O queue to
> that device.  I think you're saying that SCSI drivers don't have
> such a responsibility (unlike USB or PCI) ... if so, that would
> seem to be worth changing.

We just cannot let a transport event just wipe out a device,
without consulting hotplugging first -- think security.

SCSI drivers' (LLDD) responsibility is changing.  This is inevitable,
due to the reorganization of SAM-3 and SPC-3.  There's no more
such a thing as a ``bus'' in SCSI, e.g. ``Bus'' *may* be a
concept of the transport, and then again it may not.

General:
--------
SCSI was never designed to support Target initiated events.
SAM-3 has no provision for it, except passively when the next
command status is returned (e.g. UA).

For this reason, device removal is *transport* related event --
it has *nothing* to do with the SCSI target/target device, except
that it's gone :-) .

Being pedantic, this would be a /transport initiated event/ .
When this event takes place, the LLDD will notice it, and
let the kernel know about it, via a callback, all the while
the LLDD will return TARGET error (since it's gone), until
is has been told slave_destroy(), after which it should
never be queried of it, and if it is it should return the same
error.

That is, when a transport event takes place, the LLDD doesn't
have to ``run to'' SCSI Core right away. Just let the kernel
know about this event, and start returning errors, on newly
queued commands.

The kernel will decide what to do about this device going away,
i.e. hotplugging, sysop notification, etc.

I guess we're crossing in this discussion in such a way, just
because of USB and SCSI crossing here.  But if we think that
USB is the transport and that it could also be FC, SPI, SSA,
iSCSI, then a general framework of the workings is inevitable.

I.e. when talking about LLDDs we'd concentrate less on ``Target''
and more on ``transport''.

-- 
Luben



  parent reply	other threads:[~2003-01-20 22:16 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <10426732153816@kroah.com>
     [not found] ` <10426732212871@kroah.com>
     [not found]   ` <20030116093112.B29001@one-eyed-alien.net>
     [not found]     ` <20030116173539.GA31235@kroah.com>
2003-01-16 19:43       ` [linux-usb-devel] Re: [PATCH] USB changes for 2.5.58 Matthew Dharm
2003-01-16 19:53         ` Greg KH
     [not found]         ` <20030116195306.GA32697@kroah.com>
2003-01-16 20:10           ` Linus Torvalds
2003-01-16 20:43             ` greg kh
2003-01-16 21:41             ` Linus Torvalds
2003-01-16 22:51             ` Matthew Dharm
2003-01-16 20:40           ` David Brownell
2003-01-16 20:48             ` Mike Anderson
2003-01-16 23:43               ` Oliver Neukum
2003-01-17  8:50                 ` Mike Anderson
2003-01-17 10:55                   ` Oliver Neukum
2003-01-17 15:06                     ` Alan Stern
2003-01-17 18:54                     ` Matthew Dharm
2003-01-17 20:25                       ` Mike Anderson
2003-01-17 22:07                         ` Oliver Neukum
2003-01-17 20:26                       ` [linux-usb-devel] " Oliver Neukum
2003-01-17 20:49                         ` Mike Anderson
2003-01-20 17:36                       ` Luben Tuikov
2003-01-20 18:23                         ` Oliver Neukum
2003-01-20 18:56                           ` Luben Tuikov
2003-01-20 19:10                             ` [linux-usb-devel] " Oliver Neukum
2003-01-20 19:50                             ` David Brownell
2003-01-21  3:31                           ` Alan
2003-01-21  7:17                             ` Oliver Neukum
2003-01-21 11:57                               ` [linux-usb-devel] " Douglas Gilbert
2003-01-21 13:48                                 ` Oliver Neukum
2003-01-21 18:22                                   ` Luben Tuikov
2003-01-21 13:30                             ` James Bottomley
2003-01-20 20:08                         ` David Brownell
2003-01-20 20:48                           ` [linux-usb-devel] " Oliver Neukum
2003-01-20 21:24                             ` David Brownell
2003-01-20 21:51                               ` [linux-usb-devel] " Oliver Neukum
2003-01-20 22:26                                 ` David Brownell
2003-01-20 23:00                                   ` Oliver Neukum
2003-01-21  0:44                                     ` David Brownell
2003-01-21  0:50                                       ` Oliver Neukum
2003-01-21 18:16                                         ` Luben Tuikov
2003-01-21 19:00                                           ` Oliver Neukum
2003-01-21 20:02                                             ` [linux-usb-devel] " Luben Tuikov
2003-01-21 21:02                                               ` Alan Stern
2003-01-22 21:50                                                 ` Luben Tuikov
2003-01-22 22:46                                                   ` Oliver Neukum
2003-01-23 17:46                                                     ` Luben Tuikov
2003-01-23 18:19                                                       ` Oliver Neukum
2003-01-23 19:07                                                         ` Luben Tuikov
2003-01-23 19:40                                                           ` Oliver Neukum
2003-01-23 20:28                                                             ` Doug Ledford
2003-01-23 20:59                                                               ` Oliver Neukum
2003-01-23 21:34                                                                 ` Doug Ledford
2003-01-23 22:39                                                                   ` Oliver Neukum
2003-01-23 23:23                                                                     ` Doug Ledford
2003-01-23 23:25                                                                     ` Matthew Dharm
2003-01-24 15:34                                                                       ` Alan Stern
2003-01-24 16:06                                                                         ` Oliver Neukum
2003-01-24 17:58                                                                         ` [linux-usb-devel] " Doug Ledford
2003-01-24 19:00                                                                         ` Luben Tuikov
2003-01-24 22:23                                                                           ` Oliver.Neukum
2003-01-24 19:10                                                                       ` Luben Tuikov
2003-01-24 19:56                                                                         ` [linux-usb-devel] " Alan Stern
2003-01-24 20:11                                                                           ` Luben Tuikov
2003-01-24 21:09                                                                           ` Luben Tuikov
2003-01-24 21:55                                                                             ` Alan Stern
2003-01-24 22:03                                                                               ` Luben Tuikov
2003-01-24 23:21                                                                               ` Mike Anderson
2003-01-24 21:48                                                                       ` Doug Ledford
2003-01-24 22:59                                                                         ` Mike Anderson
2003-01-24 23:17                                                                           ` [linux-usb-devel] " Doug Ledford
2003-01-25  0:24                                                                           ` Luben Tuikov
2003-01-25  1:35                                                                             ` Mike Anderson
2003-01-24 23:25                                                                         ` Matthew Dharm
2003-01-25  0:05                                                                           ` Doug Ledford
2003-01-25  0:45                                                                             ` Matthew Dharm
2003-01-25  1:07                                                                               ` Doug Ledford
2003-02-02 18:13                                                                                 ` Matthew Dharm
2003-02-02 20:06                                                                                   ` Matthew Dharm
2003-02-03 17:17                                                                                     ` Mike Anderson
2003-02-16 21:18                                                                                       ` Matthew Dharm
2003-02-17 19:37                                                                                         ` Mike Anderson
2003-02-17 19:51                                                                                           ` Patrick Mansfield
2003-02-23  7:48                                                                                           ` Matthew Dharm
2003-02-26 23:37                                                                                             ` Mike Anderson
2003-02-27  1:10                                                                                               ` Matthew Dharm
2003-02-27  6:37                                                                                                 ` Mike Anderson
2003-02-27 19:32                                                                                                   ` Matthew Dharm
2003-03-01  1:41                                                                                                     ` Matthew Dharm
2003-02-02  3:49                                                                             ` Matthew Dharm
2003-01-25  1:24                                                                           ` Luben Tuikov
2003-01-24  0:15                                                               ` Patrick Mansfield
2003-01-24  8:33                                                               ` David Brownell
2003-01-23 20:41                                                         ` A different look at block device hotswap in the Linux kernel Steven Dake
2003-01-23 21:07                                                           ` Matthew Jacob
2003-01-23 21:06                                                             ` Steven Dake
2003-01-23 21:16                                                               ` Matthew Jacob
2003-01-24  0:07                                                           ` Oliver Neukum
2003-01-24  0:21                                                             ` Matthew Jacob
2003-01-24  7:53                                                               ` David Brownell
2003-01-24 15:26                                                                 ` Matthew Jacob
2003-01-24  0:54                                                             ` Steven Dake
2003-01-24  2:35                                                               ` [linux-usb-devel] " Matthew Dharm
2003-01-22 21:30                                           ` [linux-usb-devel] Re: [PATCH] USB changes for 2.5.58 David Brownell
2003-01-20 22:16                           ` Luben Tuikov [this message]
2003-01-20 22:51                             ` David Brownell
2003-01-20 23:27                               ` Oliver Neukum
2003-01-22 12:07 Bennie J. Venter

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=3E2C753B.3090805@splentec.com \
    --to=luben@splentec.com \
    --cc=andmike@us.ibm.com \
    --cc=david-b@pacbell.net \
    --cc=greg@kroah.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=mdharm-scsi@one-eyed-alien.net \
    --cc=oliver@neukum.name \
    /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