Skip to content

Commit 1ccc819

Browse files
Alexandre Bouninetorvalds
authored andcommitted
rapidio/tsi721: fix bug in MSI interrupt handling
Fix bug in MSI interrupt handling which causes loss of event notifications. Typical indication of lost MSI interrupts are stalled message and doorbell transfers between RapidIO endpoints. To avoid loss of MSI interrupts all interrupts from the device must be disabled on entering the interrupt handler routine and re-enabled when exiting it. Re-enabling device interrupts will trigger new MSI message(s) if Tsi721 registered new events since entering interrupt handler routine. This patch is applicable to kernel versions starting from v3.2. Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Cc: Matt Porter <mporter@kernel.crashing.org> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent fb09c37 commit 1ccc819

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎drivers/rapidio/devices/tsi721.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,10 @@ static irqreturn_t tsi721_irqhandler(int irq, void *ptr)
471471
u32 intval;
472472
u32 ch_inte;
473473

474+
/* For MSI mode disable all device-level interrupts */
475+
if (priv->flags & TSI721_USING_MSI)
476+
iowrite32(0, priv->regs + TSI721_DEV_INTE);
477+
474478
dev_int = ioread32(priv->regs + TSI721_DEV_INT);
475479
if (!dev_int)
476480
return IRQ_NONE;
@@ -560,6 +564,14 @@ static irqreturn_t tsi721_irqhandler(int irq, void *ptr)
560564
}
561565
}
562566
#endif
567+
568+
/* For MSI mode re-enable device-level interrupts */
569+
if (priv->flags & TSI721_USING_MSI) {
570+
dev_int = TSI721_DEV_INT_SR2PC_CH | TSI721_DEV_INT_SRIO |
571+
TSI721_DEV_INT_SMSG_CH | TSI721_DEV_INT_BDMA_CH;
572+
iowrite32(dev_int, priv->regs + TSI721_DEV_INTE);
573+
}
574+
563575
return IRQ_HANDLED;
564576
}
565577

0 commit comments

Comments
 (0)