Re: [tip:x86/apic] x86: Fix out of order gsi -- add remap_ioapic_gsi_to_irq()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> /* 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-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux