Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2457971rdh; Wed, 27 Sep 2023 03:21:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFri1w9Megeh44ma+weFD+JyN9T/eqdTPuBWxkpLR8IxsNwxcyW3h1czF+i1onV+XYYiP4O X-Received: by 2002:a5b:191:0:b0:d0e:fc28:3777 with SMTP id r17-20020a5b0191000000b00d0efc283777mr1577945ybl.9.1695810086800; Wed, 27 Sep 2023 03:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695810086; cv=none; d=google.com; s=arc-20160816; b=QuQQtAHK3GTpaTxobbb5I/RLG3nVh4LIQ/VqMqPenp2LCRa1Dl8gfzW+K5pNjhM/wg pa40+GF/AIPexgJ2mdvI1ddiBcnKV2IgpQs2wS2OuYYPE2o2pOjZMpGkAOTfeAJ4JRZG 9bOmz9Tq9SZ3yD3vQ4hgGJg0owk3o8FMAS3nRGGWigsam1sE+aaa7wD9H/1bwFx4JMvn 0p7K3lIYvtRZH0EBAU7E03zLpwATi3pWoxfai1wIhhNMS7AVtWwI4RUJC37VTSewYgsm KX8x4FPywNQ1GNnC4vV7ZGOedWV2pD94MlpsWX8dHqGz2CM8fxgu027cVeOA0Ga5+Tti 9S/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=rGB5ospMeNRyHw6rmDraba4QZgIkKCAr+wpRpIY5FCo=; fh=KH/9o+8UBz/NoIGu0llUr0msPOhSsaa+/ATeWBANkvM=; b=NUzf42dNjE41jF3xyPlhPuRkVGujh9zI36nUV7ZRpopu8tnHx4Z5HzhKrVH1LQMXGy HbDBpp7cZzHgp+eGPGR8Wv4cJsV3jluGFQRhi51kduWkBg5Npct9tDK6W+oUxqJpzGTm IOzVN50LdpsIpxgHIjYrf/ahnc1wzqt0D6do+7kYJOMFxc6hzwnlzZwigUeEAa3Ps5Pu pVnsdwpgjohMid98XVPFFn5cQwS6UmKmMKZsj8Yn2Oo0Y/7bH2njRpBelyCaUEohSs5D IEJe0O8zHjunH92ibMxr5UWjlVuBx1lFnSX8nmke7z7mnnK1tAiXAEf9GQYjJomj5QM7 cyhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id h2-20020a631202000000b00557531eafb0si14690664pgl.559.2023.09.27.03.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 03:21:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 7DAFF81B454B; Wed, 27 Sep 2023 03:09:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231276AbjI0KIw (ORCPT + 99 others); Wed, 27 Sep 2023 06:08:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231193AbjI0KIT (ORCPT ); Wed, 27 Sep 2023 06:08:19 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D718919E; Wed, 27 Sep 2023 03:08:17 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 4E68A80C5; Wed, 27 Sep 2023 18:08:15 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 27 Sep 2023 18:08:15 +0800 Received: from ubuntu.localdomain (113.72.144.128) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 27 Sep 2023 18:08:14 +0800 From: Minda Chen To: Daire McNamara , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Emil Renner Berthing CC: , , , , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie , Minda Chen Subject: [PATCH v7 10/19] PCI: microchip: Add num_events field to struct plda_pcie_rp Date: Wed, 27 Sep 2023 18:07:53 +0800 Message-ID: <20230927100802.46620-11-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230927100802.46620-1-minda.chen@starfivetech.com> References: <20230927100802.46620-1-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [113.72.144.128] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 27 Sep 2023 03:09:20 -0700 (PDT) Avoid using NUM_EVENTS macros in common codes. Signed-off-by: Minda Chen --- drivers/pci/controller/plda/pcie-microchip-host.c | 7 ++++--- drivers/pci/controller/plda/pcie-plda.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c index 81aac2d72a2f..d9dd63084e2b 100644 --- a/drivers/pci/controller/plda/pcie-microchip-host.c +++ b/drivers/pci/controller/plda/pcie-microchip-host.c @@ -648,7 +648,7 @@ static void plda_handle_event(struct irq_desc *desc) events = mc_get_events(port); - for_each_set_bit(bit, &events, NUM_EVENTS) + for_each_set_bit(bit, &events, port->num_events) generic_handle_domain_irq(port->event_domain, bit); chained_irq_exit(chip, desc); @@ -811,7 +811,7 @@ static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port) return -EINVAL; } - port->event_domain = irq_domain_add_linear(pcie_intc_node, NUM_EVENTS, + port->event_domain = irq_domain_add_linear(pcie_intc_node, port->num_events, &mc_event_domain_ops, port); if (!port->event_domain) { dev_err(dev, "failed to get event domain\n"); @@ -914,7 +914,7 @@ static int plda_init_interrupts(struct platform_device *pdev, struct plda_pcie_r if (irq < 0) return -ENODEV; - for (i = 0; i < NUM_EVENTS; i++) { + for (i = 0; i < port->num_events; i++) { event_irq = irq_create_mapping(port->event_domain, i); if (!event_irq) { dev_err(dev, "failed to map hwirq %d\n", i); @@ -1006,6 +1006,7 @@ static int mc_host_probe(struct platform_device *pdev) bridge_base_addr = port->axi_base_addr + MC_PCIE_BRIDGE_ADDR; plda->bridge_addr = bridge_base_addr; + plda->num_events = NUM_EVENTS; /* Allow enabling MSI by disabling MSI-X */ val = readl(bridge_base_addr + PCIE_PCI_IRQ_DW0); diff --git a/drivers/pci/controller/plda/pcie-plda.h b/drivers/pci/controller/plda/pcie-plda.h index 32a913d4101f..5b09ffed623c 100644 --- a/drivers/pci/controller/plda/pcie-plda.h +++ b/drivers/pci/controller/plda/pcie-plda.h @@ -150,6 +150,7 @@ struct plda_pcie_rp { raw_spinlock_t lock; struct plda_msi msi; void __iomem *bridge_addr; + int num_events; }; irqreturn_t plda_event_handler(int irq, void *dev_id); -- 2.17.1