From fa86c13c3bba969ae4d91d4381b46cad51817695 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Thu, 22 Mar 2012 18:36:10 +0000 Subject: [PATCH] wct4xxp: Disable all interrupts explicitly in interrupt handler. The driver makes the assumption that interrupts are disabled but this cannot be guaranteed. We'll explicity disable interrupts on the local processor while the interrupt handler is running. This eliminates the "IRQF_DISABLED is not guaranteed on shared IRQs" warning when loading the driver. Signed-off-by: Shaun Ruffell Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10589 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10593 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/wct4xxp/base.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c index 8791687..fc6f5c4 100644 --- a/drivers/dahdi/wct4xxp/base.c +++ b/drivers/dahdi/wct4xxp/base.c @@ -3784,7 +3784,7 @@ static inline void t4_framer_interrupt(struct t4 *wc, int span) } #ifdef SUPPORT_GEN1 -DAHDI_IRQ_HANDLER(t4_interrupt) +static irqreturn_t _t4_interrupt(int irq, void *dev_id) { struct t4 *wc = dev_id; unsigned long flags; @@ -3852,6 +3852,16 @@ DAHDI_IRQ_HANDLER(t4_interrupt) return IRQ_RETVAL(1); } + +DAHDI_IRQ_HANDLER(t4_interrupt) +{ + irqreturn_t ret; + unsigned long flags; + local_irq_save(flags); + ret = _t4_interrupt(irq, dev_id); + local_irq_restore(flags); + return ret; +} #endif static int t4_allocate_buffers(struct t4 *wc, int numbufs, @@ -3969,7 +3979,7 @@ static void t4_isr_bh(unsigned long data) #endif } -DAHDI_IRQ_HANDLER(t4_interrupt_gen2) +static irqreturn_t _t4_interrupt_gen2(int irq, void *dev_id) { struct t4 *wc = dev_id; unsigned int status; @@ -4165,6 +4175,16 @@ out: return IRQ_RETVAL(1); } +DAHDI_IRQ_HANDLER(t4_interrupt_gen2) +{ + irqreturn_t ret; + unsigned long flags; + local_irq_save(flags); + ret = _t4_interrupt_gen2(irq, dev_id); + local_irq_restore(flags); + return ret; +} + #ifdef SUPPORT_GEN1 static int t4_reset_dma(struct t4 *wc) { @@ -5212,7 +5232,7 @@ t4_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) #ifdef SUPPORT_GEN1 if (request_irq(pdev->irq, (wc->devtype->flags & FLAG_2NDGEN) ? t4_interrupt_gen2 : t4_interrupt, - DAHDI_IRQ_SHARED_DISABLED, + DAHDI_IRQ_SHARED, (wc->numspans == 8) ? "wct8xxp" : (wc->numspans == 2) ? "wct2xxp" : "wct4xxp", @@ -5224,7 +5244,7 @@ t4_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) free_wc(wc); return -ENODEV; } - if (request_irq(pdev->irq, t4_interrupt_gen2, DAHDI_IRQ_SHARED_DISABLED, "t4xxp", wc)) + if (request_irq(pdev->irq, t4_interrupt_gen2, DAHDI_IRQ_SHARED, "t4xxp", wc)) #endif { dev_notice(&wc->dev->dev, "t4xxp: Unable to request IRQ %d\n",