[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240623142235.085171290@linutronix.de>
Date: Sun, 23 Jun 2024 17:18:41 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: LKML <linux-kernel@...r.kernel.org>
Cc: linux-arm-kernel@...ts.infradead.org,
linux-pci@...r.kernel.org,
maz@...nel.org,
tglx@...utronix.de,
anna-maria@...utronix.de,
shawnguo@...nel.org,
s.hauer@...gutronix.de,
festevam@...il.com,
bhelgaas@...gle.com,
rdunlap@...radead.org,
vidyas@...dia.com,
ilpo.jarvinen@...ux.intel.com,
apatel@...tanamicro.com,
kevin.tian@...el.com,
nipun.gupta@....com,
den@...inux.co.jp,
andrew@...n.ch,
gregory.clement@...tlin.com,
sebastian.hesselbarth@...il.com,
gregkh@...uxfoundation.org,
rafael@...nel.org,
alex.williamson@...hat.com,
will@...nel.org,
lorenzo.pieralisi@....com,
jgg@...lanox.com,
ammarfaizi2@...weeb.org,
robin.murphy@....com,
lpieralisi@...nel.org,
nm@...com,
kristo@...nel.org,
vkoul@...nel.org,
okaya@...nel.org,
agross@...nel.org,
andersson@...nel.org,
mark.rutland@....com,
shameerali.kolothum.thodi@...wei.com,
yuzenghui@...wei.com,
shivamurthy.shastri@...utronix.de
Subject: [patch V4 06/21] irqchip/irq-msi-lib: Prepare for DEVICE MSI to
replace platform MSI
From: Thomas Gleixner <tglx@...utronix.de>
Add the prerequisites for DEVICE MSI into the shared select() and child
domain init function. These domains are really trivial and just provide a
custom irq chip callback to write the MSI message.
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Anna-Maria Behnsen <anna-maria@...utronix.de>
Signed-off-by: Shivamurthy Shastri <shivamurthy.shastri@...utronix.de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
v3: adopted to IMS->MSI rename
---
drivers/irqchip/irq-msi-lib.c | 13 +++++++++++++
drivers/irqchip/irq-msi-lib.h | 2 ++
2 files changed, 15 insertions(+)
diff --git a/drivers/irqchip/irq-msi-lib.c b/drivers/irqchip/irq-msi-lib.c
index 0b359c5d8c6c..6aa4974d2d12 100644
--- a/drivers/irqchip/irq-msi-lib.c
+++ b/drivers/irqchip/irq-msi-lib.c
@@ -53,6 +53,19 @@ bool msi_lib_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
if (WARN_ON_ONCE(!IS_ENABLED(CONFIG_PCI_MSI)))
return false;
+ break;
+ case DOMAIN_BUS_DEVICE_MSI:
+ /*
+ * Per device MSI should never have any MSI feature bits
+ * set. It's sole purpose is to create a dumb interrupt
+ * chip which has a device specific irq_write_msi_msg()
+ * callback.
+ */
+ if (WARN_ON_ONCE(info->flags))
+ return false;
+
+ /* Core managed MSI descriptors */
+ info->flags = MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS | MSI_FLAG_FREE_MSI_DESCS;
break;
default:
/*
diff --git a/drivers/irqchip/irq-msi-lib.h b/drivers/irqchip/irq-msi-lib.h
index 525aa5284a99..681ceabb7bc7 100644
--- a/drivers/irqchip/irq-msi-lib.h
+++ b/drivers/irqchip/irq-msi-lib.h
@@ -15,6 +15,8 @@
#define MATCH_PCI_MSI (0)
#endif
+#define MATCH_PLATFORM_MSI BIT(DOMAIN_BUS_PLATFORM_MSI)
+
int msi_lib_irq_domain_select(struct irq_domain *d, struct irq_fwspec *fwspec,
enum irq_domain_bus_token bus_token);
--
2.34.1
Powered by blists - more mailing lists