RE: [PATCH] 2.6.5- es7000 subarch update

From: Protasevich, Natalie
Date: Mon Apr 12 2004 - 15:33:29 EST


> > Since it is a valid entry, find_irq_entry() in setup_IO_APIC_irqs() searches the mp_irqs[] by the pin number and runs into this element first. It uses it to program the pin and never gets to the element down below that contains modified entry with a correct overwrite in it.
> > I was able to get rid of this problem on the ES7000 with the following code:
> >
> > for (i = 0; i < mp_irq_entries; i++) {
> > if ((mp_irqs[i].mpc_srcbus == intsrc.mpc_srcbus)
> > && (mp_irqs[i].mpc_srcbusirq == intsrc.mpc_srcbusirq)) {
> > mp_irqs[i] = intsrc;
> > + if (intsrc.mpc_srcbusirq > pin) {
> > + int j;
> > + for (j = 0; j < i; j++)
> > + if (mp_irqs[j].mpc_dstirq == intsrc.mpc_dstirq)
> > + mp_irqs[j].mpc_irqtype = -1;
> > + }
> > found = 1;
> > break;
> > }
> > }
> > I will appreciate any feedback and suggestions.
>
> Out of interest, doesn't this have the same effect?

Hi Zwane,
It is actually close to what I had in my initial patch when I posted it (and got in trouble with the timer IRQ0):

...
intsrc.mpc_dstirq = pin;
...
- && (mp_irqs[i].mpc_srcbusirq == intsrc.mpc_srcbusirq)) {
+ && (mp_irqs[i].mpc_dstirq == intsrc.mpc_dstirq)) {

This code indexes mp_irqs[] by the pin, but has a similar "miscounting" problem and adds a second element with the same bus irq. I think this code could work either way being indexed by the pin or by the bus irq, but it has to be fixed in either case. (As I understand, with srcbusirq it doesn't work as is for much fewer people than with dstirq :)

Regards,
--Natalie

>Forgot the bus check;

>Index: linux-2.6.5-mc3/arch/i386/kernel/mpparse.c
>===================================================================
>RCS file: /home/cvsroot/linux-2.6.5-mc3/arch/i386/kernel/mpparse.c,v
>retrieving revision 1.1.1.1
>diff -u -p -B -r1.1.1.1 mpparse.c
>--- linux-2.6.5-mc3/arch/i386/kernel/mpparse.c 9 Apr 2004 17:53:27 -0000 1.1.1.1
>+++ linux-2.6.5-mc3/arch/i386/kernel/mpparse.c 12 Apr 2004 18:31:22 -0000
>@@ -968,8 +968,9 @@ void __init mp_override_legacy_irq (
> * Otherwise create a new entry (e.g. gsi == 2).
> */
> for (i = 0; i < mp_irq_entries; i++) {
>- if ((mp_irqs[i].mpc_srcbus == intsrc.mpc_srcbus)
>- && (mp_irqs[i].mpc_srcbusirq == intsrc.mpc_srcbusirq)) {
>+ if ((mp_irqs[i].srcbus == MP_ISA_BUS) &&
>+ mp_irqs[i].mpc_dstirq == pin) {
>+
> mp_irqs[i] = intsrc;
> found = 1;
> break;
-
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/