From 5aaaaf9d2f2017bb477bc51be3ad0f3b54fbb358 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 20 Apr 2015 11:07:11 -0500 Subject: [PATCH] dahdi: Remove IRQF_DISABLED. The IRQF_DISABLED flag was removed in 4.1 in commit "genirq: Remove the deprecated 'IRQF_DISABLED' request_irq() flag entirely" [1]. By default all interrupt handlers are now run with interrupts disabled and therefore should all be considered "fast interrupts". Any driver that was still using the flag will now lock interrupts directly in the handler in case running on an older kernel that is not disabling interrupts when running the handler. [1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d8bf368d0631d4bc2612d8bf2e4e8e74e620d0cc Signed-off-by: Shaun Ruffell Signed-off-by: Russ Meyerriecks (cherry picked from commit 8cd0823978170cb42e2e53b647cfed4bb202c382) --- drivers/dahdi/tor2.c | 8 ++++++-- drivers/dahdi/wcb4xxp/base.c | 8 ++++++-- drivers/dahdi/wct1xxp.c | 11 +++++++---- drivers/dahdi/wcte11xp.c | 9 ++++++--- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/drivers/dahdi/tor2.c b/drivers/dahdi/tor2.c index f3d2c6f..99fb464 100644 --- a/drivers/dahdi/tor2.c +++ b/drivers/dahdi/tor2.c @@ -543,8 +543,7 @@ static int __devinit tor2_probe(struct pci_dev *pdev, const struct pci_device_id for (x = 0; x < 256; x++) writel(0x7f7f7f7f, &tor->mem32[x]); - if (request_irq(tor->irq, tor2_intr, - IRQF_SHARED | IRQF_DISABLED, "tor2", tor)) { + if (request_irq(tor->irq, tor2_intr, IRQF_SHARED, "tor2", tor)) { printk(KERN_ERR "Unable to request tormenta IRQ %d\n", tor->irq); goto err_out_release_all; } @@ -1201,6 +1200,7 @@ DAHDI_IRQ_HANDLER(tor2_intr) unsigned char c, rxc; unsigned char abits, bbits; struct tor2 *tor = (struct tor2 *) dev_id; + unsigned long flags; /* make sure its a real interrupt for us */ if (!(readb(&tor->mem8[STATREG]) & INTACTIVE)) /* if not, just return */ @@ -1208,6 +1208,8 @@ DAHDI_IRQ_HANDLER(tor2_intr) return IRQ_NONE; } + local_irq_save(flags); + if (tor->cardtype == TYPE_E1) { /* set outbit, interrupt enable, and ack interrupt */ writeb(OUTBIT | INTENA | INTACK | E1DIV | tor->master, @@ -1505,6 +1507,8 @@ DAHDI_IRQ_HANDLER(tor2_intr) else /* clear OUTBIT and enable interrupts */ writeb(INTENA | tor->master, &tor->mem8[CTLREG]); + + local_irq_restore(flags); return IRQ_RETVAL(1); } diff --git a/drivers/dahdi/wcb4xxp/base.c b/drivers/dahdi/wcb4xxp/base.c index fb0e491..d0fd08f 100644 --- a/drivers/dahdi/wcb4xxp/base.c +++ b/drivers/dahdi/wcb4xxp/base.c @@ -2572,6 +2572,7 @@ DAHDI_IRQ_HANDLER(b4xxp_interrupt) { struct b4xxp *b4 = dev_id; unsigned char status; + unsigned long flags; int i; /* Make sure it's really for us */ @@ -2585,6 +2586,8 @@ DAHDI_IRQ_HANDLER(b4xxp_interrupt) * That way if we get behind, we don't lose anything. * We don't actually do any processing here, we simply flag the bottom-half to do the heavy lifting. */ + local_irq_save(flags); + if (status & V_FR_IRQSTA) { b4->fifo_irqstatus[0] |= __pci_in8(b4, R_IRQ_FIFO_BL0); b4->fifo_irqstatus[1] |= __pci_in8(b4, R_IRQ_FIFO_BL1); @@ -2620,6 +2623,8 @@ DAHDI_IRQ_HANDLER(b4xxp_interrupt) /* tasklet_hi_schedule(&b4->b4xxp_tlet); */ b4xxp_bottom_half((unsigned long)b4); + local_irq_restore(flags); + return IRQ_RETVAL(1); } @@ -2951,8 +2956,7 @@ static int __devinit b4xx_probe(struct pci_dev *pdev, const struct pci_device_id create_sysfs_files(b4); - if (request_irq(pdev->irq, b4xxp_interrupt, - IRQF_SHARED | IRQF_DISABLED, "b4xxp", b4)) { + if (request_irq(pdev->irq, b4xxp_interrupt, IRQF_SHARED, "b4xxp", b4)) { dev_err(&b4->pdev->dev, "Unable to request IRQ %d\n", pdev->irq); ret = -EIO; diff --git a/drivers/dahdi/wct1xxp.c b/drivers/dahdi/wct1xxp.c index 86dd6b8..1d8f591 100644 --- a/drivers/dahdi/wct1xxp.c +++ b/drivers/dahdi/wct1xxp.c @@ -1174,6 +1174,8 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt) if (!ints) return IRQ_NONE; + local_irq_save(flags); + outb(ints, wc->ioaddr + WC_INTSTAT); if (!wc->intcount) { @@ -1188,13 +1190,13 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt) t1xxp_receiveprep(wc, ints); t1xxp_transmitprep(wc, ints); } - spin_lock_irqsave(&wc->lock, flags); + spin_lock(&wc->lock); #if 1 __handle_leds(wc); #endif - spin_unlock_irqrestore(&wc->lock, flags); + spin_unlock(&wc->lock); /* Count down timers */ t1xxp_do_counters(wc); @@ -1220,6 +1222,8 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt) if (ints & 0x20) printk(KERN_INFO "PCI Target abort\n"); + local_irq_restore(flags); + return IRQ_RETVAL(1); } @@ -1333,8 +1337,7 @@ static int __devinit t1xxp_init_one(struct pci_dev *pdev, const struct pci_devic /* Keep track of which device we are */ pci_set_drvdata(pdev, wc); - if (request_irq(pdev->irq, t1xxp_interrupt, - IRQF_SHARED | IRQF_DISABLED, "t1xxp", wc)) { + if (request_irq(pdev->irq, t1xxp_interrupt, IRQF_SHARED, "t1xxp", wc)) { printk(KERN_NOTICE "t1xxp: Unable to request IRQ %d\n", pdev->irq); kfree(wc); return -EIO; diff --git a/drivers/dahdi/wcte11xp.c b/drivers/dahdi/wcte11xp.c index 8c4ab6e..044787f 100644 --- a/drivers/dahdi/wcte11xp.c +++ b/drivers/dahdi/wcte11xp.c @@ -1351,6 +1351,8 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt) if (!ints) return IRQ_NONE; + local_irq_save(flags); + outb(ints, wc->ioaddr + WC_INTSTAT); if (!wc->intcount) { @@ -1365,13 +1367,13 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt) t1xxp_receiveprep(wc, ints); t1xxp_transmitprep(wc, ints); } - spin_lock_irqsave(&wc->lock, flags); + spin_lock(&wc->lock); #if 1 __handle_leds(wc); #endif - spin_unlock_irqrestore(&wc->lock, flags); + spin_unlock(&wc->lock); /* Count down timers */ t1_do_counters(wc); @@ -1398,6 +1400,7 @@ DAHDI_IRQ_HANDLER(t1xxp_interrupt) if (ints & 0x20) printk(KERN_NOTICE "PCI Target abort\n"); + local_irq_restore(flags); return IRQ_RETVAL(1); } @@ -1535,7 +1538,7 @@ static int __devinit t1xxp_init_one(struct pci_dev *pdev, const struct pci_devic pci_set_drvdata(pdev, wc); if (request_irq(pdev->irq, t1xxp_interrupt, - IRQF_SHARED | IRQF_DISABLED, "wcte11xp", wc)) { + IRQF_SHARED, "wcte11xp", wc)) { printk(KERN_NOTICE "wcte11xp: Unable to request IRQ %d\n", pdev->irq); kfree(wc); return -EIO;