Patch "irqdomain: Avoid activating interrupts more than once" has been added to the 4.9-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
irqdomain: Avoid activating interrupts more than once
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
irqdomain-avoid-activating-interrupts-more-than-once.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
08d85f3ea99f1eeafc4e8507936190e86a16ee8cMon Sep 17 00:00:00 2001
From: Marc Zyngier <[email protected]>
Date: Tue, 17 Jan 2017 16:00:48 +0000
Subject: irqdomain: Avoid activating interrupts more than once
From: Marc Zyngier <[email protected]>
commit 08d85f3ea99f1eeafc4e8507936190e86a16ee8c upstream.
Since commit f3b0946d629c ("genirq/msi: Make sure PCI MSIs are activated early"), we can end-up activating a PCI/MSI twice (once at allocation time, and once at startup time).
This is normally of no consequences, except that there is some HW out there that may misbehave if activate is used more than once (the GICv3 ITS, for example, uses the activate callback to issue the MAPVI command, and the architecture spec says that "If there is an existing mapping for the EventID-DeviceID combination, behavior is UNPREDICTABLE").
While this could be worked around in each individual driver, it may make more sense to tackle the issue at the core level. In order to avoid getting in that situation, let's have a per-interrupt flag to remember if we have already activated that interrupt or not.
--- include/linux/irq.h | 17 +++++++++++++++++ kernel/irq/irqdomain.c | 44 ++++++++++++++++++++++++++++++-------------- 2 files changed, 47 insertions(+), 14 deletions(-)
include/linux/irq.h +17 -0
@@ -184,6 +184,7 @@ struct irq_data {* * IRQD_TRIGGER_MASK - Mask for the trigger type bits * IRQD_SETAFFINITY_PENDING - Affinity setting is pending +* IRQD_ACTIVATED - Interrupt has already been activated * IRQD_NO_BALANCING - Balancing disabled for this IRQ * IRQD_PER_CPU - Interrupt is per cpu * IRQD_AFFINITY_SET - Interrupt affinity was set
@@ -202,6 +203,7 @@ struct irq_data {enum {IRQD_TRIGGER_MASK =0xf ,IRQD_SETAFFINITY_PENDING = (1 <<8 ), +IRQD_ACTIVATED = (1 <<9 ),IRQD_NO_BALANCING = (1 <<10 ),IRQD_PER_CPU = (1 <<11 ),IRQD_AFFINITY_SET = (1 <<12 ),
@@ -312,6 +314,21 @@ static inline bool irqd_affinity_is_manareturn __irqd_to_state (d) &IRQD_AFFINITY_MANAGED ; } +static inline bool irqd_is_activated (struct irq_data *d) +{ +return __irqd_to_state (d) &IRQD_ACTIVATED ; +} + +static inline void irqd_set_activated (struct irq_data *d) +{ +__irqd_to_state (d) |=IRQD_ACTIVATED ; +} + +static inline void irqd_clr_activated (struct irq_data *d) +{ +__irqd_to_state (d) &= ~IRQD_ACTIVATED ; +} +#undef __irqd_to_statestatic inline irq_hw_number_t irqd_to_hwirq (struct irq_data *d)
kernel/irq/irqdomain.c +30 -14
62 lines not on this page · raw message
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/irqdomain-avoid-activating-interrupts-more-than-once.patch queue-4.9/x86-irq-make-irq-activate-operations-symmetric.patch queue-4.9/revert-vring-force-use-of-dma-api-for-arm-based-systems-with-legacy-devices.patch