Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4808873pxj; Tue, 22 Jun 2021 08:27:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvjxq3RjIkng2w3nCAwnjn3nWlwsOSr5iS/rz2ZWy3nn+K5LFEo8yoISJShRPpc8V3NeRP X-Received: by 2002:a5d:8a07:: with SMTP id w7mr563245iod.154.1624375671272; Tue, 22 Jun 2021 08:27:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624375671; cv=none; d=google.com; s=arc-20160816; b=BN/0d8o6YmN/oZ7gxFw1EuknmJ46rQxUWVH3w4c4XvAO2JRZYT+QrMSaWTI8MLTnUo ak5Gu7x9S5cDzZCXOYdnnnCNBkXRYe7RC7My0+ZcI/pt2xoOQ8LzeBY6I+j5/e1s9WCX 4Yot+cxBcsv4gtNp5cexCunEMz8ZaGywlP/2fBYqTWc+lz1Dp0r3d2dXgdTjAMlnkyJJ 1Iub/IOJW7S3V+DtSM9EkJ/FBG0M4RLxsnKLYqhWZipYlHBPq0hD55buXJ3vjc1EuPw7 r+3wHAoeahFt4Zwq/PjegbBH/HFFY3Xut8YJSWZ0G+gX1lTtfzO5W7PzoXLwPf5lwyoI PMJA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H0fRRUN9hmaR59XL6pJP1fOrRa3SKmuQ9EeViv8hJUQ=; b=m3Fp8qJrlZ52lUvPw51i4He7ZmjaXGBXYNSeiEx6AmpGtMiOnIWfB6j6ZABnudOXaK lkdvjwavUU3fc5XyqBdGUYCPIrFPQR6rUx1vhEm7+pVh4jnNgtwUWm7TaO5SWG2RxR/G d4epj0MlSwkZxlhLMWcXj5o3mW0AKQE9pecyuDRJP5hczhl7dDFKPmKdc0D//kI/7IJi 8JC8a15knS+6YxEBgx3e1AJLGtkcDWz/LgH7iook+JnB1lGIzWbdn8l2FZpOKlKKNmfL FHoZLKdTHRl23P0cvgUgJvQ/PMRVV3dbtjSJQ6ln85oqaryucsZeTizeIEVa+3nT1D3G Mfug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bb88ouU3; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r4si15903836ilb.18.2021.06.22.08.27.37; Tue, 22 Jun 2021 08:27:51 -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=@gmail.com header.s=20161025 header.b=bb88ouU3; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231761AbhFVP3V (ORCPT + 99 others); Tue, 22 Jun 2021 11:29:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231876AbhFVP3T (ORCPT ); Tue, 22 Jun 2021 11:29:19 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9FD7C061574; Tue, 22 Jun 2021 08:27:02 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id h21-20020a1ccc150000b02901d4d33c5ca0so2525665wmb.3; Tue, 22 Jun 2021 08:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H0fRRUN9hmaR59XL6pJP1fOrRa3SKmuQ9EeViv8hJUQ=; b=bb88ouU3crmfqRKxU+pJjoZiy3AST7BfANO3yReF/O6pWOA7iBqjUsWYoT8ICvzP8r IIjp3xtUiQUpIbWbwXfZLciETKWnqXfdsvEXyQIOt3AL+Vv4KYu+Lsa/6HOnLXk7uL/R BP+5htCixe6hHRmQvIGxl5WuFojOJnUC5aro2E58Jvw2GuwvKmtVdj8ZZIj5TmZzCiAR ai7b5c8YJTWu952PjSVbuJ/kUAyBOkuiMbpmHVYpt7TRTV6zE16DIEvG7G8ssOMR+zbZ HOeZEMd7LmUwEvJ3ezUVJX7O716Yc8Y5Ci9j0draS4b6MkAXcsHXZcw4PltYtSQmrF/e FtlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H0fRRUN9hmaR59XL6pJP1fOrRa3SKmuQ9EeViv8hJUQ=; b=KiG1/0URC430sYEAgdb3tYtUTjC8LSiQ2ef+wA0JYsqP9zzlf3IDy8XOSkyTObmw0m C1sMB4VNyRACZBo213p+Cw964Tlw+O1FWeyu5PSZhx2GybIZRL1MNat2zyVW7wbz7vq2 8Y6KcpK3L/isPmbkjjq3UMnbNOPuhAuYv112N7OEwBwWKRIqJfeNtQsAVaORE8d2nOjG BLfYVvmcYuEGv6fPOasCBWn7tuugbGNa81mg59s3H8cMRwkoP9SipwNH+1/DLW/wBFrb 5r/1xIxAz8J3cFp98E7owEYiNAGzqh3i7gNJZsuU+Bea3/yqG2qNkSsFb4/xv7SuPcYz n8jQ== X-Gm-Message-State: AOAM530L/B6AvUwXHn7XEEK6iFXJ0YYdvwk+kTELtTc+vLOgt5G8bie7 254zTV0k+8RAvYpsCb+B0O0= X-Received: by 2002:a1c:7706:: with SMTP id t6mr5237921wmi.62.1624375621362; Tue, 22 Jun 2021 08:27:01 -0700 (PDT) Received: from snuff.lan (84-236-11-56.pool.digikabel.hu. [84.236.11.56]) by smtp.gmail.com with ESMTPSA id l15sm11469907wrt.47.2021.06.22.08.26.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Jun 2021 08:27:01 -0700 (PDT) From: Sandor Bodo-Merle To: Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Bjorn Helgaas , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Sandor Bodo-Merle , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Marc Zyngier , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Ray Jui Subject: [PATCH v2 2/2] PCI: iproc: Support multi-MSI only on uniprocessor kernel Date: Tue, 22 Jun 2021 17:26:30 +0200 Message-Id: <20210622152630.40842-2-sbodomerle@gmail.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210621144702.GD27516@lpieralisi> References: <20210621144702.GD27516@lpieralisi> 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 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. Fixes: fc54bae28818 ("PCI: iproc: Allow allocation of multiple MSIs") Reported-by: Marc Zyngier Signed-off-by: Sandor Bodo-Merle Acked-by: Marc Zyngier Acked-by: Pali Rohár Acked-by: Ray Jui --- 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.31.0