Share

IEEE 1394 for Linux

Tracker: Feature Requests

5 sbp2 hotplug patch - ID: 652958
Last Update: Comment added ( kinn_912-bms )

As has been reported a few times on the linux1394-devel
mailing
list, hotplugging firewire drives only sortof works. A
recent
posting to the list rehashing the problems


http://sourceforge.net/mailarchive/forum.php?thread_id=1151203&forum_id
=5389

reminded me of my old partial fix for this problem that was
sitting unfinished. So last night I polished it up,
fixed the
bugs, and it is now working perfectly for me.

Without this patch, hotplugging firewire drives will
register the
drives with the 1394 layers, but will not register them
with the
SCSI subsystem. Unplugging firewire drives leaves the (now
absent) drives still registered with the SCSI
subsystem. As you
can imagine, the current situation sucks, and makes
hotplugging
firewire drives mostly useless. To make things behave
correctly,
one needs to manually add/remove SBP-2 devices using a
shell script
(http://www.garloff.de/kurt/linux/rescan-scsi-bus.sh) that
pokes at /proc/scsi/scsi by scanning though all your
SCSI hosts
and then does things like
echo "scsi remove-single-device 0 0 0 0" >
/proc/scsi/scsi
for each and every SCSI device on your system. I don't
consider
such things safe or desirable at all.

It seemed to me that since the kernel had all the
information to
do the Right Thing(tm), it made sense to connect the
remove-single-device and add-single-device functionality of
/proc/scsi/scsi together with the sbp2 driver so the Right
Thing(tm) could happen automagically.

With my patch applied, one can now plug in firewire
drives and
they will all be automagically registered with the SCSI
subsystem. When one unplugs SBP-2 devices, they will be
automagically unregistered from the SCSI subsystem.

When I posted my earlier effort to the linux1394-devel
list:

http://sourceforge.net/mailarchive/forum.php?thread_id=949390&forum_id=
5389
it was decided that the change to the SCSI subsystem
needed to
expose scsi_add_single_device() and
scsi_remove_single_device()
was not desirable. I'll leave the decision on that to
others.

For the moment, this patch is works nicely for me and
makes using
firewire drives a much nicer experience.

Have fun,

-Erik

--
Erik B. Andersen
http://codepoet-consulting.com/
--This message was written using 73% post-consumer
electrons--


Dan Dennedy ( ddennedy ) - 2002-12-12 21:58

5

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 5 )




Date: 2006-09-11 09:35
Sender: kinn_912-bms

Logged In: YES
user_id=1595312

I want to try it with redhat entrprise 4.0 !!


Date: 2004-02-27 20:48
Sender: nobody

Logged In: NO

Just trying it for my iee1394 on Slackware 9.1
lindy1943@hotmail.com


Date: 2003-08-05 03:53
Sender: nobody

Logged In: NO

skylinux@hotmail.com


Date: 2003-07-09 18:17
Sender: s5r6

Logged In: YES
user_id=635553

The sbp2 part of the patch was added to sbp2 in revision
930. Only the scsi part of the patch is needed for this and
later revisions, and #define
SBP2_USE_SCSI_ADDREM_HACK has to be uncommented in sbp2.c.

The reduced version of the patch is available at
http://codepoet.org/scsi_add_remove_single.patch



Date: 2003-05-04 14:22
Sender: s5r6

Logged In: YES
user_id=635553

Update from 2003-04-29:
http://sourceforge.net/mailarchive/message.php?msg_id=4451817



Log in to comment.




Attached File ( 1 )

Filename Description Download
sbp2-hotplug.patch sbp2-hotplug.patch Download

Change ( 1 )

Field Old Value Date By
File Added 37474: sbp2-hotplug.patch 2002-12-12 21:58 ddennedy