* 2.6.11-rc3-bk1: ide1: failed to initialize IDE interface
@ 2005-02-04 22:44 Jean Delvare
2005-02-04 23:41 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 5+ messages in thread
From: Jean Delvare @ 2005-02-04 22:44 UTC (permalink / raw)
To: LKML; +Cc: Bartlomiej Zolnierkiewicz, Prarit Bhargava
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/cset@1.1992.9.16
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,
--
Jean Delvare
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2.6.11-rc3-bk1: ide1: failed to initialize IDE interface
2005-02-04 22:44 2.6.11-rc3-bk1: ide1: failed to initialize IDE interface Jean Delvare
@ 2005-02-04 23:41 ` Bartlomiej Zolnierkiewicz
2005-02-05 20:55 ` Jean Delvare
0 siblings, 1 reply; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-02-04 23:41 UTC (permalink / raw)
To: Jean Delvare; +Cc: LKML, Prarit Bhargava
On Fri, 4 Feb 2005 23:44:22 +0100, Jean Delvare <khali@linux-fr.org> wrote:
> 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/cset@1.1992.9.16
>
> 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
Yep this is the simplest fix - interface without a drives should
return success value. Care to make a patch?
> 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.
> 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2.6.11-rc3-bk1: ide1: failed to initialize IDE interface
2005-02-04 23:41 ` Bartlomiej Zolnierkiewicz
@ 2005-02-05 20:55 ` Jean Delvare
2005-02-05 21:13 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 5+ messages in thread
From: Jean Delvare @ 2005-02-05 20:55 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: LKML, Prarit Bhargava
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@linux-fr.org>
--- 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2.6.11-rc3-bk1: ide1: failed to initialize IDE interface
2005-02-05 20:55 ` Jean Delvare
@ 2005-02-05 21:13 ` Bartlomiej Zolnierkiewicz
2005-02-05 22:20 ` Jean Delvare
0 siblings, 1 reply; 5+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-02-05 21:13 UTC (permalink / raw)
To: Jean Delvare; +Cc: LKML, Prarit Bhargava
On Sat, 5 Feb 2005 21:55:35 +0100, Jean Delvare <khali@linux-fr.org> wrote:
> Hi Bartlomiej & all,
Hi,
> > > 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@linux-fr.org>
>
> --- 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])))
Thanks!
> 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.
CONFIG_IDE_GENERIC is enabled
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 2.6.11-rc3-bk1: ide1: failed to initialize IDE interface
2005-02-05 21:13 ` Bartlomiej Zolnierkiewicz
@ 2005-02-05 22:20 ` Jean Delvare
0 siblings, 0 replies; 5+ messages in thread
From: Jean Delvare @ 2005-02-05 22:20 UTC (permalink / raw)
To: Bartlomiej Zolnierkiewicz; +Cc: LKML, Prarit Bhargava
Hi again Bartlomiej, all,
> > 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
>
> > While we're at it, I also wonder why ide2-ide5 are probed, when
> > neither of my systems has them.
>
> CONFIG_IDE_GENERIC again
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.
> 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...
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,
--
Jean Delvare
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-02-05 22:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-04 22:44 2.6.11-rc3-bk1: ide1: failed to initialize IDE interface Jean Delvare
2005-02-04 23:41 ` Bartlomiej Zolnierkiewicz
2005-02-05 20:55 ` Jean Delvare
2005-02-05 21:13 ` Bartlomiej Zolnierkiewicz
2005-02-05 22:20 ` Jean Delvare
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox