HDIO_UNREGISTER_HWIF crashes 2.2.xx-2.2.15pre9

From: Tomasz Motylewski (motyl@stan.chemie.unibas.ch)
Date: Tue Feb 22 2000 - 19:12:07 EST


I have problems with my "hot swappable IDE disk drawer" system. This is
a single disk on ide1 (PIIX3 controller, SMP dual P200, ).
Under 2.0.37/8 I was inserting a little module after connecting the disk
doing ide_register(port1,port2,irq). Then I could mount the disk, then I was
umounting it, removing the module (ide_unregister(ide)) and disconnecting the
disk without any problems (well, sometimes "unexpected interrupt" message
from IDE driver).

With 2.2 I am doing:
int ide[3]= 0x170,0x376,15};
fd = open("/dev/hda", O_RDONLY);
ioctl(fd, HDIO_SCAN_HWIF, ide);

-this works very well, I can do it many times even.

But after I finish work I do:

fd = open("/dev/hda", O_RDONLY);
ioctl(fd, HDIO_UNREGISTER_HWIF,1 );
- and this crashes the computer sometimes (2-3 months ago with 2.2.13-14
kernels crashes were the rule, now the system tends to crash (hard hang with
IDE LED ON, interrupts disabled, it hangs AFTER returning from ioctl, shell
has enough time to display the propmt again) after I work on a connected disk
for a longer time.

Sometimes instead it recovers with:
Feb 20 14:23:59 crds kernel: hda: timeout waiting for DMA
Feb 20 14:23:59 crds kernel: hda: irq timeout: status=0x58 { DriveReady
SeekComplete DataRequest }
Feb 20 14:24:00 crds kernel: hda: status timeout: status=0xd0 { Busy }
Feb 20 14:24:00 crds kernel: hda: DMA disabled
Feb 20 14:24:00 crds kernel: hda: drive not ready for command
Feb 20 14:24:00 crds kernel: ide0: reset: success

What is strange is that ide1, not ide0 was just unregistered!

I also have a feeling that if I do some such manipulation playing with
registering/unregistering the ide1 disk, the system may hang even a few hours
after.

And a question: suppose that I do not have ide0 (hda). Which device should I
then open to call ioctl to probe for a connected disk?

Best regards,

--
Tomasz Motylewski

P.S. I have tried also 2.2.15pre-ide.2.2.15-9.20000221.patch . Then HDIO_SCAN_HWIF does not work at all - ioctl returns "I/O error".

When it works in 2.2.15pre9 the messages are: Feb 20 14:47:02 crds kernel: hdc: ST38641A, ATA DISK drive Feb 20 14:47:02 crds kernel: ide1 at 0x170-0x177,0x376 on irq 15 Feb 20 14:47:02 crds kernel: hdc: ST38641A, 8207MB w/128kB Cache, CHS=16676/16/63 Feb 20 14:47:02 crds kernel: hdc: [PTBL] [1046/255/63] hdc1 hdc2 hdc3 hdc4

My root FS in on /dev/hda3, swap on /dev/hda2.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:32 EST