summaryrefslogtreecommitdiffstats
path: root/kernel/irq/irqdesc.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-07-04 04:39:24 -0400
committerThomas Gleixner <tglx@linutronix.de>2016-07-04 06:25:13 -0400
commit06ee6d571f0e350253a8fc3492316b2be007fae2 (patch)
treebcabd269ee107044375a331d82334b95c28f915f /kernel/irq/irqdesc.c
parent9c2555835bb3d34dfac52a0be943dcc4bedd650f (diff)
genirq: Add affinity hint to irq allocation
Add an extra argument to the irq(domain) allocation functions, so we can hand down affinity hints to the allocator. Thats necessary to implement proper support for multiqueue devices. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Christoph Hellwig <hch@lst.de> Cc: linux-block@vger.kernel.org Cc: linux-pci@vger.kernel.org Cc: linux-nvme@lists.infradead.org Cc: axboe@fb.com Cc: agordeev@redhat.com Link: http://lkml.kernel.org/r/1467621574-8277-4-git-send-email-hch@lst.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq/irqdesc.c')
-rw-r--r--kernel/irq/irqdesc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 8731e1c5d1e7..b8df4fcdbb5f 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -223,7 +223,7 @@ static void free_desc(unsigned int irq)
223} 223}
224 224
225static int alloc_descs(unsigned int start, unsigned int cnt, int node, 225static int alloc_descs(unsigned int start, unsigned int cnt, int node,
226 struct module *owner) 226 const struct cpumask *affinity, struct module *owner)
227{ 227{
228 struct irq_desc *desc; 228 struct irq_desc *desc;
229 int i; 229 int i;
@@ -333,6 +333,7 @@ static void free_desc(unsigned int irq)
333} 333}
334 334
335static inline int alloc_descs(unsigned int start, unsigned int cnt, int node, 335static inline int alloc_descs(unsigned int start, unsigned int cnt, int node,
336 const struct cpumask *affinity,
336 struct module *owner) 337 struct module *owner)
337{ 338{
338 u32 i; 339 u32 i;
@@ -453,12 +454,15 @@ EXPORT_SYMBOL_GPL(irq_free_descs);
453 * @cnt: Number of consecutive irqs to allocate. 454 * @cnt: Number of consecutive irqs to allocate.
454 * @node: Preferred node on which the irq descriptor should be allocated 455 * @node: Preferred node on which the irq descriptor should be allocated
455 * @owner: Owning module (can be NULL) 456 * @owner: Owning module (can be NULL)
457 * @affinity: Optional pointer to an affinity mask which hints where the
458 * irq descriptors should be allocated and which default
459 * affinities to use
456 * 460 *
457 * Returns the first irq number or error code 461 * Returns the first irq number or error code
458 */ 462 */
459int __ref 463int __ref
460__irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, 464__irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
461 struct module *owner) 465 struct module *owner, const struct cpumask *affinity)
462{ 466{
463 int start, ret; 467 int start, ret;
464 468
@@ -494,7 +498,7 @@ __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
494 498
495 bitmap_set(allocated_irqs, start, cnt); 499 bitmap_set(allocated_irqs, start, cnt);
496 mutex_unlock(&sparse_irq_lock); 500 mutex_unlock(&sparse_irq_lock);
497 return alloc_descs(start, cnt, node, owner); 501 return alloc_descs(start, cnt, node, affinity, owner);
498 502
499err: 503err:
500 mutex_unlock(&sparse_irq_lock); 504 mutex_unlock(&sparse_irq_lock);
@@ -512,7 +516,7 @@ EXPORT_SYMBOL_GPL(__irq_alloc_descs);
512 */ 516 */
513unsigned int irq_alloc_hwirqs(int cnt, int node) 517unsigned int irq_alloc_hwirqs(int cnt, int node)
514{ 518{
515 int i, irq = __irq_alloc_descs(-1, 0, cnt, node, NULL); 519 int i, irq = __irq_alloc_descs(-1, 0, cnt, node, NULL, NULL);
516 520
517 if (irq < 0) 521 if (irq < 0)
518 return 0; 522 return 0;