Received: by 10.223.176.5 with SMTP id f5csp587617wra; Fri, 9 Feb 2018 04:05:00 -0800 (PST) X-Google-Smtp-Source: AH8x226DKm5GWS++yT7FH+0M7+9Ii/clrEItpI0yAuqujvEWwyZCCdG3Jn57jN8kz9kQWJ3kk2v5 X-Received: by 10.99.95.193 with SMTP id t184mr2142118pgb.296.1518177900487; Fri, 09 Feb 2018 04:05:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518177900; cv=none; d=google.com; s=arc-20160816; b=XYD3t9QrHmrOXBkNVVTH8CoHF6kRn3vBD9YANZotXz1cLhxHhdcsJ3zkDjITmYOpwm qu1tRFuZO54660/x3tD+qQAZzo9TVlZm+mcn+g5TGNuTiILi0EHlN6D0rTw7mUu4SmYp UbhKdaS1hVyagdPXdEAAs1czh16/c4RZpXVfJTavImuOD9OyTTZ9hvAitoOioNHiL83C QB6GPWOb+MXBzHMX7ZpEDpNUQkGLIEaAXMmhT77SqcHK/3HCKOQN51ZQolcGs9lWrfQF 3LJ4X4idToeuhFzEP9sHPnUnwS7h4KDATw2et0BXOg3spND6thdlunR+SACcAPgt17dk VI9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=xMLIOgdXoG8GnZBimbilNgPF+vhtc5rvMbjV0WyPAXY=; b=Rgy02jFmR0YZvdvxWcghxDN4Y5hKX1aDAvsfi6b3QqAoFGQIMzZDZDYvSDq8m4z3dY A8c8tCveSGvMEWvDd7Y0tHGnCAmOx44M+ul6yv0rM35beoZ0zFc28QbjKqy2ap75aVZ1 SG3Zjjv7vZMc+zFLN2AePnx+irONnZT3sKtfk2HhnvahUN8+BRPSf+l+KSDup6DWQPB2 6+ZIq5fmYySfy+s2tT9GwwwRilV7m7zIssK/oAYam+fKdGEensUDLm1vXYJuvuCwrGW1 +w/WnoFoENCft3X1NLaoaxYg0/kTkC+mg/2qNHeNxEL3OCftyX7M3NHh9iTb28sAJwwT tmxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lmL6oHq7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k9-v6si1485311pll.578.2018.02.09.04.04.39; Fri, 09 Feb 2018 04:05:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lmL6oHq7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751133AbeBIMDz (ORCPT + 99 others); Fri, 9 Feb 2018 07:03:55 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:29054 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751007AbeBIMDx (ORCPT ); Fri, 9 Feb 2018 07:03:53 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w19C3iRZ007098; Fri, 9 Feb 2018 06:03:44 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1518177824; bh=vsqnxa5Q75RHc6ObIEecG00omMG0QnxCfAEV09uB2vc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=lmL6oHq7IsltaztAWllBNpieo3JehUAKLqTpvvmXjlSQkFyVcw0h4Ic1ZTyUjMFcD m8e4+SbxFngtRb468xONk9DaorQ6J+4OmLUczTTv18r4lGZU+q7kPk/I2tKCoCECop GTvNt1GCIQ4KFgij970XAiSEOoW4uymB2KI3gKAg= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w19C3ilK022960; Fri, 9 Feb 2018 06:03:44 -0600 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Fri, 9 Feb 2018 06:03:43 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Fri, 9 Feb 2018 06:03:44 -0600 Received: from a0132425.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w19C3bkp017802; Fri, 9 Feb 2018 06:03:41 -0600 From: Vignesh R To: Lorenzo Pieralisi , Jingoo Han , Joao Pinto CC: Kishon Vijay Abraham I , Bjorn Helgaas , Niklas Cassel , , , , Vignesh R Subject: [PATCH 1/3] Revert "PCI: dwc: Clear MSI interrupt status after it is handled, not before" Date: Fri, 9 Feb 2018 17:34:13 +0530 Message-ID: <20180209120415.17590-2-vigneshr@ti.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209120415.17590-1-vigneshr@ti.com> References: <20180209120415.17590-1-vigneshr@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 06e15e6883bed ("PCI: dwc: Clear MSI interrupt status after it is handled, not before"), MSI IRQ status in PCIE_MSI_INTR0_STATUS register is cleared after calling EP's IRQ handler. But, MSI IRQs in case of PCIe are bit like edge interrupts. If a another MSI IRQ is raised and the end of current EP's IRQ handler call but before clearing the MSI IRQ status in PCIE_MSI_INTR0_STATUS register then the new MSI IRQ is lost. This issue has been observed in case of USB-Ethernet adapter connected to PCIe USB card running iperf3 test. iperf3 client stalls after sometime as reported here[1]. This is because XHCI raises MSI IRQ at the end of its IRQ handler but before PCIe driver has cleared its status in PCIE_MSI_INTR0_STATUS register. Hence, the new IRQ is never registered by PCIe designware core. Since, XHCI does not raise any more IRQs until the previous one is handled, it leads to a stall in communication. Therefore driver should always clear the MSI IRQ status in PCIE_MSI_INTR0_STATUS before calling EP's IRQ handler. This make sure that DW PCIe core catches new IRQ raised during the call to EP's IRQ handler [1] https://lkml.kernel.org/r/BN6PR18MB124994D85EAC4B5B1AD5EC56866E0@BN6PR18MB1249.namprd18.prod.outlook.com Signed-off-by: Vignesh R --- drivers/pci/dwc/pcie-designware-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/dwc/pcie-designware-host.c b/drivers/pci/dwc/pcie-designware-host.c index 8de2d5c69b1d..c29cbcd430f4 100644 --- a/drivers/pci/dwc/pcie-designware-host.c +++ b/drivers/pci/dwc/pcie-designware-host.c @@ -68,9 +68,9 @@ irqreturn_t dw_handle_msi_irq(struct pcie_port *pp) while ((pos = find_next_bit((unsigned long *) &val, 32, pos)) != 32) { irq = irq_find_mapping(pp->irq_domain, i * 32 + pos); - generic_handle_irq(irq); dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + i * 12, 4, 1 << pos); + generic_handle_irq(irq); pos++; } } -- 2.16.1