diff options
Diffstat (limited to 'include/linux/irq.h')
-rw-r--r-- | include/linux/irq.h | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h index b7cbeed972e4..eedbb8e5e0cc 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -117,7 +117,7 @@ struct irq_chip { | |||
117 | void (*eoi)(unsigned int irq); | 117 | void (*eoi)(unsigned int irq); |
118 | 118 | ||
119 | void (*end)(unsigned int irq); | 119 | void (*end)(unsigned int irq); |
120 | void (*set_affinity)(unsigned int irq, | 120 | int (*set_affinity)(unsigned int irq, |
121 | const struct cpumask *dest); | 121 | const struct cpumask *dest); |
122 | int (*retrigger)(unsigned int irq); | 122 | int (*retrigger)(unsigned int irq); |
123 | int (*set_type)(unsigned int irq, unsigned int flow_type); | 123 | int (*set_type)(unsigned int irq, unsigned int flow_type); |
@@ -187,7 +187,7 @@ struct irq_desc { | |||
187 | spinlock_t lock; | 187 | spinlock_t lock; |
188 | #ifdef CONFIG_SMP | 188 | #ifdef CONFIG_SMP |
189 | cpumask_var_t affinity; | 189 | cpumask_var_t affinity; |
190 | unsigned int cpu; | 190 | unsigned int node; |
191 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 191 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
192 | cpumask_var_t pending_mask; | 192 | cpumask_var_t pending_mask; |
193 | #endif | 193 | #endif |
@@ -201,26 +201,23 @@ struct irq_desc { | |||
201 | } ____cacheline_internodealigned_in_smp; | 201 | } ____cacheline_internodealigned_in_smp; |
202 | 202 | ||
203 | extern void arch_init_copy_chip_data(struct irq_desc *old_desc, | 203 | extern void arch_init_copy_chip_data(struct irq_desc *old_desc, |
204 | struct irq_desc *desc, int cpu); | 204 | struct irq_desc *desc, int node); |
205 | extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); | 205 | extern void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc); |
206 | 206 | ||
207 | #ifndef CONFIG_SPARSE_IRQ | 207 | #ifndef CONFIG_SPARSE_IRQ |
208 | extern struct irq_desc irq_desc[NR_IRQS]; | 208 | extern struct irq_desc irq_desc[NR_IRQS]; |
209 | #else /* CONFIG_SPARSE_IRQ */ | 209 | #endif |
210 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int cpu); | ||
211 | #endif /* CONFIG_SPARSE_IRQ */ | ||
212 | |||
213 | extern struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu); | ||
214 | 210 | ||
215 | static inline struct irq_desc * | 211 | #ifdef CONFIG_NUMA_IRQ_DESC |
216 | irq_remap_to_desc(unsigned int irq, struct irq_desc *desc) | 212 | extern struct irq_desc *move_irq_desc(struct irq_desc *old_desc, int node); |
217 | { | ||
218 | #ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC | ||
219 | return irq_to_desc(irq); | ||
220 | #else | 213 | #else |
214 | static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node) | ||
215 | { | ||
221 | return desc; | 216 | return desc; |
222 | #endif | ||
223 | } | 217 | } |
218 | #endif | ||
219 | |||
220 | extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node); | ||
224 | 221 | ||
225 | /* | 222 | /* |
226 | * Migration helpers for obsolete names, they will go away: | 223 | * Migration helpers for obsolete names, they will go away: |
@@ -386,7 +383,7 @@ extern void set_irq_noprobe(unsigned int irq); | |||
386 | extern void set_irq_probe(unsigned int irq); | 383 | extern void set_irq_probe(unsigned int irq); |
387 | 384 | ||
388 | /* Handle dynamic irq creation and destruction */ | 385 | /* Handle dynamic irq creation and destruction */ |
389 | extern unsigned int create_irq_nr(unsigned int irq_want); | 386 | extern unsigned int create_irq_nr(unsigned int irq_want, int node); |
390 | extern int create_irq(void); | 387 | extern int create_irq(void); |
391 | extern void destroy_irq(unsigned int irq); | 388 | extern void destroy_irq(unsigned int irq); |
392 | 389 | ||
@@ -424,47 +421,48 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry); | |||
424 | 421 | ||
425 | #ifdef CONFIG_SMP | 422 | #ifdef CONFIG_SMP |
426 | /** | 423 | /** |
427 | * init_alloc_desc_masks - allocate cpumasks for irq_desc | 424 | * alloc_desc_masks - allocate cpumasks for irq_desc |
428 | * @desc: pointer to irq_desc struct | 425 | * @desc: pointer to irq_desc struct |
429 | * @cpu: cpu which will be handling the cpumasks | 426 | * @cpu: cpu which will be handling the cpumasks |
430 | * @boot: true if need bootmem | 427 | * @boot: true if need bootmem |
431 | * | 428 | * |
432 | * Allocates affinity and pending_mask cpumask if required. | 429 | * Allocates affinity and pending_mask cpumask if required. |
433 | * Returns true if successful (or not required). | 430 | * Returns true if successful (or not required). |
434 | * Side effect: affinity has all bits set, pending_mask has all bits clear. | ||
435 | */ | 431 | */ |
436 | static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, | 432 | static inline bool alloc_desc_masks(struct irq_desc *desc, int node, |
437 | bool boot) | 433 | bool boot) |
438 | { | 434 | { |
439 | int node; | 435 | #ifdef CONFIG_CPUMASK_OFFSTACK |
440 | |||
441 | if (boot) { | 436 | if (boot) { |
442 | alloc_bootmem_cpumask_var(&desc->affinity); | 437 | alloc_bootmem_cpumask_var(&desc->affinity); |
443 | cpumask_setall(desc->affinity); | ||
444 | 438 | ||
445 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 439 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
446 | alloc_bootmem_cpumask_var(&desc->pending_mask); | 440 | alloc_bootmem_cpumask_var(&desc->pending_mask); |
447 | cpumask_clear(desc->pending_mask); | ||
448 | #endif | 441 | #endif |
449 | return true; | 442 | return true; |
450 | } | 443 | } |
451 | 444 | ||
452 | node = cpu_to_node(cpu); | ||
453 | |||
454 | if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node)) | 445 | if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node)) |
455 | return false; | 446 | return false; |
456 | cpumask_setall(desc->affinity); | ||
457 | 447 | ||
458 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 448 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
459 | if (!alloc_cpumask_var_node(&desc->pending_mask, GFP_ATOMIC, node)) { | 449 | if (!alloc_cpumask_var_node(&desc->pending_mask, GFP_ATOMIC, node)) { |
460 | free_cpumask_var(desc->affinity); | 450 | free_cpumask_var(desc->affinity); |
461 | return false; | 451 | return false; |
462 | } | 452 | } |
463 | cpumask_clear(desc->pending_mask); | 453 | #endif |
464 | #endif | 454 | #endif |
465 | return true; | 455 | return true; |
466 | } | 456 | } |
467 | 457 | ||
458 | static inline void init_desc_masks(struct irq_desc *desc) | ||
459 | { | ||
460 | cpumask_setall(desc->affinity); | ||
461 | #ifdef CONFIG_GENERIC_PENDING_IRQ | ||
462 | cpumask_clear(desc->pending_mask); | ||
463 | #endif | ||
464 | } | ||
465 | |||
468 | /** | 466 | /** |
469 | * init_copy_desc_masks - copy cpumasks for irq_desc | 467 | * init_copy_desc_masks - copy cpumasks for irq_desc |
470 | * @old_desc: pointer to old irq_desc struct | 468 | * @old_desc: pointer to old irq_desc struct |
@@ -478,7 +476,7 @@ static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, | |||
478 | static inline void init_copy_desc_masks(struct irq_desc *old_desc, | 476 | static inline void init_copy_desc_masks(struct irq_desc *old_desc, |
479 | struct irq_desc *new_desc) | 477 | struct irq_desc *new_desc) |
480 | { | 478 | { |
481 | #ifdef CONFIG_CPUMASKS_OFFSTACK | 479 | #ifdef CONFIG_CPUMASK_OFFSTACK |
482 | cpumask_copy(new_desc->affinity, old_desc->affinity); | 480 | cpumask_copy(new_desc->affinity, old_desc->affinity); |
483 | 481 | ||
484 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 482 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
@@ -499,12 +497,16 @@ static inline void free_desc_masks(struct irq_desc *old_desc, | |||
499 | 497 | ||
500 | #else /* !CONFIG_SMP */ | 498 | #else /* !CONFIG_SMP */ |
501 | 499 | ||
502 | static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, | 500 | static inline bool alloc_desc_masks(struct irq_desc *desc, int node, |
503 | bool boot) | 501 | bool boot) |
504 | { | 502 | { |
505 | return true; | 503 | return true; |
506 | } | 504 | } |
507 | 505 | ||
506 | static inline void init_desc_masks(struct irq_desc *desc) | ||
507 | { | ||
508 | } | ||
509 | |||
508 | static inline void init_copy_desc_masks(struct irq_desc *old_desc, | 510 | static inline void init_copy_desc_masks(struct irq_desc *old_desc, |
509 | struct irq_desc *new_desc) | 511 | struct irq_desc *new_desc) |
510 | { | 512 | { |