Re: ide.c question!

Gadi Oxman (gadio@netvision.net.il)
Sun, 1 Jun 1997 01:07:53 +0400 (IDT)


On Sat, 31 May 1997, Egor Egorov wrote:

> I'm willing to write a little tool for Linux. I noticed, that I can swap Ide
> drives on-the-fly, i.e., umount drive, turn off the power of particular
> drive, pull of the cable, and it's ok for Linux. The same way I can insert
> drive, but.. only the same drive.
>
> So, question: now do I implement a re-probe of devices? So I can insert
> drive of new type, and for example:
>
> $ rehashdrives
> hda: WDC AC2700F, 696MB w/64kB Cache, LBA, CHS=708/32/63
> hdb: OTI-SCYLLA, ATAPI CDROM drive
> $
>
> Well, is it possible to call do_probe or any of these procedures in ide.c by
> implementing another ioctl? Is it ok for kernel? If so, which exactly
> function I should call and how (I know, we'll need to BLKRRPART after
> calling reprobe)?

Re-scanning an IDE interface and re-initializing the drivers is supported
by the 2.1.x kernels, under the following limitations:

1. Both drives on the interface which is being re-scanned should
not be used -- we do not support re-scanning a drive while the
other drive on the same interface is being used yet.

2. You can issue the HDIO_SCAN_HWIF ioctl to any IDE drive which
is not on the interface which you wish to rescan. For example,
to re-scan hda + hdb, we can run:

...
int args[3] = {0x1f0, 0, 0};
...
fd = open("/dev/hdc", O_RDONLY);
ioctl(fd, HDIO_SCAN_HWIF, args);

3. If you have a single IDE interface, you can compile ide-probe.c
both as a module and into the kernel by:

copying ide-probe.c to ide-probe-m.c
adding M_OBJS += ide-probe-m.o after L_OBJS += ide-probe.o
in linux/drivers/block/Makefile

and just "insmod ide-probe-m" whenever you wish to re-scan
the idle IDE devices.

> Another question: I have an old buggy maxtor drive - 40 megs. It works, but
> not under Linux: "No ??Q after issuing write". What can I do with it? :-)
> Maybe, the best interface for this drive is wall, but.. ;-)
>
>
> //ee

And the line just before the "no DRQ after issuing write", does it read
"hdx: status timeout: status=0x58 { DriveReady SeekComplete DataRequest }"?

Gadi