Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5253900imu; Tue, 15 Jan 2019 14:09:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN4rRL72Af2xzf9Weaqdm5ZbWWU5E5FZqQLa7Ap423Kda5QQVJaZ36JK4eispcpcIU7q9NFY X-Received: by 2002:a17:902:7e4f:: with SMTP id a15mr6245542pln.149.1547590165181; Tue, 15 Jan 2019 14:09:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547590165; cv=none; d=google.com; s=arc-20160816; b=k3INjJxgk29CcHIbKQ3uW0uf3AUehUpBg2GeJkpMsiGKhtgit+9wpnQq7R0dcoq+je rGRPwqBqQwNOdNxI4oK5oeBsA3w2VIcXvJe5zj7X9wT/kmQl8r8Mr4C1rldZFuCxie/6 2hIJXWMkHq/bqvVtu/zn6adBGKlRTX+2QNObDWv3fXq0qC/dPqiTtCOUslLWr/MLKpVE x4irkHudJiLk2TtQaIWO0NT5AFLUce6ak08sbPmaxrHRxRmtiCrOxiKV78ovQpn0dMpU 5E6EJFj9ay3WUoy1zfGz7hE8bs8fVk22QUiJxM6K5vcDYVF2yaMaMtqnEMRfCOEpAN/n 0VCQ== 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=1CdwSOBUIru2uV+v9B2F3k/2u82fMeXNwNdtJVLV6+U=; b=RtnuNAjVCU1g99aYnmvVt8ia7OWb/j9DEqEcvHdDPE56SOfHA6rIriZ+tZTgpcXOhT +CCY5JSlwH0cwYiMTUbIP7T1HAkn0Y+30F0r0/rpnUqiDoHRWHZ+/utY2QytIRrP+GgO n/AArj4n4R0ukYgWicXcSf1IJqo1rZ72FHAWl8vmtnMEvDRYC8ZTOlMnowwQXy+HkRKD 3y2fsPzMfxLDls1u0ciSCtUE+Ro/U7k1h6JE+aeHma4/XoAAUBJyP4bstr5Lnm0KgOw3 Ijz3uG+bwBxAr0brJUawC7J+Pfj0ypRwtufILTK6VCCyX1WK+AARydd/LXADaZItigWj fVzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JEdxMETv; 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 k33si4196863pgb.424.2019.01.15.14.09.05; Tue, 15 Jan 2019 14:09:25 -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=JEdxMETv; 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 S2387939AbfAOQqO (ORCPT + 99 others); Tue, 15 Jan 2019 11:46:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:35846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387923AbfAOQqK (ORCPT ); Tue, 15 Jan 2019 11:46:10 -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 A1FDA20645; Tue, 15 Jan 2019 16:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547570770; bh=TMRcsba83LOW/qRrANMUrUC4OBR4HGQPYfsZ5ni4Eeo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JEdxMETvAAnDDSit1vVliKZhkGwZJM7SNuk1gIxysnGm8ajY/Yn0hAeeksvowxqGz M65wg6K1NN2pczOxI1EgY0Igk8zc6iM4G43YodDRzfbtm6IlZXf24q7suBfGZy/CIt q6BN7QtPB84loU88TZiGMHJ5r4cedbIepe5d4SQU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Niklas Cassel , Gustavo Pimentel , Stanimir Varbanov , Marc Zyngier , Lorenzo Pieralisi Subject: [PATCH 4.20 39/57] PCI: dwc: Take lock when ACKing an interrupt Date: Tue, 15 Jan 2019 17:36:20 +0100 Message-Id: <20190115154913.020937959@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 fce5423e4f431c71933d6c1f850b540a314aa6ee upstream. Bizarrely, there is no lock taken in the irq_ack() helper. This puts the ACK callback provided by a specific platform in a awkward situation where there is no synchronization that would be expected on other callback. Introduce the required lock, giving some level of uniformity among callbacks. 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/ 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 | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -202,11 +202,16 @@ static void dw_pci_bottom_ack(struct irq { struct msi_desc *msi = irq_data_get_msi_desc(d); struct pcie_port *pp; + unsigned long flags; pp = msi_desc_to_pci_sysdata(msi); + raw_spin_lock_irqsave(&pp->lock, flags); + if (pp->ops->msi_irq_ack) pp->ops->msi_irq_ack(d->hwirq, pp); + + raw_spin_unlock_irqrestore(&pp->lock, flags); } static struct irq_chip dw_pci_msi_bottom_irq_chip = {