Re: [PATCH] x86, ioapic: Clean up ioapic/apic_id usage

From: Bjorn Helgaas
Date: Fri Jul 15 2011 - 11:41:41 EST


On Thu, Jul 14, 2011 at 9:31 AM, Yinghai Lu <yinghai@xxxxxxxxxx> wrote:
>
> While checking irte dump in dmesg, the print out is confused ioapic index
> and real io apic id.
>
> IOAPIC[0]: Set routing entry (1-1 -> 0x31 -> IRQ 1 Mode:0 Active:0 Dest:1)
> IOAPIC[1]: Set IRTE entry (P:1 FPD:0 Dst_Mode:1 Redir_hint:1 Trig_Mode:0 Dlvry_Mode:1 Avail:0 Vector:31 Dest:00000001 SID:00FF SQ:0 SVT:1)
> IOAPIC[0]: Set routing entry (1-2 -> 0x30 -> IRQ 0 Mode:0 Active:0 Dest:1)
> IOAPIC[1]: Set IRTE entry (P:1 FPD:0 Dst_Mode:1 Redir_hint:1 Trig_Mode:0 Dlvry_Mode:1 Avail:0 Vector:30 Dest:00000001 SID:00FF SQ:0 SVT:1)
>
> The system first ioapic id is 1.
>
> While looking at the code, apic_id sometime is referred to index of ioapic, but
> sometime is used for real apic id. and some even use apic for real apic id.
> It is very confusing.
>
> So try to limit apic_id to be real apic id for ioapic.
> and use ioapic for ioapic index in the array.

It seems like this patch is doing two things at once, and it would be
easier to understand & review if they were split into separate
patches:

1) The code cleanup that renames parameters & local variables so
they're used consistently, but makes no difference in operation or
dmesg output.
2) The printk changes to fix the dmesg output.

Bjorn
--
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/