Re: 2.6.11-rc3-bk1: ide1: failed to initialize IDE interface

From: Jean Delvare
Date: Sat Feb 05 2005 - 15:58:58 EST


Hi Bartlomiej & all,

> > I would tend to think that this is *not* an error, so we shouldn't
> > display an error message in this case. Maybe init_hwif() should
> > return 1 instead of 0 in this case.
>
> Yep this is the simplest fix - interface without a drives should
> return success value. Care to make a patch?

That would be as simple as this, I guess:

Signed-off-by: Jean Delvare <khali@xxxxxxxxxxxx>

--- linux-2.6.11-rc3-bk2/drivers/ide/ide-probe.c.orig 2005-02-05 19:41:01.000000000 +0100
+++ linux-2.6.11-rc3-bk2/drivers/ide/ide-probe.c 2005-02-05 19:42:46.000000000 +0100
@@ -1248,8 +1248,9 @@
{
int old_irq, unit;

+ /* Return success if no device is connected */
if (!hwif->present)
- return 0;
+ return 1;

if (!hwif->irq) {
if (!(hwif->irq = ide_default_irq(hwif->io_ports[IDE_DATA_OFFSET])))


There's another thing I noticed about IDE and thought I might report as
well. It seems that, when an IDE interface has no device connected, it
ends up being probed twice. From dmesg:

ICH3M: chipset revision 1
ICH3M: not 100% native mode: will probe irqs later
ide0: BM-DMA at 0x1860-0x1867, BIOS settings: hda:DMA, hdb:pio
ide1: BM-DMA at 0x1868-0x186f, BIOS settings: hdc:pio, hdd:pio
Probing IDE interface ide0...
hda: HITACHI_DK23CA-15, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
Probing IDE interface ide1...
Probing IDE interface ide2...
Probing IDE interface ide3...
Probing IDE interface ide4...
Probing IDE interface ide5...

Notice how ide1, which happens to have no device attached, is listed
twice. I can reproduce this on my second system as well (i386 too, but
otherwise completely different). I guess it doesn't cause any trouble,
but looks suboptimal.

While we're at it, I also wonder why ide2-ide5 are probed, when neither
of my systems has them.

Thanks,
--
Jean Delvare
-
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/