summaryrefslogtreecommitdiffstats
path: root/kernel/irq/irqdomain.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/irq/irqdomain.c')
-rw-r--r--kernel/irq/irqdomain.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 8798b6c9e945..79459b732dc9 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -481,7 +481,7 @@ unsigned int irq_create_mapping(struct irq_domain *domain,
481 } 481 }
482 482
483 /* Allocate a virtual interrupt number */ 483 /* Allocate a virtual interrupt number */
484 virq = irq_domain_alloc_descs(-1, 1, hwirq, of_node_to_nid(of_node)); 484 virq = irq_domain_alloc_descs(-1, 1, hwirq, of_node_to_nid(of_node), NULL);
485 if (virq <= 0) { 485 if (virq <= 0) {
486 pr_debug("-> virq allocation failed\n"); 486 pr_debug("-> virq allocation failed\n");
487 return 0; 487 return 0;
@@ -835,19 +835,23 @@ const struct irq_domain_ops irq_domain_simple_ops = {
835EXPORT_SYMBOL_GPL(irq_domain_simple_ops); 835EXPORT_SYMBOL_GPL(irq_domain_simple_ops);
836 836
837int irq_domain_alloc_descs(int virq, unsigned int cnt, irq_hw_number_t hwirq, 837int irq_domain_alloc_descs(int virq, unsigned int cnt, irq_hw_number_t hwirq,
838 int node) 838 int node, const struct cpumask *affinity)
839{ 839{
840 unsigned int hint; 840 unsigned int hint;
841 841
842 if (virq >= 0) { 842 if (virq >= 0) {
843 virq = irq_alloc_descs(virq, virq, cnt, node); 843 virq = __irq_alloc_descs(virq, virq, cnt, node, THIS_MODULE,
844 affinity);
844 } else { 845 } else {
845 hint = hwirq % nr_irqs; 846 hint = hwirq % nr_irqs;
846 if (hint == 0) 847 if (hint == 0)
847 hint++; 848 hint++;
848 virq = irq_alloc_descs_from(hint, cnt, node); 849 virq = __irq_alloc_descs(-1, hint, cnt, node, THIS_MODULE,
849 if (virq <= 0 && hint > 1) 850 affinity);
850 virq = irq_alloc_descs_from(1, cnt, node); 851 if (virq <= 0 && hint > 1) {
852 virq = __irq_alloc_descs(-1, 1, cnt, node, THIS_MODULE,
853 affinity);
854 }
851 } 855 }
852 856
853 return virq; 857 return virq;
@@ -1160,6 +1164,7 @@ int irq_domain_alloc_irqs_recursive(struct irq_domain *domain,
1160 * @node: NUMA node id for memory allocation 1164 * @node: NUMA node id for memory allocation
1161 * @arg: domain specific argument 1165 * @arg: domain specific argument
1162 * @realloc: IRQ descriptors have already been allocated if true 1166 * @realloc: IRQ descriptors have already been allocated if true
1167 * @affinity: Optional irq affinity mask for multiqueue devices
1163 * 1168 *
1164 * Allocate IRQ numbers and initialized all data structures to support 1169 * Allocate IRQ numbers and initialized all data structures to support
1165 * hierarchy IRQ domains. 1170 * hierarchy IRQ domains.
@@ -1175,7 +1180,7 @@ int irq_domain_alloc_irqs_recursive(struct irq_domain *domain,
1175 */ 1180 */
1176int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base, 1181int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base,
1177 unsigned int nr_irqs, int node, void *arg, 1182 unsigned int nr_irqs, int node, void *arg,
1178 bool realloc) 1183 bool realloc, const struct cpumask *affinity)
1179{ 1184{
1180 int i, ret, virq; 1185 int i, ret, virq;
1181 1186
@@ -1193,7 +1198,8 @@ int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base,
1193 if (realloc && irq_base >= 0) { 1198 if (realloc && irq_base >= 0) {
1194 virq = irq_base; 1199 virq = irq_base;
1195 } else { 1200 } else {
1196 virq = irq_domain_alloc_descs(irq_base, nr_irqs, 0, node); 1201 virq = irq_domain_alloc_descs(irq_base, nr_irqs, 0, node,
1202 affinity);
1197 if (virq < 0) { 1203 if (virq < 0) {
1198 pr_debug("cannot allocate IRQ(base %d, count %d)\n", 1204 pr_debug("cannot allocate IRQ(base %d, count %d)\n",
1199 irq_base, nr_irqs); 1205 irq_base, nr_irqs);