[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-aaaec6fc755447a1d056765b11b24d8ff2b81366@git.kernel.org>
Date: Tue, 31 Jan 2017 11:25:11 -0800
From: tip-bot for Thomas Gleixner <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mingo@...nel.org, hpa@...or.com, linux-kernel@...r.kernel.org,
efault@....de, aryabinin@...tuozzo.com, bp@...en8.de,
tglx@...utronix.de, marc.zyngier@....com
Subject: [tip:irq/urgent] x86/irq: Make irq activate operations symmetric
Commit-ID: aaaec6fc755447a1d056765b11b24d8ff2b81366
Gitweb: http://git.kernel.org/tip/aaaec6fc755447a1d056765b11b24d8ff2b81366
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Tue, 31 Jan 2017 19:03:21 +0100
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Tue, 31 Jan 2017 20:22:18 +0100
x86/irq: Make irq activate operations symmetric
The recent commit which prevents double activation of interrupts unearthed
interesting code in x86. The code (ab)uses irq_domain_activate_irq() to
reconfigure an already activated interrupt. That trips over the prevention
code now.
Fix it by deactivating the interrupt before activating the new configuration.
Fixes: 08d85f3ea99f1 "irqdomain: Avoid activating interrupts more than once"
Reported-and-tested-by: Mike Galbraith <efault@....de>
Reported-and-tested-by: Borislav Petkov <bp@...en8.de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: Andrey Ryabinin <aryabinin@...tuozzo.com>
Cc: Marc Zyngier <marc.zyngier@....com>
Cc: stable@...r.kernel.org
Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1701311901580.3457@nanos
---
arch/x86/kernel/apic/io_apic.c | 2 ++
arch/x86/kernel/hpet.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 1e35dd0..52f352b 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2117,6 +2117,7 @@ static inline void __init check_timer(void)
if (idx != -1 && irq_trigger(idx))
unmask_ioapic_irq(irq_get_chip_data(0));
}
+ irq_domain_deactivate_irq(irq_data);
irq_domain_activate_irq(irq_data);
if (timer_irq_works()) {
if (disable_timer_pin_1 > 0)
@@ -2138,6 +2139,7 @@ static inline void __init check_timer(void)
* legacy devices should be connected to IO APIC #0
*/
replace_pin_at_irq_node(data, node, apic1, pin1, apic2, pin2);
+ irq_domain_deactivate_irq(irq_data);
irq_domain_activate_irq(irq_data);
legacy_pic->unmask(0);
if (timer_irq_works()) {
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 85e87b4..dc6ba5b 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -352,6 +352,7 @@ static int hpet_resume(struct clock_event_device *evt, int timer)
} else {
struct hpet_dev *hdev = EVT_TO_HPET_DEV(evt);
+ irq_domain_deactivate_irq(irq_get_irq_data(hdev->irq));
irq_domain_activate_irq(irq_get_irq_data(hdev->irq));
disable_irq(hdev->irq);
irq_set_affinity(hdev->irq, cpumask_of(hdev->cpu));
Powered by blists - more mailing lists