Re: recommended use of request_any_context_irq()

From: Thomas Gleixner
Date: Thu Sep 22 2016 - 18:06:07 EST


Leo,

On Thu, 22 Sep 2016, Leo Li wrote:
> core code. And my concerns is that there are other drivers can hit
> the same problem if connected to the threaded interrupt controller.
> What can we do prevent similar problem in the future?

The simplest way is to be more informative in the failure case. See patch
below.

Converting drivers is surely something which can be done, but I wouldn't
try to do a wholesale conversion blindly.

Thanks,

tglx

8<----------------

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 73a2b786b5e9..605915f689b4 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1146,6 +1146,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
nested = irq_settings_is_nested_thread(desc);
if (nested) {
if (!new->thread_fn) {
+ pr_warn("IRQ%u is nested, but thread_fn is NULL\n", irq);
ret = -EINVAL;
goto out_mput;
}
@@ -1158,8 +1159,10 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
} else {
if (irq_settings_can_thread(desc)) {
ret = irq_setup_forced_threading(new);
- if (ret)
+ if (ret) {
+ pr_warn("IRQ%u failed to setup thread\n", irq);
goto out_mput;
+ }
}
}