@@ -1111,7 +1111,7 @@ int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask,
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);
+ irq_chip_write_msi_msg(data, &msg);
}
return ret;
@@ -1177,32 +1177,20 @@ static void msi_domain_free(struct irq_domain *domain, unsigned int virq,
irq_domain_free_irqs_top(domain, virq, nr_irqs);
}
-static void msi_domain_activate(struct irq_domain *domain,
- struct irq_data *irq_data)
+void msi_domain_activate(struct irq_domain *domain, struct irq_data *irq_data)
{
struct msi_msg msg;
- /*
- * irq_data->chip_data is MSI/MSI-X offset.
- * MSI-X message is written per-IRQ, the offset is always 0.
- * MSI message denotes a contiguous group of IRQs, written for 0th IRQ.
- */
- if (irq_data->chip_data)
- return;
-
BUG_ON(irq_chip_compose_msi_msg(irq_data, &msg));
- __write_msi_msg(irq_data->msi_desc, &msg);
+ irq_chip_write_msi_msg(irq_data, &msg);
}
-static void msi_domain_deactivate(struct irq_domain *domain,
- struct irq_data *irq_data)
+void msi_domain_deactivate(struct irq_domain *domain, struct irq_data *irq_data)
{
struct msi_msg msg;
- if (!irq_data->chip_data) {
- memset(&msg, 0, sizeof(msg));
- __write_msi_msg(irq_data->msi_desc, &msg);
- }
+ memset(&msg, 0, sizeof(msg));
+ irq_chip_write_msi_msg(irq_data, &msg);
}
static struct irq_domain_ops msi_domain_ops = {
@@ -81,6 +81,9 @@ struct irq_chip;
int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask,
bool force);
+void msi_domain_activate(struct irq_domain *domain, struct irq_data *irq_data);
+void msi_domain_deactivate(struct irq_domain *domain,
+ struct irq_data *irq_data);
struct irq_domain *msi_create_irq_domain(struct device_node *of_node,
struct irq_chip *chip,
struct irq_domain *parent);
Change PCI MSI code to use irq_chip.irq_write_msi_msg() to share more common code later. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> --- drivers/pci/msi.c | 24 ++++++------------------ include/linux/msi.h | 3 +++ 2 files changed, 9 insertions(+), 18 deletions(-)