Hotswap IDE

From: Mike Black
Date: Thu Feb 05 2004 - 07:53:41 EST


I use a removable IDE chassis to allow me to mirror my primary drive for offsite storage.
I'd like to hotswap the IDE but can't seem to get the drive to allow DMA access after restarting it.
A reboot is necessary for DMA access.
I'm using idectl from hdparm-5.4 which generates the following hdparm commands:
/sbin/hdparm -U 1 /dev/hda
/sbin/hdparm -R 0x170 0 0 /dev/hda


After doing an "idectl 1 off", "idectl 1 on" hdparm gives an error:
hdparm -d 1 /dev/hdc

/dev/hdc:
setting using_dma to 1 (on)
HDIO_SET_DMA failed: Operation not permitted
using_dma = 0 (off)

And strace shows the following ioctl failing:
ioctl(3, 0x326, 0x1) = -1 EPERM (Operation not permitted)

I can set 32-bit I/O and unmask IRQ but not DMA.
During the hdparm add the kernel messages look just like the boot messages:
Feb 5 06:57:12 medusa kernel: ide1 at 0x170-0x177,0x376 on irq 15
Feb 5 06:57:12 medusa kernel: hdc: max request size: 1024KiB
The re-add messages are missing one of the boot messages though:
Feb 5 06:44:35 medusa kernel: hdc: WDC WD1200BB-00DWA0, ATA DISK drive


I've now been able to repeat this on two different motherboards and have had the problem with linux 2.4.24 and 2.6.2

Anybody have any idea why re-adding an IDE drive in this mannger prevents DMA access?
Is anybody able to sucessfuly do this on their system?

Michael D. Black mblack@xxxxxxxxxxx
http://www.csi-inc.com/
http://www.csi-inc.com/~mike
321-676-2923, x203
Melbourne FL
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/