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
509static u_int __init test_irq(u_short sock, int irq)509static u_int __init test_irq(u_short sock, int irq)
510{510{
511 debug(2, " testing ISA irq %d\n", irq);511 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)
513 return 1;514 return 1;
514 irq_hits = 0; irq_sock = sock;515 irq_hits = 0; irq_sock = sock;
515 msleep(10);516 msleep(10);
@@ -561,7 +562,7 @@ static u_int __init isa_scan(u_short sock, u_int mask0) · 45 unmodified lines
561 } else {562 } else {
562 /* Fallback: just find interrupts that aren't in use */563 /* Fallback: just find interrupts that aren't in use */
563 for (i = 0; i < 16; i++)564 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))
565 mask1 |= (1 << i);566 mask1 |= (1 << i);
566 printk("default");567 printk("default");
567 /* If scan failed, default to polled status */568 /* If scan failed, default to polled status */
@@ -725,7 +726,7 @@ static void __init add_pcic(int ns, int type) · 157 unmodified lines
725 u_int cs_mask = mask & ((cs_irq) ? (1<<cs_irq) : ~(1<<12));726 u_int cs_mask = mask & ((cs_irq) ? (1<<cs_irq) : ~(1<<12));
726 for (cs_irq = 15; cs_irq > 0; cs_irq--)727 for (cs_irq = 15; cs_irq > 0; cs_irq--)
727 if ((cs_mask & (1 << cs_irq)) &&728 if ((cs_mask & (1 << cs_irq)) &&
728 (_check_irq(cs_irq, 0) == 0))729 (_check_irq(cs_irq, SA_PROBEIRQ) == 0))
729 break;730 break;
730 if (cs_irq) {731 if (cs_irq) {
731 grab_irq = 1;732 grab_irq = 1;
include/asm-xtensa/signal.h+1−1
@@ -118,9 +118,9 @@ typedef struct { · 117 unmodified lines
118 * SA_INTERRUPT is also used by the irq handling routines.118 * SA_INTERRUPT is also used by the irq handling routines.
119 * SA_SHIRQ is for shared interrupt support on PCI and EISA.119 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
120 */120 */
121#define SA_PROBE SA_ONESHOT
122#define SA_SAMPLE_RANDOM SA_RESTART121#define SA_SAMPLE_RANDOM SA_RESTART
123#define SA_SHIRQ 0x04000000122#define SA_SHIRQ 0x04000000
123#define SA_PROBEIRQ 0x08000000
124#endif124#endif
125 125
126#define SIG_BLOCK 0 /* for blocking signals */126#define SIG_BLOCK 0 /* for blocking signals */
include/linux/signal.h+3−1
@@ -14,10 +14,12 @@ · 13 unmodified lines
14 *14 *
15 * SA_INTERRUPT is also used by the irq handling routines.15 * SA_INTERRUPT is also used by the irq handling routines.
16 * SA_SHIRQ is for shared interrupt support on PCI and EISA.16 * 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
17 */18 */
18#define SA_PROBE SA_ONESHOT
19#define SA_SAMPLE_RANDOM SA_RESTART19#define SA_SAMPLE_RANDOM SA_RESTART
20#define SA_SHIRQ 0x0400000020#define SA_SHIRQ 0x04000000
21#define SA_PROBEIRQ 0x08000000
22
21/*23/*
22 * As above, these correspond to the IORESOURCE_IRQ_* defines in24 * As above, these correspond to the IORESOURCE_IRQ_* defines in
23 * linux/ioport.h to select the interrupt line behaviour. When25 * 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
246 246
247mismatch:247mismatch:
248 spin_unlock_irqrestore(&desc->lock, flags);248 spin_unlock_irqrestore(&desc->lock, flags);
249 printk(KERN_ERR "%s: irq handler mismatch\n", __FUNCTION__);249 if (!(new->flags & SA_PROBEIRQ)) {
250 dump_stack();250 printk(KERN_ERR "%s: irq handler mismatch\n", __FUNCTION__);
251 dump_stack();
252 }
251 return -EBUSY;253 return -EBUSY;
252}254}
253 255