Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5249801imu; Tue, 15 Jan 2019 14:04:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN7xh0RqvHblZbE7OfMj/Ggq4is5CsjcrD1imcJ1u3r1Znil9sEIeQlILO+dfoQpePr7rgTk X-Received: by 2002:a63:ab08:: with SMTP id p8mr5656450pgf.87.1547589882416; Tue, 15 Jan 2019 14:04:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547589882; cv=none; d=google.com; s=arc-20160816; b=EdiXSPm7Me2ez5SIqfwU3PB5kCr8eOD/BJiHlC7Ilp5leSztm+N79F4utE3xX6P27E WuMAIxjOSbedylDrfvpn728KLl1nl1RKkuSStwO3HL41Tq/1YmozfLgu+aE2DJe36QMS dbTu5+NArUx2/mGh0DMzzYJ1b6P5J9FZqOp1eT4dnIqAL4dUXziv9DbMEAJ29ClHbhet OFHZ7ukkTKskgWqVk0j5a6tbcvAUXong21EuK+8VE8MGPgTSC6sOYj/gl9GNbx1005s3 lzg7aq96XreDe4fSNOJB+H6rlKQFUk8FgeVwKE73MXBytY3wYr5LMj3NcPm0BKJLhPmv iPXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XSK7dTdH/MFsviOa8Nsg+4ONgr98k3NDd8f3EI5lnfA=; b=AQsqrhr7zO8GTm43CY2PzNZ96tIPLla7Ut/XeCpw/lyUOho3QEpPgIZHcwbimSXcvb S2xIlKsdkfynQwiXTzJLmxURN0184tHSRWnFIf6RDr4KikgDVKk5LrjFkltUOmHmbd3y TazCszIFn59hF7bWyKx7tTN3ZXfDVMphHgkPOlZVWHvMTCH2AKl61krC6mS8VMbPQSVf x2YnzIHrJqjhgEF2Lp3oLdeK71fAPJ6n1pmsTsD35Z8l5QXi5j2bveJl2YcJ/XBKhKDP 0A8IxOBm29WrDqLhNGeFR+7zmsp3a4FMPak/79n4FFTLNTWpzDW6ssmUG79BgEldQ1uU dJVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uk0YIBgH; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a16si4150981plm.365.2019.01.15.14.04.22; Tue, 15 Jan 2019 14:04:42 -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=@kernel.org header.s=default header.b=uk0YIBgH; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387699AbfAOQpF (ORCPT + 99 others); Tue, 15 Jan 2019 11:45:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:34708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387660AbfAOQpC (ORCPT ); Tue, 15 Jan 2019 11:45:02 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 38E6220859; Tue, 15 Jan 2019 16:45:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547570701; bh=fYwLCenUyZpaEOgOOn2diogjVcZ/FbuzWmho/x/WAQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uk0YIBgHQ8dxb3f+Uv0vGWD8Bm2lq1G8jUY6hnBP94Y38YOHzLcxe7frQulDtOxR+ Z2osYuULKo2nxOy+0Ot0G1PwhOfNj6KASrPOiVE6Aydbj2H4GlBCxG0kkEXKZKnrbW qZvRWVwTyfyiuS5KboWUKGtt9HoOhpBunc4C4jHE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trent Piepho , Niklas Cassel , Gustavo Pimentel , Stanimir Varbanov , Marc Zyngier , Lorenzo Pieralisi Subject: [PATCH 4.20 40/57] PCI: dwc: Move interrupt acking into the proper callback Date: Tue, 15 Jan 2019 17:36:21 +0100 Message-Id: <20190115154913.090434858@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190115154910.734892368@linuxfoundation.org> References: <20190115154910.734892368@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marc Zyngier commit 3f7bb2ec20ce07c02b2002349d256c91a463fcc5 upstream. The write to the status register is really an ACK for the HW, and should be treated as such by the driver. Let's move it to the irq_ack() callback, which will prevent people from moving it around in order to paper over other bugs. Fixes: 8c934095fa2f ("PCI: dwc: Clear MSI interrupt status after it is handled, not before") Fixes: 7c5925afbc58 ("PCI: dwc: Move MSI IRQs allocation to IRQ domains hierarchical API") Link: https://lore.kernel.org/linux-pci/20181113225734.8026-1-marc.zyngier@arm.com/ Reported-by: Trent Piepho Tested-by: Niklas Cassel Tested-by: Gustavo Pimentel Tested-by: Stanimir Varbanov Signed-off-by: Marc Zyngier [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/pci/controller/dwc/pcie-designware-host.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -99,9 +99,6 @@ irqreturn_t dw_handle_msi_irq(struct pci (i * MAX_MSI_IRQS_PER_CTRL) + pos); generic_handle_irq(irq); - dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + - (i * MSI_REG_CTRL_BLOCK_SIZE), - 4, 1 << pos); pos++; } } @@ -200,14 +197,18 @@ static void dw_pci_bottom_unmask(struct static void dw_pci_bottom_ack(struct irq_data *d) { - struct msi_desc *msi = irq_data_get_msi_desc(d); - struct pcie_port *pp; + struct pcie_port *pp = irq_data_get_irq_chip_data(d); + unsigned int res, bit, ctrl; unsigned long flags; - pp = msi_desc_to_pci_sysdata(msi); + ctrl = d->hwirq / MAX_MSI_IRQS_PER_CTRL; + res = ctrl * MSI_REG_CTRL_BLOCK_SIZE; + bit = d->hwirq % MAX_MSI_IRQS_PER_CTRL; raw_spin_lock_irqsave(&pp->lock, flags); + dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + res, 4, 1 << bit); + if (pp->ops->msi_irq_ack) pp->ops->msi_irq_ack(d->hwirq, pp);