Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3841335pxv; Mon, 19 Jul 2021 10:01:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEVUoEpeWn543NrklzD483dRSGC/vkuMG2WODgiZ5oTvSKMm3LK9dov4se9THMi5Zv/bd9 X-Received: by 2002:aa7:d344:: with SMTP id m4mr35794045edr.184.1626714110158; Mon, 19 Jul 2021 10:01:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626714110; cv=none; d=google.com; s=arc-20160816; b=QT9O0kIo98zdWg0cl0I6nBczoRUxqIPvo13ACmebV4cvUFBnndcfF1XlfTj7jvJqPz vKLlleRwX7vrxrw6K9PpB+tIJVGW5vVSWxmRAhDsMsbiXl/OQOvLJwZqAAfGpOugLgxl t/6FYHS0ODJb5pwgbsY/bcJSGTUG5B08W236W8C2oJQEa1HhLxHxlUqCNtmqOBLy0E3D DsgTbgDgS3wSevFz869OeJpVPT1QVv8ipdduN8x0zO8ULW1GqS4rs3vtYYTGpcoZ/sAY KFTJImlpAyxruNnNZkW2SYZp/1xd16q5tIVKUVywuaZ6UAxgTIEA1StQgHXjKGI17c8u z9lA== 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=GV4TY2h25rGfasY+bM95pUh3V4yOlxcOxmjBj9j33/U=; b=CpBdU/CYLQ9WNXq6CqcxRdpCPQZRQEmvA5UMucI+dp9P9GC1pTPvwfwjS0X3C8TREV Surk9Ju4Gt7juzn9tyhsQjMUa7nQB4s4cDEgholI9y97rCAlNhPfzUP6nX7CdIDnGYG3 DFouAsKjjuRaUvhapt15DBCk4E8SlpT/rRshgtKKqHRikglrYsPJtLyWZdmQftNSJi53 O6Q290bqqe/sZ+FwUZ6weK7RbP7N7+HVd+2p2VM1b61TqlUCQobmF6J+Xewu+IWI0SX0 9235xwQ2smEzy1/zTOTd3jvnPJkqveJ589haL/a3FzNqF274Dud8cH1Gu5P995ZPb+hy Klxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g6EnCp5p; 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 dm27si21223866edb.53.2021.07.19.10.01.27; Mon, 19 Jul 2021 10:01:50 -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=g6EnCp5p; 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 S1351129AbhGSQNI (ORCPT + 99 others); Mon, 19 Jul 2021 12:13:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:40562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346075AbhGSPKB (ORCPT ); Mon, 19 Jul 2021 11:10:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EEFBD61165; Mon, 19 Jul 2021 15:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626709808; bh=Qoam8zCVidTeODVHFEEWi0BDF+uaW2BkhK7ptwjxiHs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g6EnCp5pYj9ATwarYna0/Lq9gP01iMt7peNsv/n55H/Yk/04J5ywOjbnFywbh19pM pnrlR9FdHdXaZxXsHJ8tO99cHPHpm5uVekUI3/B7oOyXeunwM/8CtEuAVOP94w9Yf8 lT7MIhp/s45DIVZD+7oJVoilYB+HsoQJKqy/k5dI= 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.4 107/149] PCI: iproc: Support multi-MSI only on uniprocessor kernel Date: Mon, 19 Jul 2021 16:53:35 +0200 Message-Id: <20210719144926.653117145@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144901.370365147@linuxfoundation.org> References: <20210719144901.370365147@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 b77811dcead1..0cb2fa1e0af4 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); /* @@ -539,6 +542,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