irq: Set IRQF_COND_ONESHOT in request_irq()
PATCH 1/1 irq: Set IRQF_COND_ONESHOT in request_irq()
From: Rafael J. Wysocki <[email protected]>
The callers of request_irq() don't care about IRQF_ONESHOT because they don't provide threaded handlers, but if they happen to share the IRQ with the ACPI SCI, which has a threaded handler and sets IRQF_ONESHOT, request_irq() will fail for them due to a flags mismatch.
Address this by making request_irq() add IRQF_COND_ONESHOT to the flags passed to request_threaded_irq() for all of its callers.
--- include/linux/interrupt.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/interrupt.h +2 -1
@@ -168,7 +168,8 @@ static inline int __must_check request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, const char *name, void *dev) { - return request_threaded_irq(irq, handler, NULL, flags, name, dev); + return request_threaded_irq(irq, handler, NULL, + flags | IRQF_COND_ONESHOT, name, dev); } extern int __must_check
Quoted 9 lines · Rafael J. Wysocki
From: Rafael J. Wysocki <[email protected]>
The callers of
request_irq()don't care aboutIRQF_ONESHOTbecause they don't provide threaded handlers, but if they happen to share the IRQ with the ACPI SCI, which has a threaded handler and setsIRQF_ONESHOT,request_irq()will fail for them due to a flags mismatch.Address this by making
request_irq()addIRQF_COND_ONESHOTto the flags passed torequest_threaded_irq()for all of its callers.
In principle that should work. We'll see whether there are dragons lurking :)
Thanks,
tglx
[tip: irq/core] genirq: Set IRQF_COND_ONESHOT in request_irq()
In reply to Rafael J. WysockiThe following commit has been merged into the irq/core branch of tip:
The following commit has been merged into the irq/core branch of tip:
Commit-ID: 513fbe762f644872cc2ff47407cbc24422a33fb5 Gitweb: https://git.kernel.org/tip/513fbe762f644872cc2ff47407cbc24422a33fb5 Author: Rafael J. Wysocki <[email protected]> AuthorDate: Thu, 11 Jul 2024 12:20:04 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Thu, 11 Jul 2024 22:59:33 +02:00
genirq: Set IRQF_COND_ONESHOT in request_irq()
The callers of request_irq() don't care about IRQF_ONESHOT because they don't provide threaded handlers, but if they happen to share the IRQ with the ACPI SCI, which has a threaded handler and sets IRQF_ONESHOT, request_irq() will fail for them due to a flags mismatch.
Address this by making request_irq() add IRQF_COND_ONESHOT to the flags passed to request_threaded_irq() for all of its callers.
--- include/linux/interrupt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/interrupt.h +1 -1
@@ -168,7 +168,7 @@ static inline int __must_check request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, const char *name, void *dev) { - return request_threaded_irq(irq, handler, NULL, flags, name, dev); + return request_threaded_irq(irq, handler, NULL, flags | IRQF_COND_ONESHOT, name, dev); } extern int __must_check
[tip: irq/core] genirq: Set IRQF_COND_ONESHOT in request_irq()
In reply to Rafael J. WysockiThe following commit has been merged into the irq/core branch of tip:
The following commit has been merged into the irq/core branch of tip:
Commit-ID: c37927a203fa283950f6045602b9f71328ad786c Gitweb: https://git.kernel.org/tip/c37927a203fa283950f6045602b9f71328ad786c Author: Rafael J. Wysocki <[email protected]> AuthorDate: Thu, 11 Jul 2024 12:20:04 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Mon, 15 Jul 2024 15:13:56 +02:00
genirq: Set IRQF_COND_ONESHOT in request_irq()
The callers of request_irq() don't care about IRQF_ONESHOT because they don't provide threaded handlers, but if they happen to share the IRQ with the ACPI SCI, which has a threaded handler and sets IRQF_ONESHOT, request_irq() will fail for them due to a flags mismatch.
Address this by making request_irq() add IRQF_COND_ONESHOT to the flags passed to request_threaded_irq() for all of its callers.
--- include/linux/interrupt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/interrupt.h +1 -1
@@ -168,7 +168,7 @@ static inline int __must_check request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, const char *name, void *dev) { - return request_threaded_irq(irq, handler, NULL, flags, name, dev); + return request_threaded_irq(irq, handler, NULL, flags | IRQF_COND_ONESHOT, name, dev); } extern int __must_check