Skip to contentSkip to conversation

NR_IRQS and possible irq values on malta

DISCUSSION Guy Streeter 2 participants 2 messages Feb 3, 2005 MIPS

lore
Share & tools
lore
#0 lore raw

In mips_pcibios_iack() the irq number is obtained like this:

		irq = GT_READ(GT_PCI0_IACK_OFS);
		irq &= 0xff;

(for coreLV, but similarly for others). This value is used to index into an array of size NR_IRQS, which is set in mach-generic/irq.h to 128.
I realize that when things work right, the value of irq isn't likely
to get that big, but it seems to me it should be masked down to 127 or the NR_IRQS value should be larger. I have no opinion which is the right thing to do.

--Guy

#1 lore raw
Quoted 5 lines · Guy Streeter

In mips_pcibios_iack() the irq number is obtained like this:

		irq = GT_READ(GT_PCI0_IACK_OFS);
		irq &= 0xff;
Quoted 7 lines

(for coreLV, but similarly for others). This value is used to index into an array of size NR_IRQS, which is set in mach-generic/irq.h to 128.
I realize that when things work right, the value of irq isn't likely
to get that big, but it seems to me it should be masked down to 127 or the NR_IRQS value should be larger. I have no opinion which is the right thing to do.

It looks like a problem in __do_IRQ() (in kernel/irq/handle.c) -- it
should probably call "BUG_ON(irq >= NR_IRQS)". MIPS-specific code doesn't care.

Maciej