Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3452788rdb; Wed, 27 Dec 2023 07:52:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmLl+UGuxr5ioVeZj6I91vqNq+V9hE58VH3TZVpLa7KTTQrg2Yn/RqCghhlvd0JgAMbiZm X-Received: by 2002:a05:622a:314:b0:427:87d3:612a with SMTP id q20-20020a05622a031400b0042787d3612amr9796830qtw.28.1703692374729; Wed, 27 Dec 2023 07:52:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703692374; cv=none; d=google.com; s=arc-20160816; b=qP25Yk8i6AQZqiLKYLAMaMEsgqusIibEaRQFOiqiOw26OMLzMhGgRxeHKgI4Hv1rv1 c1z8sZxDM44ttFLzdkYHC67lwOgRRr1TZ0X5CkqKlTubx6CKL1Xd/G5XhFTeKNjGZca9 f9d/6U4dTTYIvNTf3Y9TB0qkNEjew5C0dmGsxmHwO0vyYbumKUxHsyoxLlSH4WxMf85Y wb7rUrGIbwEVnO/nl5UxRtu5kIi9pxzEUIHQUEotWsEZvcbVCyAOLq3/p1Ecfnl2eRro aQ0023JMm2z+460FzgbmfS8ZMoSFlbg1GajxyrTWE+DpfZY41iRpp+qLo/8sD3jmSz2c E5Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=D5jeSWDGg57w7lFpc/wkhlb4zWws1alPihELIHH3188=; fh=fPOM0qMwOVM+EThLToRM6IhB27HrQzIPXkBOD5SQzr8=; b=dmGP5wt9PzYOREl8Cwg9pK3Zi8st/yrpIt9iaRPS5n+i+KxynlIB/NptXzwX/f6Df3 UQtGgaGR+WngfwbBadkbZHRgCHUV2NpuiYUNCxGjs6HepxcOY9xq/lpd4idOy3k+xpeu Z22QT5rvsG3tyGtMvjJZM8/NBk1FxWMKavIqqCmJV8AMe6HlQz4oNNpIoOFUDPHyVs8L N+hMEDAcNLJ60Op9KZFBG4Os09iew0MctZYWWPn74S5vhW51791GZ7Pu7mL+nHd14lW8 lRRtuAzHIa6ygO+Bwle1GGwdCUu+mHk5xI86wTRlL7aYARAuu/x1BfusXjvNlJcxvi8Y N00w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=krFHbGEK; spf=pass (google.com: domain of linux-kernel+bounces-12093-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12093-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v12-20020ac8578c000000b00427eb8c3faasi1848860qta.331.2023.12.27.07.52.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 07:52:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12093-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=krFHbGEK; spf=pass (google.com: domain of linux-kernel+bounces-12093-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12093-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6C2EA1C21624 for ; Wed, 27 Dec 2023 15:52:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 46EB345BE9; Wed, 27 Dec 2023 15:52:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="krFHbGEK" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74B9D45957; Wed, 27 Dec 2023 15:52:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2153C433C8; Wed, 27 Dec 2023 15:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703692364; bh=HUUYT38ijS88V+WbIgD3c5c1zlkbxXthc/FJwbEx62M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=krFHbGEKwa3sp5P7T8YbE9CQnxN5frHCiFM3wj92vajrUHDcyZ78nGYpZWyLf+Yhh qq0VZmTTCd7u2Ua16kno8di8DO7egsUO248gk2QFof3Mhi9W2z5BezfkfD3RQr0Wcy 1nn2D8l216wF8IXnmVpcMlMH/ocRjuLW4zKBOJAPpjgVkjKF7tyE6r3lP2UNWXF9Ab WkRvNIrqNMvDAnAuWVdSCVdAYweL1wPTVfGmXd1pQoJzCwFo4ebqsdQvHeR+mfY6dA X7elROsAS7w4MX4sfpU1kUTdZIOrJDYIv3v0blYcgZ5gEiKMzhkviQtnhMghcAm1Gn /Ka8mXWoLaneg== Date: Wed, 27 Dec 2023 16:52:35 +0100 From: Lorenzo Pieralisi To: Minda Chen Cc: Conor Dooley , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Daire McNamara , Emil Renner Berthing , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-pci@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie Subject: Re: [PATCH v13 10/21] PCI: microchip: Rename interrupt related functions Message-ID: References: <20231214072839.2367-1-minda.chen@starfivetech.com> <20231214072839.2367-11-minda.chen@starfivetech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231214072839.2367-11-minda.chen@starfivetech.com> On Thu, Dec 14, 2023 at 03:28:28PM +0800, Minda Chen wrote: > Rename mc_* to plda_* for IRQ functions and related IRQ domain ops data > instances. > > MSI, INTx interrupt codes and IRQ init codes are all can be re-used. s/codes/code > > - function rename list: > mc_allocate_msi_domains() --> plda_allocate_msi_domains() > mc_init_interrupts() --> plda_init_interrupts() > mc_pcie_init_irq_domain() --> plda_pcie_init_irq_domains() > mc_handle_event() --> plda_handle_event() > get_events() --> mc_get_events() > > MSI interrupts related functions and IRQ domain > (primary function is mc_handle_msi()): > mc_handle_msi() --> plda_handle_msi() > INTx interrupts related functions and IRQ domain > (primary function is mc_handle_intx()): > mc_handle_intx() --> plda_handle_intx() We can read the code you are changing, there is no need to add it to the commit log, especially because it is a trivial rename here. > Signed-off-by: Minda Chen > Acked-by: Conor Dooley > --- > .../pci/controller/plda/pcie-microchip-host.c | 112 +++++++++--------- > 1 file changed, 59 insertions(+), 53 deletions(-) > > diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c > index 2e79bcc7c0a5..506e6eeadc76 100644 > --- a/drivers/pci/controller/plda/pcie-microchip-host.c > +++ b/drivers/pci/controller/plda/pcie-microchip-host.c > @@ -318,7 +318,7 @@ static void mc_pcie_enable_msi(struct mc_pcie *port, void __iomem *ecam) > ecam + MC_MSI_CAP_CTRL_OFFSET + PCI_MSI_ADDRESS_HI); > } > > -static void mc_handle_msi(struct irq_desc *desc) > +static void plda_handle_msi(struct irq_desc *desc) > { > struct plda_pcie_rp *port = irq_desc_get_handler_data(desc); > struct irq_chip *chip = irq_desc_get_chip(desc); > @@ -333,7 +333,8 @@ static void mc_handle_msi(struct irq_desc *desc) > > status = readl_relaxed(bridge_base_addr + ISTATUS_LOCAL); > if (status & PM_MSI_INT_MSI_MASK) { > - writel_relaxed(status & PM_MSI_INT_MSI_MASK, bridge_base_addr + ISTATUS_LOCAL); > + writel_relaxed(status & PM_MSI_INT_MSI_MASK, > + bridge_base_addr + ISTATUS_LOCAL); Unrelated change (I suspect checkpatch nudged you to make it; it is tempting but it does not belong in this patch). Lorenzo > status = readl_relaxed(bridge_base_addr + ISTATUS_MSI); > for_each_set_bit(bit, &status, msi->num_vectors) { > ret = generic_handle_domain_irq(msi->dev_domain, bit); > @@ -346,7 +347,7 @@ static void mc_handle_msi(struct irq_desc *desc) > chained_irq_exit(chip, desc); > } > > -static void mc_msi_bottom_irq_ack(struct irq_data *data) > +static void plda_msi_bottom_irq_ack(struct irq_data *data) > { > struct plda_pcie_rp *port = irq_data_get_irq_chip_data(data); > void __iomem *bridge_base_addr = port->bridge_addr; > @@ -355,7 +356,7 @@ static void mc_msi_bottom_irq_ack(struct irq_data *data) > writel_relaxed(BIT(bitpos), bridge_base_addr + ISTATUS_MSI); > } > > -static void mc_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) > +static void plda_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) > { > struct plda_pcie_rp *port = irq_data_get_irq_chip_data(data); > phys_addr_t addr = port->msi.vector_phy; > @@ -368,21 +369,23 @@ static void mc_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) > (int)data->hwirq, msg->address_hi, msg->address_lo); > } > > -static int mc_msi_set_affinity(struct irq_data *irq_data, > - const struct cpumask *mask, bool force) > +static int plda_msi_set_affinity(struct irq_data *irq_data, > + const struct cpumask *mask, bool force) > { > return -EINVAL; > } > > -static struct irq_chip mc_msi_bottom_irq_chip = { > - .name = "Microchip MSI", > - .irq_ack = mc_msi_bottom_irq_ack, > - .irq_compose_msi_msg = mc_compose_msi_msg, > - .irq_set_affinity = mc_msi_set_affinity, > +static struct irq_chip plda_msi_bottom_irq_chip = { > + .name = "PLDA MSI", > + .irq_ack = plda_msi_bottom_irq_ack, > + .irq_compose_msi_msg = plda_compose_msi_msg, > + .irq_set_affinity = plda_msi_set_affinity, > }; > > -static int mc_irq_msi_domain_alloc(struct irq_domain *domain, unsigned int virq, > - unsigned int nr_irqs, void *args) > +static int plda_irq_msi_domain_alloc(struct irq_domain *domain, > + unsigned int virq, > + unsigned int nr_irqs, > + void *args) > { > struct plda_pcie_rp *port = domain->host_data; > struct plda_msi *msi = &port->msi; > @@ -397,7 +400,7 @@ static int mc_irq_msi_domain_alloc(struct irq_domain *domain, unsigned int virq, > > set_bit(bit, msi->used); > > - irq_domain_set_info(domain, virq, bit, &mc_msi_bottom_irq_chip, > + irq_domain_set_info(domain, virq, bit, &plda_msi_bottom_irq_chip, > domain->host_data, handle_edge_irq, NULL, NULL); > > mutex_unlock(&msi->lock); > @@ -405,8 +408,9 @@ static int mc_irq_msi_domain_alloc(struct irq_domain *domain, unsigned int virq, > return 0; > } > > -static void mc_irq_msi_domain_free(struct irq_domain *domain, unsigned int virq, > - unsigned int nr_irqs) > +static void plda_irq_msi_domain_free(struct irq_domain *domain, > + unsigned int virq, > + unsigned int nr_irqs) > { > struct irq_data *d = irq_domain_get_irq_data(domain, virq); > struct plda_pcie_rp *port = irq_data_get_irq_chip_data(d); > @@ -423,24 +427,24 @@ static void mc_irq_msi_domain_free(struct irq_domain *domain, unsigned int virq, > } > > static const struct irq_domain_ops msi_domain_ops = { > - .alloc = mc_irq_msi_domain_alloc, > - .free = mc_irq_msi_domain_free, > + .alloc = plda_irq_msi_domain_alloc, > + .free = plda_irq_msi_domain_free, > }; > > -static struct irq_chip mc_msi_irq_chip = { > - .name = "Microchip PCIe MSI", > +static struct irq_chip plda_msi_irq_chip = { > + .name = "PLDA PCIe MSI", > .irq_ack = irq_chip_ack_parent, > .irq_mask = pci_msi_mask_irq, > .irq_unmask = pci_msi_unmask_irq, > }; > > -static struct msi_domain_info mc_msi_domain_info = { > +static struct msi_domain_info plda_msi_domain_info = { > .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS | > MSI_FLAG_PCI_MSIX), > - .chip = &mc_msi_irq_chip, > + .chip = &plda_msi_irq_chip, > }; > > -static int mc_allocate_msi_domains(struct plda_pcie_rp *port) > +static int plda_allocate_msi_domains(struct plda_pcie_rp *port) > { > struct device *dev = port->dev; > struct fwnode_handle *fwnode = of_node_to_fwnode(dev->of_node); > @@ -455,7 +459,8 @@ static int mc_allocate_msi_domains(struct plda_pcie_rp *port) > return -ENOMEM; > } > > - msi->msi_domain = pci_msi_create_irq_domain(fwnode, &mc_msi_domain_info, > + msi->msi_domain = pci_msi_create_irq_domain(fwnode, > + &plda_msi_domain_info, > msi->dev_domain); > if (!msi->msi_domain) { > dev_err(dev, "failed to create MSI domain\n"); > @@ -466,7 +471,7 @@ static int mc_allocate_msi_domains(struct plda_pcie_rp *port) > return 0; > } > > -static void mc_handle_intx(struct irq_desc *desc) > +static void plda_handle_intx(struct irq_desc *desc) > { > struct plda_pcie_rp *port = irq_desc_get_handler_data(desc); > struct irq_chip *chip = irq_desc_get_chip(desc); > @@ -493,7 +498,7 @@ static void mc_handle_intx(struct irq_desc *desc) > chained_irq_exit(chip, desc); > } > > -static void mc_ack_intx_irq(struct irq_data *data) > +static void plda_ack_intx_irq(struct irq_data *data) > { > struct plda_pcie_rp *port = irq_data_get_irq_chip_data(data); > void __iomem *bridge_base_addr = port->bridge_addr; > @@ -502,7 +507,7 @@ static void mc_ack_intx_irq(struct irq_data *data) > writel_relaxed(mask, bridge_base_addr + ISTATUS_LOCAL); > } > > -static void mc_mask_intx_irq(struct irq_data *data) > +static void plda_mask_intx_irq(struct irq_data *data) > { > struct plda_pcie_rp *port = irq_data_get_irq_chip_data(data); > void __iomem *bridge_base_addr = port->bridge_addr; > @@ -517,7 +522,7 @@ static void mc_mask_intx_irq(struct irq_data *data) > raw_spin_unlock_irqrestore(&port->lock, flags); > } > > -static void mc_unmask_intx_irq(struct irq_data *data) > +static void plda_unmask_intx_irq(struct irq_data *data) > { > struct plda_pcie_rp *port = irq_data_get_irq_chip_data(data); > void __iomem *bridge_base_addr = port->bridge_addr; > @@ -532,24 +537,24 @@ static void mc_unmask_intx_irq(struct irq_data *data) > raw_spin_unlock_irqrestore(&port->lock, flags); > } > > -static struct irq_chip mc_intx_irq_chip = { > - .name = "Microchip PCIe INTx", > - .irq_ack = mc_ack_intx_irq, > - .irq_mask = mc_mask_intx_irq, > - .irq_unmask = mc_unmask_intx_irq, > +static struct irq_chip plda_intx_irq_chip = { > + .name = "PLDA PCIe INTx", > + .irq_ack = plda_ack_intx_irq, > + .irq_mask = plda_mask_intx_irq, > + .irq_unmask = plda_unmask_intx_irq, > }; > > -static int mc_pcie_intx_map(struct irq_domain *domain, unsigned int irq, > - irq_hw_number_t hwirq) > +static int plda_pcie_intx_map(struct irq_domain *domain, unsigned int irq, > + irq_hw_number_t hwirq) > { > - irq_set_chip_and_handler(irq, &mc_intx_irq_chip, handle_level_irq); > + irq_set_chip_and_handler(irq, &plda_intx_irq_chip, handle_level_irq); > irq_set_chip_data(irq, domain->host_data); > > return 0; > } > > static const struct irq_domain_ops intx_domain_ops = { > - .map = mc_pcie_intx_map, > + .map = plda_pcie_intx_map, > }; > > static inline u32 reg_to_event(u32 reg, struct event_map field) > @@ -609,7 +614,7 @@ static u32 local_events(struct mc_pcie *port) > return val; > } > > -static u32 get_events(struct plda_pcie_rp *port) > +static u32 mc_get_events(struct plda_pcie_rp *port) > { > struct mc_pcie *mc_port = container_of(port, struct mc_pcie, plda); > u32 events = 0; > @@ -638,7 +643,7 @@ static irqreturn_t mc_event_handler(int irq, void *dev_id) > return IRQ_HANDLED; > } > > -static void mc_handle_event(struct irq_desc *desc) > +static void plda_handle_event(struct irq_desc *desc) > { > struct plda_pcie_rp *port = irq_desc_get_handler_data(desc); > unsigned long events; > @@ -647,7 +652,7 @@ static void mc_handle_event(struct irq_desc *desc) > > chained_irq_enter(chip, desc); > > - events = get_events(port); > + events = mc_get_events(port); > > for_each_set_bit(bit, &events, NUM_EVENTS) > generic_handle_domain_irq(port->event_domain, bit); > @@ -741,8 +746,8 @@ static struct irq_chip mc_event_irq_chip = { > .irq_unmask = mc_unmask_event_irq, > }; > > -static int mc_pcie_event_map(struct irq_domain *domain, unsigned int irq, > - irq_hw_number_t hwirq) > +static int plda_pcie_event_map(struct irq_domain *domain, unsigned int irq, > + irq_hw_number_t hwirq) > { > irq_set_chip_and_handler(irq, &mc_event_irq_chip, handle_level_irq); > irq_set_chip_data(irq, domain->host_data); > @@ -750,8 +755,8 @@ static int mc_pcie_event_map(struct irq_domain *domain, unsigned int irq, > return 0; > } > > -static const struct irq_domain_ops event_domain_ops = { > - .map = mc_pcie_event_map, > +static const struct irq_domain_ops plda_event_domain_ops = { > + .map = plda_pcie_event_map, > }; > > static inline void mc_pcie_deinit_clk(void *data) > @@ -799,7 +804,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 device *dev = port->dev; > struct device_node *node = dev->of_node; > @@ -813,7 +818,8 @@ static int mc_pcie_init_irq_domains(struct plda_pcie_rp *port) > } > > port->event_domain = irq_domain_add_linear(pcie_intc_node, NUM_EVENTS, > - &event_domain_ops, port); > + &plda_event_domain_ops, > + port); > if (!port->event_domain) { > dev_err(dev, "failed to get event domain\n"); > of_node_put(pcie_intc_node); > @@ -835,7 +841,7 @@ static int mc_pcie_init_irq_domains(struct plda_pcie_rp *port) > of_node_put(pcie_intc_node); > raw_spin_lock_init(&port->lock); > > - return mc_allocate_msi_domains(port); > + return plda_allocate_msi_domains(port); > } > > static inline void mc_clear_secs(struct mc_pcie *port) > @@ -898,14 +904,14 @@ 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 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); > if (ret) { > dev_err(dev, "failed creating IRQ domains\n"); > return ret; > @@ -938,7 +944,7 @@ static int mc_init_interrupts(struct platform_device *pdev, struct plda_pcie_rp > } > > /* Plug the INTx chained handler */ > - irq_set_chained_handler_and_data(intx_irq, mc_handle_intx, port); > + irq_set_chained_handler_and_data(intx_irq, plda_handle_intx, port); > > msi_irq = irq_create_mapping(port->event_domain, > EVENT_LOCAL_PM_MSI_INT_MSI); > @@ -946,10 +952,10 @@ static int mc_init_interrupts(struct platform_device *pdev, struct plda_pcie_rp > return -ENXIO; > > /* Plug the MSI chained handler */ > - irq_set_chained_handler_and_data(msi_irq, mc_handle_msi, port); > + irq_set_chained_handler_and_data(msi_irq, plda_handle_msi, port); > > /* Plug the main event chained handler */ > - irq_set_chained_handler_and_data(irq, mc_handle_event, port); > + irq_set_chained_handler_and_data(irq, plda_handle_event, port); > > return 0; > } > @@ -977,7 +983,7 @@ static int mc_platform_init(struct pci_config_window *cfg) > return ret; > > /* Address translation is up; safe to enable interrupts */ > - ret = mc_init_interrupts(pdev, &port->plda); > + ret = plda_init_interrupts(pdev, &port->plda); > if (ret) > return ret; > > -- > 2.17.1 >