Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3890145pxv; Mon, 19 Jul 2021 11:13:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyYTx9QZi9UCTLDPaCEJM/m1sF67cObvJrfyk34p8kMilcPTO3+KVpe1Xyk/3OojjjtqcC X-Received: by 2002:a5d:8c9a:: with SMTP id g26mr19925268ion.121.1626718291414; Mon, 19 Jul 2021 11:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626718291; cv=none; d=google.com; s=arc-20160816; b=Vme5EzCLwrnn6FKGFAyhKL+fi02rBIsOSFtcIvI5sgPQKJjkPmqafYifXO3tFzYhOe rSQQhkWvB3g+tR3SH9yGZXTydvBKVAWnOfwr5vMlTFMZ89wvlbNnqaXA8ca/1WJbtqsO UJ2bRk94RoBJ7wIVTFRS9ULS13g5y7+05HlH3yvnsDgwJMwjTx3MUzRbM5mYu3z51exg xn/RzlWToxdCmdBVdbpBIbEfQBOk639HiwEMgB3cHjd/fILS4snDeahOxfFRmSUCa6FU i1Tt2nrUwJUvn9nDLfCuOb7MOLOLI3okZWXPHf50XzNdP51mOwdq4bgf0kEYmC5aNwhY HhVQ== 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=1uMMjb7csZLNPMhy4j7gpWbuBwVQyrXXA7ASRiuGnSE=; b=mmXx9tmR/zvM5U1mEotysqQQVryLftecNmz/E6xWv12JgRNNBrUpryyWO8IxkeOtkQ rReosS2rMVuYwACjpCjSJyYVv4jkLcA5zJKyUN/JKRfJCL/yptyuWmtH5oOKQfxDt21n qd8kkEzS/W7Os1rdCJabTDOXIc77Q+YuppPWJxWfGLBNxZV84dD+UIuHrhY+BuYjohj4 QrKHmopxpSZPuWHd0LwikBX2rQ9WxZ+2xdvCwUkrWIu/jVy237OQrcgVKScExqmpxRxF lmO+j0n2K3Q0bowbqpoDhfdwON6W6ZbxavPKfPfxRsysQpqM36oB8fLzggEgWqvchiaz ErDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1fD0FrwX; 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 t16si19891471ilm.159.2021.07.19.11.11.20; Mon, 19 Jul 2021 11:11:31 -0700 (PDT) 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=1fD0FrwX; 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 S1380243AbhGSR1x (ORCPT + 99 others); Mon, 19 Jul 2021 13:27:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:44952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350032AbhGSPpb (ORCPT ); Mon, 19 Jul 2021 11:45:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 87D1B61107; Mon, 19 Jul 2021 16:26:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626711970; bh=rcGreCIoz1dl8poNvVGGA1M3PbJmnLSrc+aGpbVweUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1fD0FrwXJvwrGwiZHMckB6ZYnAsE2FkJo9pPiylJcuRSFm5ktm17CyM8eDLN5189B 4LssIFm3HH0DYjhjywhbVMnshRpDRAsXNfDZXV8QmTkj0/OUol3pxCSbhRGdS6tLqB nSG6+fGdT95rxQlvYqB90xoCV/BVyboZeSW5Ms3M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Zyngier , Sandor Bodo-Merle , Lorenzo Pieralisi , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Ray Jui , Sasha Levin Subject: [PATCH 5.12 201/292] PCI: iproc: Support multi-MSI only on uniprocessor kernel Date: Mon, 19 Jul 2021 16:54:23 +0200 Message-Id: <20210719144949.104060526@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.514164272@linuxfoundation.org> References: <20210719144942.514164272@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: Sandor Bodo-Merle [ Upstream commit 2dc0a201d0f59e6818ef443609f0850a32910844 ] The interrupt affinity scheme used by this driver is incompatible with multi-MSI as it implies moving the doorbell address to that of another MSI group. This isn't possible for multi-MSI, as all the MSIs must have the same doorbell address. As such it is restricted to systems with a single CPU. Link: https://lore.kernel.org/r/20210622152630.40842-2-sbodomerle@gmail.com Fixes: fc54bae28818 ("PCI: iproc: Allow allocation of multiple MSIs") Reported-by: Marc Zyngier Signed-off-by: Sandor Bodo-Merle Signed-off-by: Lorenzo Pieralisi Acked-by: Marc Zyngier Acked-by: Pali Rohár Acked-by: Ray Jui Signed-off-by: Sasha Levin --- drivers/pci/controller/pcie-iproc-msi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-iproc-msi.c b/drivers/pci/controller/pcie-iproc-msi.c index 557d93dcb3bc..81b4effeb130 100644 --- a/drivers/pci/controller/pcie-iproc-msi.c +++ b/drivers/pci/controller/pcie-iproc-msi.c @@ -171,7 +171,7 @@ static struct irq_chip iproc_msi_irq_chip = { static struct msi_domain_info iproc_msi_domain_info = { .flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS | - MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX, + MSI_FLAG_PCI_MSIX, .chip = &iproc_msi_irq_chip, }; @@ -250,6 +250,9 @@ static int iproc_msi_irq_domain_alloc(struct irq_domain *domain, struct iproc_msi *msi = domain->host_data; int hwirq, i; + if (msi->nr_cpus > 1 && nr_irqs > 1) + return -EINVAL; + mutex_lock(&msi->bitmap_lock); /* @@ -540,6 +543,9 @@ int iproc_msi_init(struct iproc_pcie *pcie, struct device_node *node) mutex_init(&msi->bitmap_lock); msi->nr_cpus = num_possible_cpus(); + if (msi->nr_cpus == 1) + iproc_msi_domain_info.flags |= MSI_FLAG_MULTI_PCI_MSI; + msi->nr_irqs = of_irq_count(node); if (!msi->nr_irqs) { dev_err(pcie->dev, "found no MSI GIC interrupt\n"); -- 2.30.2