Skip to content

Commit

Permalink
genirq/msi: Move IRQ_DOMAIN_MSI_NOMASK_QUIRK to MSI flags
Browse files Browse the repository at this point in the history
It's truly a MSI only flag and for the upcoming per device MSI domains this
must be in the MSI flags so it can be set during domain setup without
exposing this quirk outside of x86.

Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Kevin Tian <[email protected]>
Acked-by: Marc Zyngier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
KAGA-KOKO committed Dec 5, 2022
1 parent 6842694 commit 3dad5f9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
5 changes: 2 additions & 3 deletions arch/x86/kernel/apic/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ static struct msi_domain_ops pci_msi_domain_ops = {

static struct msi_domain_info pci_msi_domain_info = {
.flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
MSI_FLAG_PCI_MSIX,
MSI_FLAG_PCI_MSIX | MSI_FLAG_NOMASK_QUIRK,

.ops = &pci_msi_domain_ops,
.chip = &pci_msi_controller,
.handler = handle_edge_irq,
Expand All @@ -200,8 +201,6 @@ struct irq_domain * __init native_create_pci_msi_domain(void)
if (!d) {
irq_domain_free_fwnode(fn);
pr_warn("Failed to initialize PCI-MSI irqdomain.\n");
} else {
d->flags |= IRQ_DOMAIN_MSI_NOMASK_QUIRK;
}
return d;
}
Expand Down
9 changes: 1 addition & 8 deletions include/linux/irqdomain.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,8 @@ enum {
/* Irq domain implements MSI remapping */
IRQ_DOMAIN_FLAG_MSI_REMAP = (1 << 5),

/*
* Quirk to handle MSI implementations which do not provide
* masking. Currently known to affect x86, but partially
* handled in core code.
*/
IRQ_DOMAIN_MSI_NOMASK_QUIRK = (1 << 6),

/* Irq domain doesn't translate anything */
IRQ_DOMAIN_FLAG_NO_MAP = (1 << 7),
IRQ_DOMAIN_FLAG_NO_MAP = (1 << 6),

/*
* Flags starting from IRQ_DOMAIN_FLAG_NONCORE are reserved
Expand Down
6 changes: 6 additions & 0 deletions include/linux/msi.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,12 @@ enum {
MSI_FLAG_ALLOC_SIMPLE_MSI_DESCS = (1 << 9),
/* Free MSI descriptors */
MSI_FLAG_FREE_MSI_DESCS = (1 << 10),
/*
* Quirk to handle MSI implementations which do not provide
* masking. Currently known to affect x86, but has to be partially
* handled in the core MSI code.
*/
MSI_FLAG_NOMASK_QUIRK = (1 << 11),
};

int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask,
Expand Down
2 changes: 1 addition & 1 deletion kernel/irq/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ static int __msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev
* MSI affinity setting requires a special quirk (X86) when
* reservation mode is active.
*/
if (domain->flags & IRQ_DOMAIN_MSI_NOMASK_QUIRK)
if (info->flags & MSI_FLAG_NOMASK_QUIRK)
vflags |= VIRQ_NOMASK_QUIRK;
}

Expand Down

0 comments on commit 3dad5f9

Please sign in to comment.