Skip to contentSkip to conversation

Multiple (ICH3) IDE-controllers in a system

DISCUSSION Shai Fultheim 3 participants 5 messages May 4, 2004 – May 6, 2004 libata

lore
Share & tools
lore
#0 lore raw

Hi,

I am working on an IO-robust custom-made PC server, which runs the Linux kernel.  The machine is working very nicely with 2.4 kernels, but we recently found out that in 2.6 it couldn't see all IDE controllers.

In Linux 2.6.x pcibios_fixups table (in arch/i386/pci/fixup.c), use the pci_fixup_ide_trash() quirk for Intel's ICH3 (my case specifically 8086:248b).  That quirk wasn't in use for ICH3 by the 2.4.x kernels.  The result of the change is that the system, which has multiple ICH3's can't use any of the IDE controllers beside the one on the first ICH3 (again, that worked in 2.4 kernels).

Is there a real reason to call that quirk?  If there is not, why are you calling that quirk?  If there is, can I suggest that the quirk will handle only the first ICH3 (i.e. add check in the quirk that it is called for the first time only).  This is better than "loosing" all these IDE controllers in the case their BARs set right.

Blow references for bare 2.6.5 kernel:

Code walkup starts with pci_scan_single_device() at
http://lxr.linux.no/source/drivers/pci/probe.c?v=2.6.5#L590 which calls to pci_fixup_device() (line 601) which in turn use the quirks table at
http://lxr.linux.no/source/arch/i386/pci/fixup.c?v=2.6.5#L190 (my chipset is in line 248).  The quirks table for ICH3 use pci_fixup_ide_trash()at
http://lxr.linux.no/source/arch/i386/pci/fixup.c?v=2.6.5#L90 - this reset the BARs for the device.  Resetting the all (4) BARs of (ICH3) IDE controllers will cause them to use the defaults BARs (0x170, 0x1f0) in ide_hwif_configure() at
http://lxr.linux.no/source/drivers/ide/setup-pci.c?v=2.6.5#L420.  This will fail with any subsequent (ICH3) IDE controllers (two devices can't use the same ports).

I'm not sure if ICH3 needs to reset its BARs at all, but if it is, I suggest making sure pci_fixup_ide_trash() reset BARs only for first time being called.  In that way subsequent IDE controllers will use the BIOS BARs (which we set fine, and worked GREAT at 2.4.x), as said above, this is better than "loosing" all the other IDE controllers in the case their BARs set right.

Thanks in advance,
Shai.


_________________________
Shai Fultheim
FT Consulting

Mobile: +1 (408) 480-1612
Fax:    +1 (501) 647-4113
E-Mail: [email protected]

Web:    www.ftcon.com

#1 lore raw

Hi Vojtech,

Do I correctly assume that these fixups for Intel chipsets are from you?

http://linus.bkbits.net:8080/linux-2.5/cset@3cfbacdfzHvfqp0Sa45QXt9pNn3LNg?nav=index.html|src/|src/arch|src/arch/i386|src/arch/i386/pci|related/arch/i386/pci/fixup.c
http://linus.bkbits.net:8080/linux-2.5/cset@3cfcec0fOJreGFyCWkPeT7EWiydYFw?nav=index.html|src/|src/arch|src/arch/i386|src/arch/i386/pci|related/arch/i386/pci/fixup.c

Care to explain why 'trash' fixup is needed in 2.6 but not in 2.4?

Cheers,
Bartlomiej

Quoted 44 lines · Shai Fultheim

Hi,

I am working on an IO-robust custom-made PC server, which runs the Linux kernel. The machine is working very nicely with 2.4 kernels, but we recently found out that in 2.6 it couldn't see all IDE controllers.

In Linux 2.6.x pcibios_fixups table (in arch/i386/pci/fixup.c), use the pci_fixup_ide_trash() quirk for Intel's ICH3 (my case specifically 8086:248b). That quirk wasn't in use for ICH3 by the 2.4.x kernels. The result of the change is that the system, which has multiple ICH3's can't use any of the IDE controllers beside the one on the first ICH3 (again, that worked in 2.4 kernels).

Is there a real reason to call that quirk? If there is not, why are you calling that quirk? If there is, can I suggest that the quirk will handle only the first ICH3 (i.e. add check in the quirk that it is called for the first time only). This is better than "loosing" all these IDE controllers in the case their BARs set right.

Blow references for bare 2.6.5 kernel:

Code walkup starts with pci_scan_single_device() at
http://lxr.linux.no/source/drivers/pci/probe.c?v=2.6.5#L590 which calls to pci_fixup_device() (line 601) which in turn use the quirks table at
http://lxr.linux.no/source/arch/i386/pci/fixup.c?v=2.6.5#L190 (my chipset is in line 248). The quirks table for ICH3 use pci_fixup_ide_trash()at
http://lxr.linux.no/source/arch/i386/pci/fixup.c?v=2.6.5#L90 - this reset the BARs for the device. Resetting the all (4) BARs of (ICH3) IDE controllers will cause them to use the defaults BARs (0x170, 0x1f0) in ide_hwif_configure() at
http://lxr.linux.no/source/drivers/ide/setup-pci.c?v=2.6.5#L420. This will fail with any subsequent (ICH3) IDE controllers (two devices can't use the same ports).

I'm not sure if ICH3 needs to reset its BARs at all, but if it is, I suggest making sure pci_fixup_ide_trash() reset BARs only for first time being called. In that way subsequent IDE controllers will use the BIOS BARs (which we set fine, and worked GREAT at 2.4.x), as said above, this is better than "loosing" all the other IDE controllers in the case their BARs set right.

Thanks in advance,
Shai.

#2 lore raw
Quoted 4 lines · Bartlomiej Zolnierkiewicz

