Commit b431de15 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] add sis apic workaround support

parent 94db30f2
...@@ -43,6 +43,12 @@ ...@@ -43,6 +43,12 @@
static spinlock_t ioapic_lock = SPIN_LOCK_UNLOCKED; static spinlock_t ioapic_lock = SPIN_LOCK_UNLOCKED;
/*
* Is the SiS APIC rmw bug present ?
* -1 = dont know, 0 = no, 1 = yes
*/
int sis_apic_bug = -1;
/* /*
* # of IRQ routing registers * # of IRQ routing registers
*/ */
...@@ -122,7 +128,7 @@ static void __init replace_pin_at_irq(unsigned int irq, ...@@ -122,7 +128,7 @@ static void __init replace_pin_at_irq(unsigned int irq,
break; \ break; \
reg = io_apic_read(entry->apic, 0x10 + R + pin*2); \ reg = io_apic_read(entry->apic, 0x10 + R + pin*2); \
reg ACTION; \ reg ACTION; \
io_apic_modify(entry->apic, reg); \ io_apic_modify(entry->apic, 0x10 + R + pin*2, reg); \
if (!entry->next) \ if (!entry->next) \
break; \ break; \
entry = irq_2_pin + entry->next; \ entry = irq_2_pin + entry->next; \
...@@ -1738,6 +1744,18 @@ void __init setup_IO_APIC(void) ...@@ -1738,6 +1744,18 @@ void __init setup_IO_APIC(void)
print_IO_APIC(); print_IO_APIC();
} }
/*
* Called after all the initialization is done. If we didnt find any
* APIC bugs then we can allow the modify fast path
*/
static void __init io_apic_bug_finalize(void)
{
if(sis_apic_bug == -1)
sis_apic_bug = 0;
}
late_initcall(io_apic_bug_finalize);
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
ACPI-based IOAPIC Configuration ACPI-based IOAPIC Configuration
......
...@@ -120,9 +120,13 @@ static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned i ...@@ -120,9 +120,13 @@ static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned i
/* /*
* Re-write a value: to be used for read-modify-write * Re-write a value: to be used for read-modify-write
* cycles where the read already set up the index register. * cycles where the read already set up the index register.
*
* Older SiS APIC requires we rewrite the index regiser
*/ */
static inline void io_apic_modify(unsigned int apic, unsigned int value) static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
{ {
if(apic_sis_bug)
*IO_APIC_BASE(apic) = reg;
*(IO_APIC_BASE(apic)+4) = value; *(IO_APIC_BASE(apic)+4) = value;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment