# hotplugging firewire DVD writer

## Massimo B.

I have two firewire devices:  A harddisk with Oxford Bridge and a DVD writer with a LSI Bridge.

Vendor:  MacPower Peripherals, Ltd.

Textual Leafes: 

Macpower

OXFW 911

Vendor:  SYMBIOS LOGIC INC.

Textual Leafes: 

LSI Logic

LSI 501 rev B3

```
# lspci |grep Fire

0002:20:0e.0 FireWire (IEEE 1394): Apple Computer Inc. UniNorth/Pangea FireWire
```

Now after long tests I figured out that the only way to get a /dev/sda (hd) and /dev/sr0 (dvd) is that:

The devices have to be online when starting gentoo. And most important, the modules have to be loaded in exactly that order:

```
modprobe sr_mod

modprobe sd_mod

modprobe sbp2

modprobe ohci1394
```

 ..I added them in that order to modules.autoload.

Actually there are more modules needed (but loaded by dependencies): ieee1394, scsi_mod

Now hotplugging is not possible, I can't switch the DVD writer off and on or I won't get /dev/sr0 again. If the DVD writer crashes I have to do:

```
echo "##### remove modules"

rmmod ohci1394  sr_mod sd_mod sbp2 ieee1394 scsi_mod

echo "##### reload modules"

modprobe sr_mod

modprobe sd_mod

modprobe sbp2

modprobe ohci1394
```

 That is very inconvenient concerning the harddrive that is mounted into applications and afterall also mapped by cryptsetup.

bp2 modules are not stable at all and get disconnected sometimes after CDR write process. After having problems with some cables I got a better cable (solved some things) (all cables were about 1.5 meters max, firewire should be for long distances  :Sad:  ) and experimented with 

```
# cat /etc/modules.d/sbp2

# default

# options sbp2 max_speed=3 serialize_io=0 max_sectors=255

# max_speed:Force max speed (3 = 800mb, 2 = 400mb, 1 = 200mb, 0 = 100mb) (int)

options sbp2 max_speed=2 serialize_io=1 max_sectors=512
```

Firewire should be hotplug capable?

So far it's quite stable for hours and only without unplugging but sometimes the DVDdrive gets disconnected (or crashes internally) after write process. A drive restart could work but with the explained module issues.

If I only reload ohci1394, only the harddrive is reconnected (to /dev/sdb now, but I have a udev SYMLINK anyway to /dev/firewire/hd detecting vendor and model), but cryptsetup on /dev/mapper is broken then.

Only reboot helps:

Boot process activates both devices without manual loading and cryptsetup enabled by init script (password query).

----------

## frostschutz

I have a Firewire hard disk and dvd-writer, both using (sharing, as it supports ide master and slave) Oxforf 911 bridge. Yes, Firewire is hotplug capable. At least if you're using a decent kernel (there were lots of firewire issues with kernels 2.6.8-2.6.12 or so).

I don't know if it is related to your issue, but one issue I'm seeing in Gentoo right now is that module autoload is not working properly anymore. The USB / Firewire modules get loaded fine, but not the SCSI modules (which are required for emulating /dev/sd* devices for USB/Firewire disks). Manually modprobing the modules (for example sd_mod) fixes this issue. The order you load the modules in should not matter at all though.

Firewire is, to my knowledge, not for long distances. Cable length is 4.5 metres, and such cables need to be high quality (unfortunately, as with every other type of cable, there are expensive low-quality cables as well as cheap high-quality ones). If you get a lot of bus resets, you are likely to have a bad cable (or other hardware failure). My cable is just 1m  :Smile: 

As for sbp2 options, I have to use serialize_io=1. Setting it to zero is not stable, at least not with my bridge. I didn't touch the max_speed / max_sectors though. Isn't max_sectors dangerous if you set too high values?

----------

## Massimo B.

My cables are also only 1m long. After testing 3 cables I get better results but that has nothing to do with the hotplug problems.

For me the modules.autoload works but I still can't switch off my DVD writer as it is not recognzed anymore afterwards (and sometimes I have to switch it off and on again if the tray loader doesn't work).

serialize_io=1 I will try.

----------

## Massimo B.

oh, now the DVD-Writer doesn't work anymore at all. Loading the module chain on boot brings ieee1394: Error parsing configrom for node 0-00:1023 and also when I replug the device.

Kernel did not change but I could say it's since last udev update.

----------

## frostschutz

The error parsing configrom is not a critical error. If you don't get any other messages, make sure all the modules (if you are using firewire/scsi as modules) are loaded. there was a problem with modules not getting loaded anymore recently...

----------

## Massimo B.

Was solved after building the kernel 2.6.17-r8. Maybe that was an issue with 2.6.17-r4 but I don't think so.

----------

## R. Bosch

I have the same problem with suspend2-sources-2.6.19-r3. I included the drivers in the kernel.

As you described I need to reboot with the DVD-drive attached.

What I did noticed is that when connecting to a running system, the kernel reports nothing. No event what so ever.

One solution could be this... a script in combination with modules. Not tried yet. Is this a kernel bug by any chance?  The information AFAICT is very limited on this subject... Most is 2 to one year(s) ago.... You'd think this would work well by now  :Rolling Eyes: 

I use an Acer travelmate 3002 btw.

----------

## Massimo B.

I have to admit the problem wasn't solved for me, it's still there in 2.6.19.

I just never unplug or turn off the firewire devices.

Nice to know that it's also an issue on x86 with a different firewire controller.

Another issue on 2.6.19 is now that also suspend makes firewire unusable.

----------