Hi Vojtech,

Do I correctly assume that these fixups for Intel chipsets are from you?

Yes.

Quoted 4 lines
http://linus.bkbits.net:8080/linux-2.5/cset@3cfbacdfzHvfqp0Sa45QXt9pNn3LNg?nav=index.html|src/|src/arch|src/arch/i386|src/arch/i386/pci|related/arch/i386/pci/fixup.c
http://linus.bkbits.net:8080/linux-2.5/cset@3cfcec0fOJreGFyCWkPeT7EWiydYFw?nav=index.html|src/|src/arch|src/arch/i386|src/arch/i386/pci|related/arch/i386/pci/fixup.c

Care to explain why 'trash' fixup is needed in 2.6 but not in 2.4?

Because 2.4 was never used on the affected machines, where this fixup was needed - those machines sere putting nonsense into the BARs. I don't recall exactly what model they were, though I remember they were one of the first machines with ICH MMIO support.

Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#3 lore raw

Ok.
I would suggest one of the followings:
1. If we can't identify those machine, I would recommend to drop that patch, since probably the BIOS is taking care of it nowadays.
2. If we believe we can't do (1) above, lets have it rest only the first controller it is being called for. This will make any of the other controllers usable if their ports are set right.

Any comments?

--Shai

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Vojtech Pavlik
Sent: Wednesday, May 05, 2004 23:46
To: Bartlomiej Zolnierkiewicz
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: Multiple (ICH3) IDE-controllers in a system

Quoted 4 lines · Bartlomiej Zolnierkiewicz

Hi Vojtech,

Do I correctly assume that these fixups for Intel chipsets are from you?

Yes.

Quoted 1 line

http://linus.bkbits.net:8080/linux-2.5/cset@3cfbacdfzHvfqp0Sa45QXt9pNn3LNg?n
av=index.html|src/|src/arch|src/arch/i386|src/arch/i386/pci|related/arch/i38 6/pci/fixup.c

Quoted 1 line

http://linus.bkbits.net:8080/linux-2.5/cset@3cfcec0fOJreGFyCWkPeT7EWiydYFw?n
av=index.html|src/|src/arch|src/arch/i386|src/arch/i386/pci|related/arch/i38 6/pci/fixup.c

Quoted 2 lines

Care to explain why 'trash' fixup is needed in 2.6 but not in 2.4?

Because 2.4 was never used on the affected machines, where this fixup was needed - those machines sere putting nonsense into the BARs. I don't recall exactly what model they were, though I remember they were one of the first machines with ICH MMIO support.

Signature · 6 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw

Vojtech and Bartlomiej,

Attached patch that fix the problem according to (2) below. Let me know if you can apply it.

Thanks.

--- linux-2.6.5-mm6.orig/arch/i386/pci/fixup.c 2004-04-29 05:23:35.000000000 -0700
+++ linux-2.6.5-mm6/arch/i386/pci/fixup.c 2004-05-07
01:45:31.000000000 -0700
@@ -92,6 +92,15 @@

        int i;
 
        /*
+        * Runs the fixup only for the first IDE controller
+        * (Shai Fultheim - [email protected])
+        */

+ static int called = 0;
+ if (called)
+ return;
+ called = 1;
+
+ /*
* There exist PCI IDE controllers which have utter garbage
* in first four base registers. Ignore that.
*/

--Shai

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Shai Fultheim
Sent: Thursday, May 06, 2004 12:19
To: 'Vojtech Pavlik'; 'Bartlomiej Zolnierkiewicz'
Cc: [email protected]; [email protected]
Subject: RE: Multiple (ICH3) IDE-controllers in a system

Ok.
I would suggest one of the followings:
1. If we can't identify those machine, I would recommend to drop that patch, since probably the BIOS is taking care of it nowadays.
2. If we believe we can't do (1) above, lets have it rest only the first controller it is being called for. This will make any of the other controllers usable if their ports are set right.

Any comments?

--Shai

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Vojtech Pavlik
Sent: Wednesday, May 05, 2004 23:46
To: Bartlomiej Zolnierkiewicz
Cc: [email protected]; [email protected]; [email protected]
Subject: Re: Multiple (ICH3) IDE-controllers in a system

Quoted 4 lines · Bartlomiej Zolnierkiewicz

Hi Vojtech,

Do I correctly assume that these fixups for Intel chipsets are from you?

Yes.

Quoted 1 line

http://linus.bkbits.net:8080/linux-2.5/cset@3cfbacdfzHvfqp0Sa45QXt9pNn3LNg?n
av=index.html|src/|src/arch|src/arch/i386|src/arch/i386/pci|related/arch/i38 6/pci/fixup.c

Quoted 1 line

http://linus.bkbits.net:8080/linux-2.5/cset@3cfcec0fOJreGFyCWkPeT7EWiydYFw?n
av=index.html|src/|src/arch|src/arch/i386|src/arch/i386/pci|related/arch/i38 6/pci/fixup.c

Quoted 2 lines

Care to explain why 'trash' fixup is needed in 2.6 but not in 2.4?

Because 2.4 was never used on the affected machines, where this fixup was needed - those machines sere putting nonsense into the BARs. I don't recall exactly what model they were, though I remember they were one of the first machines with ICH MMIO support.

Signature · 11 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
arch/i386/pci/fixup.c +9 -0
@@ -92,6 +92,15 @@
 	int i;
 
 	/*
+	 * Runs the fixup only for the first IDE controller
+	 * (Shai Fultheim - [email protected])
+	 */
+	static int called = 0;
+	if (called)
+		return;
+	called = 1;
+
+	/*
 	 * There exist PCI IDE controllers which have utter garbage
 	 * in first four base registers. Ignore that.
 	 */