Skip to contentSkip to conversation

CHRP PCI fixup for Pegasos IDE (looking for testers)

DISCUSSION Matt Sealey 2 participants 6 messages Jul 9, 2007 libata

lore
Share & tools
lore
#0 lore raw

Hi guys,

Just a heads up here, I hammered out this little bit of code over the weekend which "solves" the Pegasos IDE problem by making PCI native mode work like PCI native mode should (it tweaks the ISA bridge to steer both IDE IRQs to 14)

http://www.powerdeveloper.org/files/Pegasos/ide_fixup.c

I definitely need someone to test it though. I can't compile it and I can't run it on a Pegasos here, and I am not sure if the fix is being done early enough (Alan said "before pci_setup_device"..).

It would be nice to see if this interacts with Tejun's patches just recently sent.

Signature · 2 lines
Matt Sealey <[email protected]>
Genesi, Manager, Developer Relations
#1 lore raw

I should note it goes at the end of arch/powerpc/platforms/chrp/pci.c under the Winbond native fix :)

Signature · 2 lines
Matt Sealey <[email protected]>
Genesi, Manager, Developer Relations
Quoted 16 lines · Matt Sealey

Hi guys,

Just a heads up here, I hammered out this little bit of code over the weekend which "solves" the Pegasos IDE problem by making PCI native mode work like PCI native mode should (it tweaks the ISA bridge to steer both IDE IRQs to 14)

http://www.powerdeveloper.org/files/Pegasos/ide_fixup.c

I definitely need someone to test it though. I can't compile it and I can't run it on a Pegasos here, and I am not sure if the fix is being done early enough (Alan said "before pci_setup_device"..).

It would be nice to see if this interacts with Tejun's patches just recently sent.

#2 lore raw
In reply to Matt Sealey
Quoted 7 lines · On Mon, 09 Jul 2007 15:54:31 +0100 Matt Sealey <[email protected]> wrote:

Hi guys,

Just a heads up here, I hammered out this little bit of code over the weekend which "solves" the Pegasos IDE problem by making PCI native mode work like PCI native mode should (it tweaks the ISA bridge to steer both IDE IRQs to 14)

Quoted 5 lines

http://www.powerdeveloper.org/files/Pegasos/ide_fixup.c

I definitely need someone to test it though. I can't compile it and I can't run it on a Pegasos here, and I am not sure if the fix is being done early enough (Alan said "before pci_setup_device"..).

Close but no cookie. The fixup is done at a sensible point, the fixup makes sense.

The ifdef is wrong (could be modular PATA_VIA)
The viaide->irq check is iffy as this is the PCI IRQ rather than the legacy one. Probably you should just force it to 14 if you know that is the correct behaviour.

Otherwise looks a good basis. If it works sanely then I'd bump the other fix out of the old IDE driver and use the quirk fixup for both.

Alan

#3 lore raw

Well, not looking for a cookie.

I don't understand what you mean by the ifdef being wrong. I don't see how else I can make any kind of check for it. If the fix needs to be that early, it can't be done in libata or pata_via directly as it stands.

The viaide->irq check is just me being careful. I know for a fact the only way the Pegasos is set up on every firmware revision is that the PCI interrupt line for the IDE controller is set to 14. If it's not set to that, the fixup would have to be more complicated than zeroing out 4 bits, but the chances of it happening are 0. It's basically to protect the system from having IRQ steering set to 14, when the PCI interrupt line could be set to 10, or 11 or 15.

Obviously as the fix matures that'll all get fixed, but I haven't even tried it yet, so I am not going to overcomplicate it.

As for it being the PCI IRQ instead of legacy, I don't see how it matters. What we want is the IDE steering to match the PCI interrupt line register so native mode works. That's the whole problem as I see it - we configure the controller in PCI native mode, but ISA IDE IRQ steering is still set to 14,15.

The quirk fixup won't work for both, the whole REASON the firmware sets the chip up this way is that the old Via driver and the old PCI block layer somewhere, somehow freaks out if the primary and secondary channel are set to the same IRQ. It just cannot deal with it. At least, this was the case for the last check we did on it, in a couple of years, it may have started working.

I want to know if it fixes libata first. Making the old block driver is something we can do when we find out if libata works.

Signature · 2 lines
Matt Sealey <[email protected]>
Genesi, Manager, Developer Relations
Quoted 28 lines · Alan Cox
Quoted 7 lines · On Mon, 09 Jul 2007 15:54:31 +0100 Matt Sealey <[email protected]> wrote:

Hi guys,

Just a heads up here, I hammered out this little bit of code over the weekend which "solves" the Pegasos IDE problem by making PCI native mode work like PCI native mode should (it tweaks the ISA bridge to steer both IDE IRQs to 14)

Quoted 5 lines

http://www.powerdeveloper.org/files/Pegasos/ide_fixup.c

I definitely need someone to test it though. I can't compile it and I can't run it on a Pegasos here, and I am not sure if the fix is being done early enough (Alan said "before pci_setup_device"..).

Close but no cookie. The fixup is done at a sensible point, the fixup makes sense.

The ifdef is wrong (could be modular PATA_VIA)
The viaide->irq check is iffy as this is the PCI IRQ rather than the legacy one. Probably you should just force it to 14 if you know that is the correct behaviour.

Otherwise looks a good basis. If it works sanely then I'd bump the other fix out of the old IDE driver and use the quirk fixup for both.

Alan

#4 lore raw
Quoted 2 lines

I don't understand what you mean by the ifdef being wrong. I don't see how else I can make any kind of check for it. If the fix needs

if defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)

Quoted 3 lines

The viaide->irq check is just me being careful. I know for a fact the only way the Pegasos is set up on every firmware revision is that the PCI interrupt line for the IDE controller is set to 14. If it's

Cool. Thats fine then.

#5 lore raw

Fixed the define thing.

As a corollary to the patch it might be a good idea to fix the arch/powerpc/kernel/prom_init.c at line ~2084 and remove the interrupt 15 reference

		prop[0] = 14;
		prop[1] = 0x0;
-		prop[0] = 15;
-		prop[1] = 0x0;
-		prom_setprop(ph, name, "interrupts", prop, 4*sizeof(u32));
+		prom_setprop(ph, name, "interrupts", prop, 2*sizeof(u32));
	}
}

Since nobody uses the device tree for anything here, I think it's merely cosmetic, though.

I'll see what I can do about getting this fix into the firmware as and if the via86cxxx driver works with it (I have my doubts but am willing to be pleasantly surprised)

Signature · 2 lines
Matt Sealey <[email protected]>
Genesi, Manager, Developer Relations
Quoted 10 lines · Alan Cox
Quoted 2 lines

I don't understand what you mean by the ifdef being wrong. I don't see how else I can make any kind of check for it. If the fix needs

if defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)

Quoted 3 lines

The viaide->irq check is just me being careful. I know for a fact the only way the Pegasos is set up on every firmware revision is that the PCI interrupt line for the IDE controller is set to 14. If it's

Cool. Thats fine then.