[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m18wabzvd5.fsf@fess.ebiederm.org>
Date: Mon, 01 Mar 2010 11:37:26 -0800
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Yinghai Lu <yinghai@...nel.org>
Cc: Ingo Molnar <mingo@...e.hu>, linux-tip-commits@...r.kernel.org,
linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
garyhade@...ibm.com, iranna.ankad@...ibm.com,
suresh.b.siddha@...el.com, tglx@...utronix.de, trenn@...e.de
Subject: Re: [tip:x86/apic] x86: Fix out of order gsi -- add remap_ioapic_gsi_to_irq()
>> /* By default isa irqs are identity mapped to gsis */
>> unsigned int isa_irq_to_gsi[16] = {
>> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
>> };
>>
>> unsigned int gsi_to_irq(unsigned int gsi)
>> {
>> unsigned int irq = gsi + 16;
>> unsigned int i;
>> for (i = 0; i < 16; i++) {
>> if (isa_irq_to_gsi[i] == gsi)
>> irq = i;
>> }
>> return irq;
>> }
I just realized that we already have this function in
arch/x86/kernel/acpi/boot.c and arch/ia64/kernel/acpi.c it is called:
acpi_gsi_to_irq()
We still need this implementation but it will get really confusing if
we have two functions with the same name trying to do the same job.
I am relieved to see this because this should mean we shouldn't have
many hard fixed assumptions that irq == gsi.
This does mean though that your patch has a real bug in it because
you have not updated acpi_gsi_to_irq.
Eric
>> unsigned int irq_to_gsi(unsigned int irq)
>> {
>> unsigned int gsi;
>> if (irq < 16) {
>> gsi = isa_irq_to_gsi[irq];
>> } else {
>> gsi = irq - 16;
>> }
>> return gsi;
>> }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists