Message ID | 20231011110514.107528-17-minda.chen@starfivetech.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp455055vqb; Wed, 11 Oct 2023 04:07:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEOaRet9tFIemtildjywC+lghZd8TBgUNuPqKKiLGqTrBKb1Eb/MphNINB5IuGc5M6WbQoK X-Received: by 2002:a05:6e02:5ce:b0:34f:a4f0:4fc4 with SMTP id l14-20020a056e0205ce00b0034fa4f04fc4mr20334538ils.2.1697022476923; Wed, 11 Oct 2023 04:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697022476; cv=none; d=google.com; s=arc-20160816; b=xtlXO6Fkv8HBa1oYwX3J/DS2Xg0PAGlOdGKI5anUDVxjCvfm7OGcSXzHDoqFMseOic n83kUyhbsPmejFwz+WSB5u/n+8T2D3+YjP/rwQV0IrmaK0LUpb9AW1f7lJz1C5aQ0aMG QmpzUrVkDb1+nEhehub7lEANaBR955VhEJKgSZQJAQhqQfBfSHuYxmZStZQK9Uf1A/9H i4hgbWKiHB0zK35dtIW3BPfTymRjEvKw8OpmtQCIF3WRXIQgdVsK7Ue1dvxs2vEX+Oom YsQVCFmjr5kiqPQDiclfwpD7CrqcsrmSeFUMkHLHvflBraO+Lf5t274HMkoOjzav9zOs rAtg== 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=zVVumXHnzgmGDXM09OOUMS8UxlUfbzhaNcXj5+yCQE8=; fh=ld3UXb1S5Y4IkunPfuj6e9Ppmc+fy6ncC+eQtrVLfK8=; b=sK3gknbvHB0dcMdKJEF6OXanHLwr2A9M6eNv5wEcnZxzXGJPE5HBM6Ix6PmfK3qZ0H YhCzpxLRn38Li2pMj0dBy0xBdjv2WQ15yIaCk2414O8b3iT0d466ICxJQvbEPSIoLm55 goYiNKEKrBQLbBPPi0m7GlIetzg9B26frLuoHxv1Y3yxr30ZEaISuWfP1ULYlROtxbyc z4ImJ9mTLtNImC/HvS4X0xtQqHdzOK7gqQKSsJSR+/5sBGZx7I6yTyOhEwfT32URtcYj krXd6U+MJGmNIfxSt24+H+e8AOa3at74XY6aDId6+6ZDBSZGLVfSLm3nMm3DhcQCJ+ao N+Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id q184-20020a632ac1000000b0056fed6fa634si14089040pgq.433.2023.10.11.04.07.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 04:07:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 9AC1B81583B3; Wed, 11 Oct 2023 04:07:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234941AbjJKLHC (ORCPT <rfc822;kartikey406@gmail.com> + 18 others); Wed, 11 Oct 2023 07:07:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231723AbjJKLFg (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 11 Oct 2023 07:05:36 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8CABB7; Wed, 11 Oct 2023 04:05:31 -0700 (PDT) Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ex01.ufhost.com (Postfix) with ESMTP id 6E3FA24E381; Wed, 11 Oct 2023 19:05:30 +0800 (CST) 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 5795824DEED; Wed, 11 Oct 2023 19:05:30 +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, 11 Oct 2023 19:05:30 +0800 Received: from ubuntu.localdomain (183.27.96.95) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 11 Oct 2023 19:05:29 +0800 From: Minda Chen <minda.chen@starfivetech.com> To: Conor Dooley <conor@kernel.org>, =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= <kw@linux.com>, Rob Herring <robh+dt@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, Lorenzo Pieralisi <lpieralisi@kernel.org>, "Daire McNamara" <daire.mcnamara@microchip.com>, Emil Renner Berthing <emil.renner.berthing@canonical.com>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> CC: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-riscv@lists.infradead.org>, <linux-pci@vger.kernel.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Philipp Zabel <p.zabel@pengutronix.de>, Mason Huo <mason.huo@starfivetech.com>, Leyfoon Tan <leyfoon.tan@starfivetech.com>, Kevin Xie <kevin.xie@starfivetech.com>, Minda Chen <minda.chen@starfivetech.com> Subject: [PATCH v8 16/22] PCI: microchip: Add event IRQ domain ops to struct plda_event Date: Wed, 11 Oct 2023 19:05:08 +0800 Message-ID: <20231011110514.107528-17-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231011110514.107528-1-minda.chen@starfivetech.com> References: <20231011110514.107528-1-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [183.27.96.95] 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=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 11 Oct 2023 04:07:36 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779457040911992497 X-GMAIL-MSGID: 1779457040911992497 |
Series |
Refactoring Microchip PCIe driver and add StarFive PCIe
|
|
Commit Message
Minda Chen
Oct. 11, 2023, 11:05 a.m. UTC
PolarFire Implements none-PLDA event interrupts. So the whole event
domain ops can not be re-used.
PLDA event domain ops instances will be implemented
in later patch.
Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
---
drivers/pci/controller/plda/pcie-microchip-host.c | 9 ++++++---
drivers/pci/controller/plda/pcie-plda.h | 1 +
2 files changed, 7 insertions(+), 3 deletions(-)
Comments
On Wed, Oct 11, 2023 at 07:05:08PM +0800, Minda Chen wrote: > PolarFire Implements none-PLDA event interrupts. So the whole event > domain ops can not be re-used. IIRC, the reason things are like this is to work around the lack of an msi controller and are not as a result of changes made to the PLDA IP by us. > PLDA event domain ops instances will be implemented > in later patch. Acked-by: Conor Dooley <conor.dooley@microchip.com> Thanks, Conor. > > Signed-off-by: Minda Chen <minda.chen@starfivetech.com> > --- > drivers/pci/controller/plda/pcie-microchip-host.c | 9 ++++++--- > drivers/pci/controller/plda/pcie-plda.h | 1 + > 2 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c > index fca1520d56c9..2825c1f5563d 100644 > --- a/drivers/pci/controller/plda/pcie-microchip-host.c > +++ b/drivers/pci/controller/plda/pcie-microchip-host.c > @@ -811,13 +811,15 @@ static const struct plda_event_ops mc_event_ops = { > }; > > static const struct plda_event mc_event = { > + .domain_ops = &mc_event_domain_ops, > .event_ops = &mc_event_ops, > .request_event_irq = mc_request_event_irq, > .intx_event = EVENT_LOCAL_PM_MSI_INT_INTX, > .msi_event = EVENT_LOCAL_PM_MSI_INT_MSI, > }; > > -static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port) > +static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port, > + const struct irq_domain_ops *ops) > { > struct device *dev = port->dev; > struct device_node *node = dev->of_node; > @@ -831,7 +833,8 @@ static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port) > } > > port->event_domain = irq_domain_add_linear(pcie_intc_node, port->num_events, > - &mc_event_domain_ops, port); > + ops, port); > + > if (!port->event_domain) { > dev_err(dev, "failed to get event domain\n"); > of_node_put(pcie_intc_node); > @@ -930,7 +933,7 @@ static int plda_init_interrupts(struct platform_device *pdev, > return -EINVAL; > } > > - ret = plda_pcie_init_irq_domains(port); > + ret = plda_pcie_init_irq_domains(port, event->domain_ops); > if (ret) { > dev_err(dev, "failed creating IRQ domains\n"); > return ret; > diff --git a/drivers/pci/controller/plda/pcie-plda.h b/drivers/pci/controller/plda/pcie-plda.h > index 6571a4befac9..080932cbe8c4 100644 > --- a/drivers/pci/controller/plda/pcie-plda.h > +++ b/drivers/pci/controller/plda/pcie-plda.h > @@ -129,6 +129,7 @@ struct plda_pcie_rp { > }; > > struct plda_event { > + const struct irq_domain_ops *domain_ops; > const struct plda_event_ops *event_ops; > int (*request_event_irq)(struct plda_pcie_rp *pcie, > int event_irq, int event); > -- > 2.17.1 >
On 2023/10/18 19:30, Conor Dooley wrote: > On Wed, Oct 11, 2023 at 07:05:08PM +0800, Minda Chen wrote: >> PolarFire Implements none-PLDA event interrupts. So the whole event >> domain ops can not be re-used. > > IIRC, the reason things are like this is to work around the lack of an > msi controller and are not as a result of changes made to the PLDA IP > by us. > Oh. For this reason that new added interrupts have to add to global events field, not the MSI. I will add this to commit messages. Thanks >> PLDA event domain ops instances will be implemented >> in later patch. > > Acked-by: Conor Dooley <conor.dooley@microchip.com> > > Thanks, > Conor. > >> >> Signed-off-by: Minda Chen <minda.chen@starfivetech.com> >> --- >> drivers/pci/controller/plda/pcie-microchip-host.c | 9 ++++++--- >> drivers/pci/controller/plda/pcie-plda.h | 1 + >> 2 files changed, 7 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c >> index fca1520d56c9..2825c1f5563d 100644 >> --- a/drivers/pci/controller/plda/pcie-microchip-host.c >> +++ b/drivers/pci/controller/plda/pcie-microchip-host.c >> @@ -811,13 +811,15 @@ static const struct plda_event_ops mc_event_ops = { >> }; >> >> static const struct plda_event mc_event = { >> + .domain_ops = &mc_event_domain_ops, >> .event_ops = &mc_event_ops, >> .request_event_irq = mc_request_event_irq, >> .intx_event = EVENT_LOCAL_PM_MSI_INT_INTX, >> .msi_event = EVENT_LOCAL_PM_MSI_INT_MSI, >> }; >> >> -static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port) >> +static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port, >> + const struct irq_domain_ops *ops) >> { >> struct device *dev = port->dev; >> struct device_node *node = dev->of_node; >> @@ -831,7 +833,8 @@ static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port) >> } >> >> port->event_domain = irq_domain_add_linear(pcie_intc_node, port->num_events, >> - &mc_event_domain_ops, port); >> + ops, port); >> + >> if (!port->event_domain) { >> dev_err(dev, "failed to get event domain\n"); >> of_node_put(pcie_intc_node); >> @@ -930,7 +933,7 @@ static int plda_init_interrupts(struct platform_device *pdev, >> return -EINVAL; >> } >> >> - ret = plda_pcie_init_irq_domains(port); >> + ret = plda_pcie_init_irq_domains(port, event->domain_ops); >> if (ret) { >> dev_err(dev, "failed creating IRQ domains\n"); >> return ret; >> diff --git a/drivers/pci/controller/plda/pcie-plda.h b/drivers/pci/controller/plda/pcie-plda.h >> index 6571a4befac9..080932cbe8c4 100644 >> --- a/drivers/pci/controller/plda/pcie-plda.h >> +++ b/drivers/pci/controller/plda/pcie-plda.h >> @@ -129,6 +129,7 @@ struct plda_pcie_rp { >> }; >> >> struct plda_event { >> + const struct irq_domain_ops *domain_ops; >> const struct plda_event_ops *event_ops; >> int (*request_event_irq)(struct plda_pcie_rp *pcie, >> int event_irq, int event); >> -- >> 2.17.1 >>
diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c index fca1520d56c9..2825c1f5563d 100644 --- a/drivers/pci/controller/plda/pcie-microchip-host.c +++ b/drivers/pci/controller/plda/pcie-microchip-host.c @@ -811,13 +811,15 @@ static const struct plda_event_ops mc_event_ops = { }; static const struct plda_event mc_event = { + .domain_ops = &mc_event_domain_ops, .event_ops = &mc_event_ops, .request_event_irq = mc_request_event_irq, .intx_event = EVENT_LOCAL_PM_MSI_INT_INTX, .msi_event = EVENT_LOCAL_PM_MSI_INT_MSI, }; -static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port) +static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port, + const struct irq_domain_ops *ops) { struct device *dev = port->dev; struct device_node *node = dev->of_node; @@ -831,7 +833,8 @@ static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port) } port->event_domain = irq_domain_add_linear(pcie_intc_node, port->num_events, - &mc_event_domain_ops, port); + ops, port); + if (!port->event_domain) { dev_err(dev, "failed to get event domain\n"); of_node_put(pcie_intc_node); @@ -930,7 +933,7 @@ static int plda_init_interrupts(struct platform_device *pdev, return -EINVAL; } - ret = plda_pcie_init_irq_domains(port); + ret = plda_pcie_init_irq_domains(port, event->domain_ops); if (ret) { dev_err(dev, "failed creating IRQ domains\n"); return ret; diff --git a/drivers/pci/controller/plda/pcie-plda.h b/drivers/pci/controller/plda/pcie-plda.h index 6571a4befac9..080932cbe8c4 100644 --- a/drivers/pci/controller/plda/pcie-plda.h +++ b/drivers/pci/controller/plda/pcie-plda.h @@ -129,6 +129,7 @@ struct plda_pcie_rp { }; struct plda_event { + const struct irq_domain_ops *domain_ops; const struct plda_event_ops *event_ops; int (*request_event_irq)(struct plda_pcie_rp *pcie, int event_irq, int event);