Skip to content

Commit 496436f

Browse files
committed
irqchip/irq-msi-lib: Prepare for DEVICE MSI to replace platform MSI
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 <[email protected]> Signed-off-by: Anna-Maria Behnsen <[email protected]> Signed-off-by: Shivamurthy Shastri <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b5712bf commit 496436f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

drivers/irqchip/irq-msi-lib.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,21 @@ bool msi_lib_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
5656
if (WARN_ON_ONCE(!IS_ENABLED(CONFIG_PCI_MSI)))
5757
return false;
5858

59+
break;
60+
case DOMAIN_BUS_DEVICE_MSI:
61+
/*
62+
* Per device MSI should never have any MSI feature bits
63+
* set. It's sole purpose is to create a dumb interrupt
64+
* chip which has a device specific irq_write_msi_msg()
65+
* callback.
66+
*/
67+
if (WARN_ON_ONCE(info->flags))
68+
return false;
69+
70+
/* Core managed MSI descriptors */
71+
info->flags = MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS | MSI_FLAG_FREE_MSI_DESCS;
72+
/* Remove PCI specific flags */
73+
required_flags &= ~MSI_FLAG_PCI_MSI_MASK_PARENT;
5974
break;
6075
default:
6176
/*

drivers/irqchip/irq-msi-lib.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#define MATCH_PCI_MSI (0)
1616
#endif
1717

18+
#define MATCH_PLATFORM_MSI BIT(DOMAIN_BUS_PLATFORM_MSI)
19+
1820
int msi_lib_irq_domain_select(struct irq_domain *d, struct irq_fwspec *fwspec,
1921
enum irq_domain_bus_token bus_token);
2022

0 commit comments

Comments
 (0)