2.6.11-rc3-bk1: ide1: failed to initialize IDE interface
Hi all,
I just gave a quick try to 2.6.11-rc3-bk1, and noticed the following new message in dmesg:
ide1: failed to initialize IDE interface
This seems to be new in 2.6.11-rc3-bk1. I could find the relevant changeset in bk:
http://linux.bkbits.net:8080/linux-2.5/[email protected]
My (admittedly quick) analysis of the code (drivers/ide/ide-probe.c) is that init_hwif() can return 0 in two cases: either because the IDE interface is somehow not really there (!hwif->present) or because something wrong happened while initializing the IDE interface. My system's ide1 happens to be enabled (BIOS settings) but no IDE device is connected to it. I traced the code and it unsurprisingly happens that I am in the first "error" case - init_hwif() exits immediately because !hwif->present.
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. Or maybe it should return -1, 0 and 1 for error, no interface and success, respectively. I'm not certain I understand the semantics behind the returned value, does it mean error/success or interface absent/present (or a bit of each)? Or maybe we could move the error message into init_hwif() itself, but that would require some error path changes.
I do not propose a patch because I'm not exactly sure what has to be done, but I still believe something has to be done. Insight anyone?
Thanks,
Signature · 1 line
Jean Delvare
Quoted 19 lines · Jean Delvare
Hi all,
I just gave a quick try to 2.6.11-rc3-bk1, and noticed the following new message in dmesg:
ide1: failed to initialize IDE interfaceThis seems to be new in 2.6.11-rc3-bk1. I could find the relevant changeset in bk:
http://linux.bkbits.net:8080/linux-2.5/[email protected]My (admittedly quick) analysis of the code (
drivers/ide/ide-probe.c) is thatinit_hwif()can return 0 in two cases: either because the IDE interface is somehow not really there (!hwif->present) or because something wrong happened while initializing the IDE interface. My system's ide1 happens to be enabled (BIOS settings) but no IDE device is connected to it. I traced the code and it unsurprisingly happens that I am in the first "error" case -init_hwif()exits immediately because !hwif->present.
Quoted 2 lines
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
Yep this is the simplest fix - interface without a drives should return success value. Care to make a patch?
Quoted 4 lines
instead of 0 in this case. Or maybe it should return -1, 0 and 1 for error, no interface and success, respectively. I'm not certain I understand the semantics behind the returned value, does it mean error/success or interface absent/present (or a bit of each)? Or maybe
Return value currently means only error/success and till the latest patch this value was ignored completely.
Quoted 10 lines
we could move the error message into
init_hwif()itself, but that would require some error path changes.I do not propose a patch because I'm not exactly sure what has to be done, but I still believe something has to be done. Insight anyone?
Thanks,
--
Jean Delvare
Hi Bartlomiej & all,
Quoted 6 lines
Quoted 3 lines
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:
drivers/ide/ide-probe.c renamed from drivers/ide/ide-probe.c.orig +2 -1
@@ -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:pioProbing 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,
Signature · 1 line
Jean Delvare
Quoted 1 line · Jean Delvare
Hi Bartlomiej & all,
Hi,
Quoted 14 lines
Quoted 6 lines
Quoted 3 lines
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 <[email protected]>
drivers/ide/ide-probe.c 2005-02-05 19:42:46.000000000 +0100 line 1256
Quoted 10 lines
drivers/ide/ide-probe.c 2005-02-05 19:42:46.000000000 +0100 renamed from drivers/ide/ide-probe.c.orig 2005-02-05 19:41:01.000000000 +0100 +2
-1@@ -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])))
Thanks!
Quoted 18 lines
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 lateride0: BM-DMA at 0x1860-0x1867, BIOS settings: hda:DMA, hdb:pio ide1: BM-DMA at 0x1868-0x186f, BIOS settings: hdc:pio, hdd:pioProbing 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...
Quoted 4 lines
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.
CONFIG_IDE_GENERIC is enabled
Quoted 2 lines
While we're at it, I also wonder why ide2-ide5 are probed, when neither of my systems has them.
CONFIG_IDE_GENERIC again
It was always like that but the printk has been added recently so people start to noticing it...
Alan has a patch in -ac to not probe for legacy ports if system has PCI but it needs testing and is limited to x86 currently. Also it not a full solution as legacy ports logic needs to be moved to ide_generic anyway...
Bartlomiej
Hi again Bartlomiej, all,
Quoted 11 lines
Quoted 4 lines
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.
CONFIG_IDE_GENERICis enabledQuoted 2 lines
While we're at it, I also wonder why ide2-ide5 are probed, when neither of my systems has them.
CONFIG_IDE_GENERICagain
You got it. Disabling CONFIG_IDE_GENERIC let me get rid of these duplicate/additional probes. Thanks for the hint :)
A real help text attached to this configuration option would certainly have helped here. And the label misses its leading capital.
Quoted 4 lines
Alan has a patch in -ac to not probe for legacy ports if system has PCI but it needs testing and is limited to x86 currently. Also it not a full solution as legacy ports logic needs to be moved to
ide_genericanyway...
Maybe the option should be relabelled from "generic/default IDE chipset support" to "Non-PCI IDE chipset support" or "Legacy IDE ports support"? I think it should express the fact that people with modern systems do not need it, providing this is actually the case - not sure I exactly understand what it is.
Thanks again,
Signature · 1 line
Jean Delvare