Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: hsu: disable spurious interrupt

On Intel Tangier B0 and Anniedale the interrupt line, disregarding
to have different numbers, is shared between HSU DMA and UART IPs.
Thus on such SoCs we are expecting that IRQ handler is called in
UART driver only. hsu_pci_irq was handling the spurious interrupt
from HSU DMA by returning immediately. This wastes CPU time and
since HSU DMA and HSU UART interrupt occur simultaneously they race
to be handled causing delay to the HSU UART interrupt handling.
Fix this by disabling the interrupt entirely.

Fixes: 4831e0d9054c ("serial: 8250_mid: handle interrupt correctly in DMA case")
Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210112223749.97036-1-ftoth@exalondelft.nl
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Ferry Toth and committed by
Vinod Koul
035b73b2 747ee57b

+11 -10
+11 -10
drivers/dma/hsu/pci.c
··· 26 26 static irqreturn_t hsu_pci_irq(int irq, void *dev) 27 27 { 28 28 struct hsu_dma_chip *chip = dev; 29 - struct pci_dev *pdev = to_pci_dev(chip->dev); 30 29 u32 dmaisr; 31 30 u32 status; 32 31 unsigned short i; 33 32 int ret = 0; 34 33 int err; 35 - 36 - /* 37 - * On Intel Tangier B0 and Anniedale the interrupt line, disregarding 38 - * to have different numbers, is shared between HSU DMA and UART IPs. 39 - * Thus on such SoCs we are expecting that IRQ handler is called in 40 - * UART driver only. 41 - */ 42 - if (pdev->device == PCI_DEVICE_ID_INTEL_MRFLD_HSU_DMA) 43 - return IRQ_HANDLED; 44 34 45 35 dmaisr = readl(chip->regs + HSU_PCI_DMAISR); 46 36 for (i = 0; i < chip->hsu->nr_channels; i++) { ··· 94 104 ret = request_irq(chip->irq, hsu_pci_irq, 0, "hsu_dma_pci", chip); 95 105 if (ret) 96 106 goto err_register_irq; 107 + 108 + /* 109 + * On Intel Tangier B0 and Anniedale the interrupt line, disregarding 110 + * to have different numbers, is shared between HSU DMA and UART IPs. 111 + * Thus on such SoCs we are expecting that IRQ handler is called in 112 + * UART driver only. Instead of handling the spurious interrupt 113 + * from HSU DMA here and waste CPU time and delay HSU UART interrupt 114 + * handling, disable the interrupt entirely. 115 + */ 116 + if (pdev->device == PCI_DEVICE_ID_INTEL_MRFLD_HSU_DMA) 117 + disable_irq_nosync(chip->irq); 97 118 98 119 pci_set_drvdata(pdev, chip); 99 120