Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp394836pxb; Wed, 3 Mar 2021 06:07:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyeh0hEZxNgPewi5a13p7A9kWL0kaIeVVsHoqO6Aerxi0EgnvESZ991prusMGCO4MLGI9FI X-Received: by 2002:a17:906:c45a:: with SMTP id ck26mr25608238ejb.125.1614780442750; Wed, 03 Mar 2021 06:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614780442; cv=none; d=google.com; s=arc-20160816; b=OkLKvlS7IVKEcrWu6All6UYQugggBAEJ39aCZw4ZFVk+N3O/OWA/LXHmG/140WSxoa ioMr9bW7/d1uyCyArikffsmljrVRcZsyFlgDNFOgyaktRB/e3zfpgSzql7w7K3UWVvzg 57xIcXhp3ZTsKRZSq7ssRgUZozP8XCfFf2APaW3Ewm36nVfJJKojXYPolfeQ64bOkLA+ neSpsJSRxDzBvJQCzjjsPCrcKtVRSOOzyQOI6K5KvP7aLMuE8pphWRgBt8P/BdNPU8DL l9akaZ14t3O9tTM6xegL6Hf7YAjMEhx6xFzdD+N/zvGpef4NXuNmnOB9wzyvshR6AaSP sylA== 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=aUegVBOvfdh32EjcKx6Yqi8bsLqVkk2YB1rYqh/zFe0=; b=KkHjlwFiFQg+z91HeIVA9NJjRd5bmS2kVgKpaTRI7SxgFWG9NNoj5BkpNEwcpp97Lk LIPix76hJetVZux/7mA0B5xD6byrowcXGlEsPjSO0PUxw6mANj/Xn2XG55miJH03jLjX lvsn/EmYeL6sU1EkMP4a1UGH/DkigLTU84xB9DKKR5L4RPxVTespnbHIrCcjjUQCr0LD vjS70vTdGJyVttNHjWIjerHCxCAsEbmiVgfsCxc+l9ZalnXmJOCzzzfrR7QuD1PBZU6D 8Z9aDcafFmCpQOuWRCy9DuoUOKMzmLj+3Cfo8A0uDOzTAyGlnTNQWiGM9iyVuhpwvXUl /CVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j0CxAb7m; 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 y101si2740099ede.101.2021.03.03.06.06.32; Wed, 03 Mar 2021 06:07:22 -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=j0CxAb7m; 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 S238837AbhCAUeB (ORCPT + 99 others); Mon, 1 Mar 2021 15:34:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:35190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237375AbhCARIP (ORCPT ); Mon, 1 Mar 2021 12:08:15 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8A9ED64F7D; Mon, 1 Mar 2021 16:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616849; bh=SF3eeJA/4Z39bhrQBtZx/lKcl/gyGlloKOE/fgc8vsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j0CxAb7mWI1YjvTVUx2lOzxYPHq4WsYCrjHQahDbBOWzhMZDVZedQ/YstdOvQdWOW lwozlIlXyKfMzfdOibV7ttbjrop/41cYaIDCw/MjGLgX7i4onTMdd2eCyG1wzSH6tD mGFSqRZiLzlaquaZZdiVkwR1U9mxnYbo3ge7g8eU= 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 4.19 116/247] dmaengine: hsu: disable spurious interrupt Date: Mon, 1 Mar 2021 17:12:16 +0100 Message-Id: <20210301161037.355833607@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@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 ad45cd344bbae..78836526d2e07 100644 --- a/drivers/dma/hsu/pci.c +++ b/drivers/dma/hsu/pci.c @@ -29,22 +29,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) { @@ -108,6 +98,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