Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3857710pxv; Mon, 19 Jul 2021 10:24:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHpVJjCaCvhgasuJYHK1PgM0g7wxanT4tMty7OfubMXFkwxjYkzz+SDvpoM65McMvROvBJ X-Received: by 2002:a92:cf0c:: with SMTP id c12mr17479734ilo.56.1626715459306; Mon, 19 Jul 2021 10:24:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626715459; cv=none; d=google.com; s=arc-20160816; b=WvCZrvnSkh8HBul+xselT+TRzQLOBE6urrvEPyijBnj9mOV3Hbg+eCgxkFiwywoEP7 kP464Y6Qaylgx6DdfRlMzjXdgevgBxUlliN0wqMHhFObaAKu+k8t0SjVKpZV17gfVYBp ODlkXQ2XieaX7nYNySk/sCDEwsmS8de2tix+9QwAYxPhTdKPSzX3slVobeIFhDb+C+sW U7iLckouXmZYqyZX0kEBqSLdy1ji+ivdcMbNJeyQaHAxmyAxZSECicQYfnwoXElS4O+X DUpXXP4I9GQzUkMxjIBxSZ+Y3ySSAMvj7jXEx864z+5ocparSp63q3slQEYDZ+ysWZ82 pQJg== 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=HrG5VAMsc6Qm9Jrf0wqLUyYvkyZj/ET/BkX6wIdIrt4tqvdhSPFGiJuWFyNNqhv6Ag xSgeBg/lI/OzYX5hMWUmo+jwNzAFzvXIrWsAnBx/ki1Yg9DmlrqSG1bHncC0/sMoQX1A 3F7K/rVfVnfcHNivVT4f95G9yc3Z3WqOZ/nHADXeCmUvVWNKPD0NF6pfJfijaq3kDVVk M1a7LbQlY5CQMRPaain7G99WdW8SmpjwFzo3eADlVNUQEFdtWmu2C9GUZHGxuuszLIPH 21VIaEUWVEMNTQAI1Cif9ECU4iezOgs1Hk0rJ9+vvP78tYHiGq5/2xMxmIYXUSVUwYsa bbPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DeMI6rMx; 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 x6si11568399jas.60.2021.07.19.10.24.07; Mon, 19 Jul 2021 10:24:19 -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=DeMI6rMx; 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 S1356177AbhGSQkt (ORCPT + 99 others); Mon, 19 Jul 2021 12:40:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:59736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347583AbhGSPTv (ORCPT ); Mon, 19 Jul 2021 11:19:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4DC96613EB; Mon, 19 Jul 2021 15:58:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626710321; bh=rcGreCIoz1dl8poNvVGGA1M3PbJmnLSrc+aGpbVweUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DeMI6rMxCymI22Teg/1CyW++teKsE3ADYH4GimAjs5hkpMpZSnnxEtqBk7xQ3LWnN E+k6B/uHvut/T4Bhn8/+78bJZhqI50JWEWUFUaPOP2010/XdKo6wE1arRr7R6hSRIo Spi9jhOf01TqVccXtOT4jrcXjpBhGfveDyh9h0AE= 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.10 167/243] PCI: iproc: Support multi-MSI only on uniprocessor kernel Date: Mon, 19 Jul 2021 16:53:16 +0200 Message-Id: <20210719144946.289929417@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.904087935@linuxfoundation.org> References: <20210719144940.904087935@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