Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp435021pxb; Wed, 3 Mar 2021 07:01:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJznXITMyVUyQfGyDC7FBjB71Aoe5zzyIXDslrLtnCZvCPMGh/eK8skT40jYK768w5FEbY3G X-Received: by 2002:a17:906:af91:: with SMTP id mj17mr25145591ejb.230.1614783695519; Wed, 03 Mar 2021 07:01:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614783695; cv=none; d=google.com; s=arc-20160816; b=fzXIiSma+QpZXOHl/1poJvP+haVxLGqFlA1ogHksxmlK1CTkyJ7Ojyj+r9gJV2SQcJ fFGFWfl6uwOhu7yd8refwgEwMU5xNaHAaqhHUY+tr49AX5xhvlfVqfKdSNK5fH1ruzqc ljoYqiu/UTkq0ZRFAPsrR7PjDOKjGHuNdmKdRFf9El8BrNDHtf2uZKmA9xoWBUVKlGhG 7HvibWoUWAo6/AklEuTGvfEcOKHedLJbs5nOlocGuhu+bS0B0BotG9eIu9nJ0aoVqxjQ nqeoTm+NDKWNpk338IL5AhL2MOEwa75mbsGqAtHno1ptua3mRN/Zpkm7tX+RpDa8Db77 JRmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M4egw7TEtwNTDdikjuZsqF9WjOkM9ywQS59UMSbzGPY=; b=G1xG8BiDtriyBK67Jxx73qK/hzjIEqoMXfJTdXqzuxqaxpB9jK1rrwqHtsYBhki+wR AxPeu2eIysunEgA5Ir7My8WzfM547u2Xfd3YEok5cX93byHKpWoCoYs/x/IOAIG0tT0K RhxT9+vVAgk5OExSSdgjrGy3LO0pK2PXrswQ6bcOC1Z6vLFJV0cgvw/Tm/Oj3veNn4w1 4g8XKgZYM19nWKuHLNlCg11nEm08l2XCCUmS0u73xO5+7wOjkeuQdnO/ixetOJSYDlHe w5lgbxFv73e89UnsFjFU/5sf860wEZQbZ1HNyAvlOSVm9Jgx29wowgS4wRA6cWYFaifs hS8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tYJHks0E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn4si3676857ejc.533.2021.03.03.07.01.08; Wed, 03 Mar 2021 07:01:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tYJHks0E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244706AbhCAW2G (ORCPT + 99 others); Mon, 1 Mar 2021 17:28:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:56326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238596AbhCAReP (ORCPT ); Mon, 1 Mar 2021 12:34:15 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0252B64FB5; Mon, 1 Mar 2021 16:53:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614617631; bh=zALidLivyhGJzurLP3RgXTjQv++DahGtOpqvB+1aiRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tYJHks0ErVMJcYICq2izSoA532+feRhvBceCGOQqUBUaMqO4YJxSVk+1Qe4j9nBhe P+C9q7jVRU3Z+zVMV10KYrje0TACRwIQLx0jS+QmwLZ9jvh6Rqe/7xLHqIh2h0sRxI 4fkfr9/vdUtqwIW766XwutgNS7wkXdwd755ZwPXo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ferry Toth , Andy Shevchenko , Vinod Koul , Sasha Levin Subject: [PATCH 5.4 142/340] dmaengine: hsu: disable spurious interrupt Date: Mon, 1 Mar 2021 17:11:26 +0100 Message-Id: <20210301161055.305736328@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161048.294656001@linuxfoundation.org> References: <20210301161048.294656001@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ferry Toth [ Upstream commit 035b73b2b3b2e074a56489a7bf84b6a8012c0e0d ] 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 Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210112223749.97036-1-ftoth@exalondelft.nl Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/hsu/pci.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/dma/hsu/pci.c b/drivers/dma/hsu/pci.c index 07cc7320a614f..9045a6f7f5893 100644 --- a/drivers/dma/hsu/pci.c +++ b/drivers/dma/hsu/pci.c @@ -26,22 +26,12 @@ static irqreturn_t hsu_pci_irq(int irq, void *dev) { struct hsu_dma_chip *chip = dev; - struct pci_dev *pdev = to_pci_dev(chip->dev); u32 dmaisr; u32 status; unsigned short i; int ret = 0; 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); for (i = 0; i < chip->hsu->nr_channels; i++) { if (dmaisr & 0x1) { @@ -105,6 +95,17 @@ static int hsu_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (ret) 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); return 0; -- 2.27.0