History

[PATCH] request_irq(): remove warnings from irq probing

- Add new SA_PROBEIRQ which suppresses the new sharing-mismatch warning. Some drivers like to use request_irq() to find an unused interrupt slot. - Use it in i82365.c - Kill unused SA_PROBE.

Andrew Morton committed 20 years ago

Commit 13e87ec1 parent 47bb7894 files · +12 −7Browse files

Unified · Split

4 files
  1. drivers/pcmcia/i82365.c +4 −3
  2. include/asm-xtensa/signal.h +1 −1
  3. include/linux/signal.h +3 −1
  4. kernel/irq/manage.c +4 −2
drivers/pcmcia/i82365.c+4−3
@@ -509,7 +509,8 @@ static irqreturn_t i365_count_irq(int irq, void *dev, struct pt_regs *regs) · 508 unmodified lines
509509 static u_int __init test_irq(u_short sock, int irq)
510510 {
511511 debug(2, " testing ISA irq %d\n", irq);
512− if (request_irq(irq, i365_count_irq, 0, "scan", i365_count_irq) != 0)
512+ if (request_irq(irq, i365_count_irq, SA_PROBEIRQ, "scan",
513+ i365_count_irq) != 0)
513514 return 1;
514515 irq_hits = 0; irq_sock = sock;
515516 msleep(10);
@@ -561,7 +562,7 @@ static u_int __init isa_scan(u_short sock, u_int mask0) · 45 unmodified lines
561562 } else {
562563 /* Fallback: just find interrupts that aren't in use */
563564 for (i = 0; i < 16; i++)
564− if ((mask0 & (1 << i)) && (_check_irq(i, 0) == 0))
565+ if ((mask0 & (1 << i)) && (_check_irq(i, SA_PROBEIRQ) == 0))
565566 mask1 |= (1 << i);
566567 printk("default");
567568 /* If scan failed, default to polled status */
@@ -725,7 +726,7 @@ static void __init add_pcic(int ns, int type) · 157 unmodified lines
725726 u_int cs_mask = mask & ((cs_irq) ? (1<<cs_irq) : ~(1<<12));
726727 for (cs_irq = 15; cs_irq > 0; cs_irq--)
727728 if ((cs_mask & (1 << cs_irq)) &&
728− (_check_irq(cs_irq, 0) == 0))
729+ (_check_irq(cs_irq, SA_PROBEIRQ) == 0))
729730 break;
730731 if (cs_irq) {
731732 grab_irq = 1;
include/asm-xtensa/signal.h+1−1
@@ -118,9 +118,9 @@ typedef struct { · 117 unmodified lines
118118 * SA_INTERRUPT is also used by the irq handling routines.
119119 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
120120 */
121−#define SA_PROBE SA_ONESHOT
122121 #define SA_SAMPLE_RANDOM SA_RESTART
123122 #define SA_SHIRQ 0x04000000
123+#define SA_PROBEIRQ 0x08000000
124124 #endif
125125
126126 #define SIG_BLOCK 0 /* for blocking signals */
include/linux/signal.h+3−1
@@ -14,10 +14,12 @@ · 13 unmodified lines
1414 *
1515 * SA_INTERRUPT is also used by the irq handling routines.
1616 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
17+ * SA_PROBEIRQ is set by callers when they expect sharing mismatches to occur
1718 */
18−#define SA_PROBE SA_ONESHOT
1919 #define SA_SAMPLE_RANDOM SA_RESTART
2020 #define SA_SHIRQ 0x04000000
21+#define SA_PROBEIRQ 0x08000000
22+
2123 /*
2224 * As above, these correspond to the IORESOURCE_IRQ_* defines in
2325 * linux/ioport.h to select the interrupt line behaviour. When
kernel/irq/manage.c+4−2
@@ -246,8 +246,10 @@ int setup_irq(unsigned int irq, struct irqaction * new) · 245 unmodified lines
246246
247247 mismatch:
248248 spin_unlock_irqrestore(&desc->lock, flags);
249− printk(KERN_ERR "%s: irq handler mismatch\n", __FUNCTION__);
250− dump_stack();
249+ if (!(new->flags & SA_PROBEIRQ)) {
250+ printk(KERN_ERR "%s: irq handler mismatch\n", __FUNCTION__);
251+ dump_stack();
252+ }
251253 return -EBUSY;
252254 }
253255