Commit 035b73b2 authored by Ferry Toth's avatar Ferry Toth Committed by Vinod Koul

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: 4831e0d9 ("serial: 8250_mid: handle interrupt correctly in DMA case")
Signed-off-by: default avatarFerry Toth <ftoth@exalondelft.nl>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210112223749.97036-1-ftoth@exalondelft.nlSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 747ee57b
...@@ -26,22 +26,12 @@ ...@@ -26,22 +26,12 @@
static irqreturn_t hsu_pci_irq(int irq, void *dev) static irqreturn_t hsu_pci_irq(int irq, void *dev)
{ {
struct hsu_dma_chip *chip = dev; struct hsu_dma_chip *chip = dev;
struct pci_dev *pdev = to_pci_dev(chip->dev);
u32 dmaisr; u32 dmaisr;
u32 status; u32 status;
unsigned short i; unsigned short i;
int ret = 0; int ret = 0;
int err; int err;
/*
* 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.
*/
if (pdev->device == PCI_DEVICE_ID_INTEL_MRFLD_HSU_DMA)
return IRQ_HANDLED;
dmaisr = readl(chip->regs + HSU_PCI_DMAISR); dmaisr = readl(chip->regs + HSU_PCI_DMAISR);
for (i = 0; i < chip->hsu->nr_channels; i++) { for (i = 0; i < chip->hsu->nr_channels; i++) {
if (dmaisr & 0x1) { if (dmaisr & 0x1) {
...@@ -105,6 +95,17 @@ static int hsu_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -105,6 +95,17 @@ static int hsu_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if (ret) if (ret)
goto err_register_irq; goto err_register_irq;
/*
* 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. Instead of handling the spurious interrupt
* from HSU DMA here and waste CPU time and delay HSU UART interrupt
* handling, disable the interrupt entirely.
*/
if (pdev->device == PCI_DEVICE_ID_INTEL_MRFLD_HSU_DMA)
disable_irq_nosync(chip->irq);
pci_set_drvdata(pdev, chip); pci_set_drvdata(pdev, chip);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment