@@ -53,22 +53,6 @@ static void msi_compose_msg(struct irq_data *data, struct msi_msg *msg)
MSI_DATA_VECTOR(cfg->vector);
}
-static int msi_set_affinity(struct irq_data *data, const struct cpumask *mask,
- bool force)
-{
- struct irq_data *parent = data->parent_data;
- struct msi_msg msg;
- int ret;
-
- ret = parent->chip->irq_set_affinity(parent, mask, force);
- if (ret >= 0 && ret != IRQ_SET_MASK_OK_DONE) {
- irq_chip_compose_msi_msg(data, &msg);
- __write_msi_msg(data->msi_desc, &msg);
- }
-
- return ret;
-}
-
/*
* IRQ Chip for MSI PCI/PCI-X/PCI-Express Devices,
* which implement the MSI or MSI-X Capability Structure.
@@ -78,7 +62,7 @@ static struct irq_chip msi_chip = {
.irq_unmask = unmask_msi_irq,
.irq_mask = mask_msi_irq,
.irq_ack = irq_chip_ack_parent,
- .irq_set_affinity = msi_set_affinity,
+ .irq_set_affinity = msi_domain_set_affinity,
.irq_retrigger = irq_chip_retrigger_hierarchy,
.irq_compose_msi_msg = msi_compose_msg,
.flags = IRQCHIP_SKIP_SET_WAKE,
@@ -142,7 +126,7 @@ static struct irq_chip msi_ir_chip = {
.irq_unmask = unmask_msi_irq,
.irq_mask = mask_msi_irq,
.irq_ack = irq_chip_ack_parent,
- .irq_set_affinity = msi_set_affinity,
+ .irq_set_affinity = msi_domain_set_affinity,
.irq_retrigger = irq_chip_retrigger_hierarchy,
.flags = IRQCHIP_SKIP_SET_WAKE,
};
@@ -1101,6 +1101,22 @@ int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,
EXPORT_SYMBOL(pci_enable_msix_range);
#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask,
+ bool force)
+{
+ struct irq_data *parent = data->parent_data;
+ struct msi_msg msg;
+ int ret;
+
+ ret = parent->chip->irq_set_affinity(parent, mask, force);
+ if (ret >= 0 && ret != IRQ_SET_MASK_OK_DONE) {
+ irq_chip_compose_msi_msg(data, &msg);
+ __write_msi_msg(data->msi_desc, &msg);
+ }
+
+ return ret;
+}
+
/*
* Generate a unique ID number for each possible MSI source, the ID number
* is only used within the irqdomain.
@@ -79,6 +79,8 @@ struct msi_chip {
struct irq_domain;
struct irq_chip;
+int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask,
+ bool force);
struct irq_domain *msi_create_irq_domain(struct device_node *of_node,
struct irq_chip *chip,
struct irq_domain *parent);
Move msi_set_affinity() to PCI core, so it could be reused later. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> --- arch/x86/kernel/apic/msi.c | 20 ++------------------ drivers/pci/msi.c | 16 ++++++++++++++++ include/linux/msi.h | 2 ++ 3 files changed, 20 insertions(+), 18 deletions(-)