Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4492219rdb; Fri, 15 Sep 2023 04:08:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvAgbJoWt4oXYcm1DSK7bS4nl93678SAUEZp+v1oqeZeDnB+blSG6cJ1EMzi2njHWvC470 X-Received: by 2002:a05:6300:8095:b0:154:a1e3:f967 with SMTP id ap21-20020a056300809500b00154a1e3f967mr1247987pzc.47.1694776081764; Fri, 15 Sep 2023 04:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694776081; cv=none; d=google.com; s=arc-20160816; b=MxtVaSiuK2DnCOEbizTDy+R5VhpZhcJpYRXWmQI/08aua56T71JJYXdode4MfazdGO EpYpmIXiKR60UITPASrkJUdzXU7XzH9pMyVoO4+0Zd8NfbAFVEhYFAS/S7NJqJkIsWQm J5iKBBISgIIqYzDkF559RPSGuoLeUolJNrzWe3Ybx97l4ySvIniEaIlVf2McQdRJWQDA S1h13bVPHNAZ+pzKGvI6BGlNmK8KDALRhI1ABdku7UGU5jYZkei9KkQVCThmiRPI8RLp E53wPIhjJpX+TPk+gxtG20tVexC4eHKdvmeRt5fuI3gP+QUfWwd9AhltL7JhJvOkAe7C QE9A== 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=y8d0C5dLtGb8zs8KQUIJy2R9+5DBPV29N8a8eZxYvuU=; b=lOeQqmJNTn4/MEj4ROEQmbjdg1bjhnxYxNiIH3Ly96iprz8cupi5674jHxLKC+B3gS YDrbCaZj32YY0WXnvgcbOLxIcn14UcBcTXzfwie3lE3uNfXoFcy0ucKvWEs4SpPhNjRp t1h/Fr68S0sSJgriuKVF5JEFYUuxhXGJzbMucWHnPqjN1TyDzNI07oisapJh3InSY3Ue lgp1Qg8FADYTdYEzEFsVZh51bpnDi1B3pl1niqeJzd21swiw/HRBhKcNaZVKu2MDWqY1 4D/2xj+9FSQsPnlMc3Eg8+tN80Nk3+9x5ToFGkpCfDLaGAqIuPAXu8sLzqk824GzftpQ zYug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id o14-20020a17090323ce00b001bf1d1d99b0si3117094plh.568.2023.09.15.04.08.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 04:08:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 47541838219F; Fri, 15 Sep 2023 03:23:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234314AbjIOKXZ (ORCPT + 99 others); Fri, 15 Sep 2023 06:23:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234300AbjIOKXC (ORCPT ); Fri, 15 Sep 2023 06:23:02 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EC8C1FD4; Fri, 15 Sep 2023 03:22:56 -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 ex01.ufhost.com (Postfix) with ESMTP id D27AE24E18D; Fri, 15 Sep 2023 18:22:54 +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; Fri, 15 Sep 2023 18:22:54 +0800 Received: from ubuntu.localdomain (113.72.144.67) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 15 Sep 2023 18:22:53 +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: , , , , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie , Minda Chen Subject: [PATCH v6 10/19] PCI: microchip: Add num_events field to struct plda_pcie_rp Date: Fri, 15 Sep 2023 18:22:34 +0800 Message-ID: <20230915102243.59775-11-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230915102243.59775-1-minda.chen@starfivetech.com> References: <20230915102243.59775-1-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [113.72.144.67] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) 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 fry.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 (fry.vger.email [0.0.0.0]); Fri, 15 Sep 2023 03:23:26 -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