Skip to content

Commit 9bbe13a

Browse files
committed
genirq/msi: Provide MSI_FLAG_PARENT_PM_DEV
Some platform-MSI implementations require that power management is redirected to the underlying interrupt chip device. To make this work with per device MSI domains provide a new feature flag and let the core code handle the setup of dev->pm_dev when set during device MSI domain creation. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Anup Patel <apatel@ventanamicro.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20240127161753.114685-14-apatel@ventanamicro.com
1 parent e49312f commit 9bbe13a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

include/linux/msi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,8 @@ enum {
554554
MSI_FLAG_FREE_MSI_DESCS = (1 << 6),
555555
/* Use dev->fwnode for MSI device domain creation */
556556
MSI_FLAG_USE_DEV_FWNODE = (1 << 7),
557+
/* Set parent->dev into domain->pm_dev on device domain creation */
558+
MSI_FLAG_PARENT_PM_DEV = (1 << 8),
557559

558560
/* Mask for the generic functionality */
559561
MSI_GENERIC_FLAGS_MASK = GENMASK(15, 0),

kernel/irq/msi.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,8 +845,11 @@ static struct irq_domain *__msi_create_irq_domain(struct fwnode_handle *fwnode,
845845
domain = irq_domain_create_hierarchy(parent, flags | IRQ_DOMAIN_FLAG_MSI, 0,
846846
fwnode, &msi_domain_ops, info);
847847

848-
if (domain)
848+
if (domain) {
849849
irq_domain_update_bus_token(domain, info->bus_token);
850+
if (info->flags & MSI_FLAG_PARENT_PM_DEV)
851+
domain->pm_dev = parent->pm_dev;
852+
}
850853

851854
return domain;
852855
}

0 commit comments

Comments
 (0)