From: Luben Tuikov <tluben@rogers.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] scsi_set_host_offline (resend)
Date: Wed, 09 Apr 2003 22:59:39 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-104992923901518@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-104904525413997@msgid-missing>
Oliver Neukum wrote:
>
> Please explain yourself further. We cannot deal with wait sometimes.
No need to -- we agree.
> Either we may wait or we may not wait. If we may wait,
> we must always deal with it like we will wait and deal with results,
> which is impossible, as the only result we can deal with is success.
>
> Notification is absolutely no problem. _Requiring_ the kernel
> to wait for user space to act so that the process of removal
> can be completed as far as the the low level driver is concerned
> is a major problem.
No, a LLDD will not be required to wait on userspace. No one wants
this and the fault in this is quite evident that no one would want it.
The only point is notification, and we seem to agree on this.
> All is well if a low level driver can consider a device gone for good
> as soon as "/sbin/hotplug" is spawned. The key here is spawned
> , not doing something or finish, but spawned.
Ideally:
You can assume even better than that: as soon as your interconnect
tells you that the device is gone, a LLDD (= transport portal) does this:
---> calls xxx_dev_removal(dev) (marks device as gone in this subsystem),
(and which in turn:
---> calls scsi_device_removal(dev) (mark dev as gone in this subsys),
... (see my other posting))
(none of which blocks, more work/discussion is needed here, but this is
different topic)
and then the LLDD can free *its* resources which it allocated on the
device.
*But*, the _important__point_ is that the LLDD must be able to handle
requests (queuecommand()) to non-existant (= just removed) devices,
and not oops, or whatever.
So, in effect, you just call usb_dev_removal(dev) (to be written),
and free _your_ resources on the device. (note important point above)
> We have indeed discussed this before and the need to notify
> user space was never questioned, as far as I recall.
> The point of contention always was whether the notification
> had to do specific things for the process of unplugging to finish
> as far as it concerns the low level driver.
Right. As far as I can see, those subsystem entries, xxx_dev_removal(dev),
would do things which do not block, like flip a bit, flags, integer,
wake up a thread, etc, call the above subsystem's xxx_dev_removal(dev),
and return immediately. (as per my other posting)
(this needs more thinking though)
--
Luben
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
for complex code. Debugging C/C++ programs can leave you feeling lost and
disoriented. TotalView can help you find your way. Available on major UNIX
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2003-04-09 22:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-30 17:26 [PATCH] scsi_set_host_offline (resend) Oliver Neukum
2003-04-09 20:30 ` Luben Tuikov
2003-04-09 22:32 ` Oliver Neukum
2003-04-09 22:59 ` Luben Tuikov [this message]
2003-04-10 7:51 ` Oliver Neukum
2003-04-17 22:29 ` Luben Tuikov
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-104992923901518@msgid-missing \
--to=tluben@rogers.com \
--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).