irq: Warn when shared interrupts do not match on NO_SUSPEND
PATCH 1/1 irq: Warn when shared interrupts do not match on NO_SUSPEND
Subject: irq: Warn when shared interrupts do not match on NO_SUSPEND
When suspend_device_irqs() iterates all descriptors, its pointless if one has NO_SUSPEND set while another has not.
Validate on request_irq() that NO_SUSPEND state maches for SHARED interrupts.
--- kernel/irq/manage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
kernel/irq/manage.c +5 -2
@@ -1077,9 +1077,12 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)* set the trigger type must match. Also all must * agree on ONESHOT. */ + +#define IRQF_MISMATCH \ + (IRQF_TRIGGER_MASK | IRQF_ONESHOT | IRQF_NO_SUSPEND) +if (!((old->flags & new->flags) &IRQF_SHARED ) || - ((old->flags ^ new->flags) &IRQF_TRIGGER_MASK ) || - ((old->flags ^ new->flags) &IRQF_ONESHOT )) + ((old->flags ^ new->flags) &IRQF_MISMATCH )) goto mismatch;/* All handlers must agree on per-cpuness */
Quoted 7 lines · Peter Zijlstra
Subject: irq: Warn when shared interrupts do not match on
NO_SUSPENDWhen
suspend_device_irqs()iterates all descriptors, its pointless if one hasNO_SUSPENDset while another has not.Validate on
request_irq()thatNO_SUSPENDstate maches for SHARED interrupts.
I'm happy to take that patch, but you are aware that it is going to break a few things?
25: .... PCI-MSI-edge aerdrv, PCIe PME
Thanks,
tglx
Quoted 27 lines
Cc "Rafael J. Wysocki" <[email protected]>Cc Thomas Gleixner <[email protected]>Signed-off-by Peter Zijlstra <[email protected]>--- kernel/irq/manage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)kernel/irq/manage.c +5
-2@@ -1077,9 +1077,12 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)* set the trigger type must match. Also all must * agree on ONESHOT. */ + +#define IRQF_MISMATCH \ + (IRQF_TRIGGER_MASK | IRQF_ONESHOT | IRQF_NO_SUSPEND) +if (!((old->flags & new->flags) &IRQF_SHARED ) || - ((old->flags ^ new->flags) &IRQF_TRIGGER_MASK ) || - ((old->flags ^ new->flags) &IRQF_ONESHOT )) + ((old->flags ^ new->flags) &IRQF_MISMATCH )) goto mismatch;/* All handlers must agree on per-cpuness */
Quoted 7 lines · Thomas Gleixner
Quoted 5 lines · Peter Zijlstra
Subject: irq: Warn when shared interrupts do not match on
NO_SUSPENDWhen
suspend_device_irqs()iterates all descriptors, its pointless if one hasNO_SUSPENDset while another has not.
Quoted 7 lines
Quoted 2 lines
Validate on
request_irq()thatNO_SUSPENDstate maches for SHARED interrupts.I'm happy to take that patch, but you are aware that it is going to break a few things?
25: .... PCI-MSI-edge aerdrv, PCIe PME
Better an obvious splat than non obvious misbehaviour in my book.
Quoted 11 lines · Peter Zijlstra
Quoted 10 lines · Thomas Gleixner
Quoted 7 lines · Peter Zijlstra
Subject: irq: Warn when shared interrupts do not match on
NO_SUSPENDWhen
suspend_device_irqs()iterates all descriptors, its pointless if one hasNO_SUSPENDset while another has not.Validate on
request_irq()thatNO_SUSPENDstate maches for SHARED interrupts.
Quoted 6 lines
Quoted 4 lines
I'm happy to take that patch, but you are aware that it is going to break a few things?
25: .... PCI-MSI-edge aerdrv, PCIe PME
Better an obvious splat than non obvious misbehaviour in my book.
And it will only break things that are already broken.
ACK for the patch.
Rafael
tip-bot for Peter Zijlstra
merge botirq: Warn when shared interrupts do not match on NO_SUSPEND
Commit-ID: 4fae4e7624653ef498d0e2a38f00620b9701ab04 Gitweb: http://git.kernel.org/tip/4fae4e7624653ef498d0e2a38f00620b9701ab04 Author: Peter Zijlstra <[email protected]> AuthorDate: Thu, 24 Jul 2014 15:39:21 +0200 Committer: Thomas Gleixner <[email protected]> CommitDate: Thu, 24 Jul 2014 17:32:56 +0200
irq: Warn when shared interrupts do not match on NO_SUSPEND
When suspend_device_irqs() iterates all descriptors, its pointless if one has NO_SUSPEND set while another has not.
Validate on request_irq() that NO_SUSPEND state maches for SHARED interrupts.
--- kernel/irq/manage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
kernel/irq/manage.c +5 -2
@@ -1077,9 +1077,12 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)* set the trigger type must match. Also all must * agree on ONESHOT. */ + +#define IRQF_MISMATCH \ + (IRQF_TRIGGER_MASK | IRQF_ONESHOT | IRQF_NO_SUSPEND) +if (!((old->flags & new->flags) &IRQF_SHARED ) || - ((old->flags ^ new->flags) &IRQF_TRIGGER_MASK ) || - ((old->flags ^ new->flags) &IRQF_ONESHOT )) + ((old->flags ^ new->flags) &IRQF_MISMATCH )) goto mismatch;/* All handlers must agree on per-cpuness */
Hi Thomas,
Quoted 8 lines · tip-bot for Peter Zijlstra
Commit-ID: 4fae4e7624653ef498d0e2a38f00620b9701ab04 Gitweb: http://git.kernel.org/tip/4fae4e7624653ef498d0e2a38f00620b9701ab04 Author: Peter Zijlstra <[email protected]> AuthorDate: Thu, 24 Jul 2014 15:39:21 +0200 Committer: Thomas Gleixner <[email protected]> CommitDate: Thu, 24 Jul 2014 17:32:56 +0200irq: Warn when shared interrupts do not match on
NO_SUSPEND
Please revert this one as it is likely to break existing stuff (I'm mostly worried about the ACPI interrupt, but also about a number of drivers that have been using NO_SUSPEND along with SHARED for quite some time).
Rafael