From: Frank Li <Frank.Li@nxp.com>
To: "Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Anup Patel" <apatel@ventanamicro.com>,
"Marc Zyngier" <maz@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
imx@lists.linux.dev, Niklas Cassel <cassel@kernel.org>,
dlemoal@kernel.org, jdmason@kudzu.us,
linux-arm-kernel@lists.infradead.org,
Frank Li <Frank.Li@nxp.com>
Subject: [PATCH v13 3/9] irqchip/gic-v3-its: Add helper function its_pmsi_prepare_devid()
Date: Wed, 18 Dec 2024 18:08:38 -0500 [thread overview]
Message-ID: <20241218-ep-msi-v13-3-646e2192dc24@nxp.com> (raw)
In-Reply-To: <20241218-ep-msi-v13-0-646e2192dc24@nxp.com>
Add helper function its_pmsi_prepare_devid() to pave road to support new
DOMAIN_BUS_DEVICE_PCI_EP_MSI. No function change.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
change from v12 to v13
- new patch
---
drivers/irqchip/irq-gic-v3-its-msi-parent.c | 30 ++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3-its-msi-parent.c b/drivers/irqchip/irq-gic-v3-its-msi-parent.c
index 75aa0d4bd1346..b2a4b67545b82 100644
--- a/drivers/irqchip/irq-gic-v3-its-msi-parent.c
+++ b/drivers/irqchip/irq-gic-v3-its-msi-parent.c
@@ -132,19 +132,10 @@ int __weak iort_pmsi_get_dev_id(struct device *dev, u32 *dev_id)
return -1;
}
-static int its_pmsi_prepare(struct irq_domain *domain, struct device *dev,
- int nvec, msi_alloc_info_t *info)
+static int its_pmsi_prepare_devid(struct irq_domain *domain, struct device *dev,
+ int nvec, msi_alloc_info_t *info, u32 dev_id)
{
struct msi_domain_info *msi_info;
- u32 dev_id;
- int ret;
-
- if (dev->of_node)
- ret = of_pmsi_get_dev_id(domain->parent, dev, &dev_id);
- else
- ret = iort_pmsi_get_dev_id(dev, &dev_id);
- if (ret)
- return ret;
/* ITS specific DeviceID, as the core ITS ignores dev. */
info->scratchpad[0].ul = dev_id;
@@ -165,6 +156,23 @@ static int its_pmsi_prepare(struct irq_domain *domain, struct device *dev,
dev, nvec, info);
}
+static int its_pmsi_prepare(struct irq_domain *domain, struct device *dev,
+ int nvec, msi_alloc_info_t *info)
+{
+ u32 dev_id;
+ int ret;
+
+ if (dev->of_node)
+ ret = of_pmsi_get_dev_id(domain->parent, dev, &dev_id);
+ else
+ ret = iort_pmsi_get_dev_id(dev, &dev_id);
+
+ if (ret)
+ return ret;
+
+ return its_pmsi_prepare_devid(domain, dev, nvec, info, dev_id);
+}
+
static bool its_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
struct irq_domain *real_parent, struct msi_domain_info *info)
{
--
2.34.1
next prev parent reply other threads:[~2024-12-18 23:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-18 23:08 [PATCH v13 0/9] PCI: EP: Add RC-to-EP doorbell with platform MSI controller Frank Li
2024-12-18 23:08 ` [PATCH v13 1/9] genirq/msi: Provide DOMAIN_BUS_PLATFORM_PCI_EP_MSI Frank Li
2024-12-18 23:08 ` [PATCH v13 2/9] PCI: EP: Add helper function pci_epf_msi_domain_get_msi_rid() Frank Li
2024-12-18 23:08 ` Frank Li [this message]
2024-12-18 23:08 ` [PATCH v13 4/9] irqchip/gic-v3-its: Add DOMAIN_BUS_DEVICE_PCI_EP_MSI support Frank Li
2024-12-19 10:52 ` Marc Zyngier
2024-12-19 17:02 ` Frank Li
2024-12-19 20:10 ` Niklas Cassel
2024-12-19 20:17 ` Frank Li
2024-12-19 20:43 ` Niklas Cassel
2024-12-19 20:53 ` Frank Li
2025-01-06 16:38 ` Frank Li
2025-01-06 17:13 ` Marc Zyngier
2025-01-06 18:20 ` Frank Li
2025-01-13 16:11 ` Frank Li
2025-01-20 21:20 ` Frank Li
2024-12-18 23:08 ` [PATCH v13 5/9] PCI: endpoint: Add RC-to-EP doorbell support using platform MSI controller Frank Li
2024-12-18 23:08 ` [PATCH v13 6/9] PCI: endpoint: Add pci_epf_align_inbound_addr() helper for address alignment Frank Li
2024-12-18 23:08 ` [PATCH v13 7/9] PCI: endpoint: pci-epf-test: Add doorbell test support Frank Li
2024-12-18 23:08 ` [PATCH v13 8/9] misc: pci_endpoint_test: Add doorbell test case Frank Li
2024-12-18 23:08 ` [PATCH v13 9/9] tools: PCI: Add 'B' option for test doorbell Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241218-ep-msi-v13-3-646e2192dc24@nxp.com \
--to=frank.li@nxp.com \
--cc=apatel@ventanamicro.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=imx@lists.linux.dev \
--cc=jdmason@kudzu.us \
--cc=kishon@kernel.org \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=maz@kernel.org \
--cc=rafael@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox