aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-04-19 06:06:13 -0400
committerThomas Gleixner <tglx@linutronix.de>2012-04-19 07:56:56 -0400
commitf5d89470f91f2e67eeaf350c730ae8412c3a98e3 (patch)
tree35bbf5454abb7ce936613c976ab6834f3a3fcf57 /kernel/irq/manage.c
parent1c6c69525b40eb76de8adf039409722015927dc3 (diff)
genirq: Be more informative on irq type mismatch
We require that shared interrupts agree on a few flag settings. Right now we silently return with an error code without giving any hint why we reject it. Make the printout unconditionally and actually useful by printing the flags of the new and the already registered action. Convert all printks to pr_* and use a proper prefix while at it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 9a35ace38bb1..585f6381f8e4 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -565,8 +565,8 @@ int __irq_set_trigger(struct irq_desc *desc, unsigned int irq,
565 * IRQF_TRIGGER_* but the PIC does not support multiple 565 * IRQF_TRIGGER_* but the PIC does not support multiple
566 * flow-types? 566 * flow-types?
567 */ 567 */
568 pr_debug("No set_type function for IRQ %d (%s)\n", irq, 568 pr_debug("genirq: No set_type function for IRQ %d (%s)\n", irq,
569 chip ? (chip->name ? : "unknown") : "unknown"); 569 chip ? (chip->name ? : "unknown") : "unknown");
570 return 0; 570 return 0;
571 } 571 }
572 572
@@ -600,7 +600,7 @@ int __irq_set_trigger(struct irq_desc *desc, unsigned int irq,
600 ret = 0; 600 ret = 0;
601 break; 601 break;
602 default: 602 default:
603 pr_err("setting trigger mode %lu for irq %u failed (%pF)\n", 603 pr_err("genirq: Setting trigger mode %lu for irq %u failed (%pF)\n",
604 flags, irq, chip->irq_set_type); 604 flags, irq, chip->irq_set_type);
605 } 605 }
606 if (unmask) 606 if (unmask)
@@ -837,8 +837,7 @@ void exit_irq_thread(void)
837 837
838 action = kthread_data(tsk); 838 action = kthread_data(tsk);
839 839
840 printk(KERN_ERR 840 pr_err("genirq: exiting task \"%s\" (%d) is an active IRQ thread (irq %d)\n",
841 "exiting task \"%s\" (%d) is an active IRQ thread (irq %d)\n",
842 tsk->comm ? tsk->comm : "", tsk->pid, action->irq); 841 tsk->comm ? tsk->comm : "", tsk->pid, action->irq);
843 842
844 desc = irq_to_desc(action->irq); 843 desc = irq_to_desc(action->irq);
@@ -878,7 +877,6 @@ static int
878__setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) 877__setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
879{ 878{
880 struct irqaction *old, **old_ptr; 879 struct irqaction *old, **old_ptr;
881 const char *old_name = NULL;
882 unsigned long flags, thread_mask = 0; 880 unsigned long flags, thread_mask = 0;
883 int ret, nested, shared = 0; 881 int ret, nested, shared = 0;
884 cpumask_var_t mask; 882 cpumask_var_t mask;
@@ -972,10 +970,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
972 */ 970 */
973 if (!((old->flags & new->flags) & IRQF_SHARED) || 971 if (!((old->flags & new->flags) & IRQF_SHARED) ||
974 ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK) || 972 ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK) ||
975 ((old->flags ^ new->flags) & IRQF_ONESHOT)) { 973 ((old->flags ^ new->flags) & IRQF_ONESHOT))
976 old_name = old->name;
977 goto mismatch; 974 goto mismatch;
978 }
979 975
980 /* All handlers must agree on per-cpuness */ 976 /* All handlers must agree on per-cpuness */
981 if ((old->flags & IRQF_PERCPU) != 977 if ((old->flags & IRQF_PERCPU) !=
@@ -1099,7 +1095,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
1099 1095
1100 if (nmsk != omsk) 1096 if (nmsk != omsk)
1101 /* hope the handler works with current trigger mode */ 1097 /* hope the handler works with current trigger mode */
1102 pr_warning("IRQ %d uses trigger mode %u; requested %u\n", 1098 pr_warning("genirq: irq %d uses trigger mode %u; requested %u\n",
1103 irq, nmsk, omsk); 1099 irq, nmsk, omsk);
1104 } 1100 }
1105 1101
@@ -1136,14 +1132,13 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
1136 return 0; 1132 return 0;
1137 1133
1138mismatch: 1134mismatch:
1139#ifdef CONFIG_DEBUG_SHIRQ
1140 if (!(new->flags & IRQF_PROBE_SHARED)) { 1135 if (!(new->flags & IRQF_PROBE_SHARED)) {
1141 printk(KERN_ERR "IRQ handler type mismatch for IRQ %d\n", irq); 1136 pr_err("genirq: Flags mismatch irq %d. %08x (%s) vs. %08x (%s)\n",
1142 if (old_name) 1137 irq, new->flags, new->name, old->flags, old->name);
1143 printk(KERN_ERR "current handler: %s\n", old_name); 1138#ifdef CONFIG_DEBUG_SHIRQ
1144 dump_stack(); 1139 dump_stack();
1145 }
1146#endif 1140#endif
1141 }
1147 ret = -EBUSY; 1142 ret = -EBUSY;
1148 1143
1149out_mask: 1144out_mask: