Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp675008rdb; Tue, 15 Aug 2023 08:39:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFI6C7YIlTLuwaXgI1flvmIi1c0SwDEUvUDmEW85Rr6hHQuHzMjk1f8FTOFLujkyRJfC47W X-Received: by 2002:ac2:597a:0:b0:4fd:faf0:6591 with SMTP id h26-20020ac2597a000000b004fdfaf06591mr8342481lfp.10.1692113953430; Tue, 15 Aug 2023 08:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692113953; cv=none; d=google.com; s=arc-20160816; b=z5NsmhT/msqcf90fYdVsUR0dx7npT+nypU6nwi37xcOL1JQlUPluNAd/oUWFjopd9P bd+3+TCnhOBcXTGoaSXJBEh6wuBZlFJ06R4BfYz1nrxHPePbSHQOfpO+oGWSibjWB9yn Oa+mgeF5WK+ooTS9c+sERkVIknb7uzF5GqXX9MLTPKn3NHOvwz5sI6dVVC5cjOTsYXMX +Sur18eyG05CedVz+KA0VHFQfT6qx2YrCsllDIKEh5hfrIYQuyfb3zDwk6BAYtqta/vq xNFQ5kK44BhExbtmsVgDJUHWkn2C+bcuNeLk+ul+3QDCIknlCcIJo0y8ZuRh4bTczHK5 Td1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=YUj4suWVxFF+TvOEPYk0rOJH+n0CN8ULJuuiVlZMqWQ=; fh=EZo96YscOuxz/gb46JJh849HZ1PU5RJWeEDdUA9QNcU=; b=Yx3fgB24P9wGyiHUDi7W9tY2T9nX5QHPgI5GDJRGcBQ24SmBO/o+w8o4kGkNOHrh6O aI5++l9hg+GnGJs1sMJHVVeWF9ZRLr9mwuzWPqvXb2qzdCW/w55rEYp2nl3+Fiv59tVg wCoaocgEWa7JwUtq3w/I3Gat4RHSIAi93tcOn4C0xHwBVVHy3WORu7uVze/4D4ZZ7qhu fFDV5x3O/NTo9r5smHw67PWE4srGTMZYoenHXf6Ub/i9coiCWgm2Aq+VBHWyZMhIwfv7 ULyEMHA4/hG8Ftn6IhV0mE4nEyOZJO2RXCgkgYBc3X3ql6vxTy5CXlO9iu+T1nxsEYss h25g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r22-20020aa7c156000000b005254b41f509si5369062edp.329.2023.08.15.08.38.48; Tue, 15 Aug 2023 08:39:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236510AbjHOKoO convert rfc822-to-8bit (ORCPT + 99 others); Tue, 15 Aug 2023 06:44:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236525AbjHOKns (ORCPT ); Tue, 15 Aug 2023 06:43:48 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D5B2198E; Tue, 15 Aug 2023 03:43:40 -0700 (PDT) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 379AD7FD3; Tue, 15 Aug 2023 18:43:37 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 15 Aug 2023 18:43:37 +0800 Received: from [192.168.125.127] (183.27.98.20) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 15 Aug 2023 18:43:35 +0800 Message-ID: <5424ddb2-8f6b-ca15-c2f1-83e3cb9db7b6@starfivetech.com> Date: Tue, 15 Aug 2023 18:43:35 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v3 07/11] PCI: microchip: Rename IRQ init function Content-Language: en-US To: Conor Dooley CC: Daire McNamara , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Emil Renner Berthing , , , , , =?UTF-8?Q?Pali_Roh=c3=a1r?= , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie References: <20230814082016.104181-1-minda.chen@starfivetech.com> <20230814082016.104181-8-minda.chen@starfivetech.com> <20230814-vividness-disgrace-115283ea6f9a@wendy> From: Minda Chen In-Reply-To: <20230814-vividness-disgrace-115283ea6f9a@wendy> Content-Type: text/plain; charset="UTF-8" X-Originating-IP: [183.27.98.20] X-ClientProxiedBy: EXCAS061.cuchost.com (172.16.6.21) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/8/14 21:55, Conor Dooley wrote: > On Mon, Aug 14, 2023 at 04:20:12PM +0800, Minda Chen wrote: >> Rename IRQ init function and prepare for re-use >> IRQ init function. >> >> rename list: >> mc_init_interrupts -> plda_init_interrupts >> mc_pcie_init_irq_domain-> plda_pcie_init_irq_domains >> >> Signed-off-by: Minda Chen >> --- >> .../pci/controller/plda/pcie-microchip-host.c | 37 +++++++++++++------ >> drivers/pci/controller/plda/pcie-plda.h | 7 ++++ >> 2 files changed, 33 insertions(+), 11 deletions(-) >> >> diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c >> index b42f1aac3ec3..140e7ca1a5cb 100644 >> --- a/drivers/pci/controller/plda/pcie-microchip-host.c >> +++ b/drivers/pci/controller/plda/pcie-microchip-host.c >> @@ -559,7 +559,7 @@ static int mc_pcie_init_clks(struct device *dev) >> return 0; >> } >> >> -static int mc_pcie_init_irq_domains(struct plda_pcie_rp *port) >> +static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port, struct plda_evt *evt) >> { >> struct device *dev = port->dev; >> struct device_node *node = dev->of_node; >> @@ -572,8 +572,8 @@ static int mc_pcie_init_irq_domains(struct plda_pcie_rp *port) >> return -EINVAL; >> } >> >> - port->event_domain = irq_domain_add_linear(pcie_intc_node, NUM_EVENTS, >> - &event_domain_ops, port); >> + port->event_domain = irq_domain_add_linear(pcie_intc_node, port->num_events, >> + evt->domain_ops, port); >> if (!port->event_domain) { >> dev_err(dev, "failed to get event domain\n"); >> of_node_put(pcie_intc_node); >> @@ -658,14 +658,15 @@ static void mc_disable_interrupts(struct mc_pcie *port) >> writel_relaxed(GENMASK(31, 0), bridge_base_addr + ISTATUS_HOST); >> } >> >> -static int mc_init_interrupts(struct platform_device *pdev, struct plda_pcie_rp *port) >> +static int plda_init_interrupts(struct platform_device *pdev, >> + struct plda_pcie_rp *port, struct plda_evt *evt) >> { >> struct device *dev = &pdev->dev; >> int irq; >> int i, intx_irq, msi_irq, event_irq; >> int ret; >> >> - ret = mc_pcie_init_irq_domains(port); >> + ret = plda_pcie_init_irq_domains(port, evt); >> if (ret) { >> dev_err(dev, "failed creating IRQ domains\n"); >> return ret; >> @@ -675,15 +676,18 @@ static int mc_init_interrupts(struct platform_device *pdev, struct plda_pcie_rp >> 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); >> return -ENXIO; >> } >> >> - ret = devm_request_irq(dev, event_irq, mc_event_handler, >> - 0, event_cause[i].sym, port); >> + if (evt->request_evt_irq) >> + ret = evt->request_evt_irq(port, event_irq, i); >> + else >> + ret = devm_request_irq(dev, event_irq, plda_event_handler, >> + 0, NULL, port); > > Is there a particular reason this if/else addition ended up in this > patch, but the if/else addition in plda_handle_event() ended up in the > next one? > > Otherwise, this looks fine to me. I forget to modify mc_handle_event(), So leave it to next patch. But I will ended up them in this patches. This patch is to modify, next patch is to move.