diff options
| -rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 913d4bd2913a..85050c9ab755 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
| @@ -394,13 +394,21 @@ union entry_union { | |||
| 394 | struct IO_APIC_route_entry entry; | 394 | struct IO_APIC_route_entry entry; |
| 395 | }; | 395 | }; |
| 396 | 396 | ||
| 397 | static struct IO_APIC_route_entry __ioapic_read_entry(int apic, int pin) | ||
| 398 | { | ||
| 399 | union entry_union eu; | ||
| 400 | |||
| 401 | eu.w1 = io_apic_read(apic, 0x10 + 2 * pin); | ||
| 402 | eu.w2 = io_apic_read(apic, 0x11 + 2 * pin); | ||
| 403 | return eu.entry; | ||
| 404 | } | ||
| 405 | |||
| 397 | static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin) | 406 | static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin) |
| 398 | { | 407 | { |
| 399 | union entry_union eu; | 408 | union entry_union eu; |
| 400 | unsigned long flags; | 409 | unsigned long flags; |
| 401 | raw_spin_lock_irqsave(&ioapic_lock, flags); | 410 | raw_spin_lock_irqsave(&ioapic_lock, flags); |
| 402 | eu.w1 = io_apic_read(apic, 0x10 + 2 * pin); | 411 | eu.entry = __ioapic_read_entry(apic, pin); |
| 403 | eu.w2 = io_apic_read(apic, 0x11 + 2 * pin); | ||
| 404 | raw_spin_unlock_irqrestore(&ioapic_lock, flags); | 412 | raw_spin_unlock_irqrestore(&ioapic_lock, flags); |
| 405 | return eu.entry; | 413 | return eu.entry; |
| 406 | } | 414 | } |
| @@ -529,18 +537,6 @@ static void io_apic_modify_irq(struct irq_cfg *cfg, | |||
| 529 | __io_apic_modify_irq(entry, mask_and, mask_or, final); | 537 | __io_apic_modify_irq(entry, mask_and, mask_or, final); |
| 530 | } | 538 | } |
| 531 | 539 | ||
| 532 | static void __mask_and_edge_IO_APIC_irq(struct irq_pin_list *entry) | ||
| 533 | { | ||
| 534 | __io_apic_modify_irq(entry, ~IO_APIC_REDIR_LEVEL_TRIGGER, | ||
| 535 | IO_APIC_REDIR_MASKED, NULL); | ||
| 536 | } | ||
| 537 | |||
| 538 | static void __unmask_and_level_IO_APIC_irq(struct irq_pin_list *entry) | ||
| 539 | { | ||
| 540 | __io_apic_modify_irq(entry, ~IO_APIC_REDIR_MASKED, | ||
| 541 | IO_APIC_REDIR_LEVEL_TRIGGER, NULL); | ||
| 542 | } | ||
| 543 | |||
| 544 | static void io_apic_sync(struct irq_pin_list *entry) | 540 | static void io_apic_sync(struct irq_pin_list *entry) |
| 545 | { | 541 | { |
| 546 | /* | 542 | /* |
| @@ -2496,8 +2492,23 @@ static void eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg) | |||
| 2496 | else | 2492 | else |
| 2497 | io_apic_eoi(entry->apic, cfg->vector); | 2493 | io_apic_eoi(entry->apic, cfg->vector); |
| 2498 | } else { | 2494 | } else { |
| 2499 | __mask_and_edge_IO_APIC_irq(entry); | 2495 | struct IO_APIC_route_entry rte, rte1; |
| 2500 | __unmask_and_level_IO_APIC_irq(entry); | 2496 | |
| 2497 | rte = rte1 = | ||
| 2498 | __ioapic_read_entry(entry->apic, entry->pin); | ||
| 2499 | |||
| 2500 | /* | ||
| 2501 | * Mask the entry and change the trigger mode to edge. | ||
| 2502 | */ | ||
| 2503 | rte1.mask = 1; | ||
| 2504 | rte1.trigger = IOAPIC_EDGE; | ||
| 2505 | |||
| 2506 | __ioapic_write_entry(apic, pin, rte1); | ||
| 2507 | |||
| 2508 | /* | ||
| 2509 | * Restore the previous level triggered entry. | ||
| 2510 | */ | ||
| 2511 | __ioapic_write_entry(apic, pin, rte); | ||
| 2501 | } | 2512 | } |
| 2502 | } | 2513 | } |
| 2503 | raw_spin_unlock_irqrestore(&ioapic_lock, flags); | 2514 | raw_spin_unlock_irqrestore(&ioapic_lock, flags); |
