On Tue, 13 Oct 2015, Qais Yousef wrote:
+ if (domain == NULL)No tail comments please.
+ domain = irq_default_domain; /* need a separate ipi_default_domain? */
We should neither use irq_default_domain nor have an
ipi_default_domain.
+This does only initialize the first virq data. What about the others?
+ virq = irq_domain_alloc_descs(-1, nr_irqs, 0, NUMA_NO_NODE);
+ if (virq <= 0) {
+ pr_warn("Can't reserve IPI, failed to alloc descs\n");
+ return 0;
+ }
+
+ /* we are reusing hierarchy alloc function, should we create another one? */
+ virq = __irq_domain_alloc_irqs(domain, virq, nr_irqs, NUMA_NO_NODE,
+ (void *) dest, true);
+ if (virq <= 0) {
+ pr_warn("Can't reserve IPI, failed to alloc irqs\n");
+ goto free_descs;
+ }
+
+ data = irq_get_irq_data(virq);
+ bitmap_copy(data->ipi_mask.cpumask, dest->cpumask, dest->nbits);
+ data->ipi_mask.nbits = dest->nbits;
+ return virq;That wants to explain that it actually destroys a number of virqs not
+
+free_descs:
+ irq_free_descs(virq, nr_irqs);
+ return 0;
+}
+
+/**
+ * irq_destroy_ipi() - unreserve an IPI that was previously allocated
+ * @irq: linux irq number to be destroyed
+ *
+ * Return an IPI allocated with irq_reserve_ipi() to the system.
just the primary one.