manage.c (b008207cbd0d5ce606a1a2ac52826e0ab37d0b99) manage.c (569bda8df11effa03e618729293c7961696abb10)
1/*
2 * linux/kernel/irq/manage.c
3 *
4 * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar
5 * Copyright (C) 2005-2006 Thomas Gleixner
6 *
7 * This file contains driver APIs to the irq subsystem.
8 */

--- 242 unchanged lines hidden (view full) ---

251EXPORT_SYMBOL_GPL(irq_set_affinity_notifier);
252
253#ifndef CONFIG_AUTO_IRQ_AFFINITY
254/*
255 * Generic version of the affinity autoselector.
256 */
257static int setup_affinity(unsigned int irq, struct irq_desc *desc)
258{
1/*
2 * linux/kernel/irq/manage.c
3 *
4 * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar
5 * Copyright (C) 2005-2006 Thomas Gleixner
6 *
7 * This file contains driver APIs to the irq subsystem.
8 */

--- 242 unchanged lines hidden (view full) ---

251EXPORT_SYMBOL_GPL(irq_set_affinity_notifier);
252
253#ifndef CONFIG_AUTO_IRQ_AFFINITY
254/*
255 * Generic version of the affinity autoselector.
256 */
257static int setup_affinity(unsigned int irq, struct irq_desc *desc)
258{
259 struct cpumask *set = irq_default_affinity;
260
259 /* Excludes PER_CPU and NO_BALANCE interrupts */
260 if (!irq_can_set_affinity(irq))
261 return 0;
262
263 /*
264 * Preserve an userspace affinity setup, but make sure that
265 * one of the targets is online.
266 */
267 if (desc->status & (IRQ_AFFINITY_SET)) {
261 /* Excludes PER_CPU and NO_BALANCE interrupts */
262 if (!irq_can_set_affinity(irq))
263 return 0;
264
265 /*
266 * Preserve an userspace affinity setup, but make sure that
267 * one of the targets is online.
268 */
269 if (desc->status & (IRQ_AFFINITY_SET)) {
268 if (cpumask_any_and(desc->irq_data.affinity, cpu_online_mask)
269 < nr_cpu_ids)
270 goto set_affinity;
270 if (cpumask_intersects(desc->irq_data.affinity,
271 cpu_online_mask))
272 set = desc->irq_data.affinity;
271 else
272 desc->status &= ~IRQ_AFFINITY_SET;
273 }
273 else
274 desc->status &= ~IRQ_AFFINITY_SET;
275 }
274
275 cpumask_and(desc->irq_data.affinity, cpu_online_mask, irq_default_affinity);
276set_affinity:
276 cpumask_and(desc->irq_data.affinity, cpu_online_mask, set);
277 desc->irq_data.chip->irq_set_affinity(&desc->irq_data, desc->irq_data.affinity, false);
278
279 return 0;
280}
281#else
282static inline int setup_affinity(unsigned int irq, struct irq_desc *d)
283{
284 return irq_select_affinity(irq);

--- 994 unchanged lines hidden ---
277 desc->irq_data.chip->irq_set_affinity(&desc->irq_data, desc->irq_data.affinity, false);
278
279 return 0;
280}
281#else
282static inline int setup_affinity(unsigned int irq, struct irq_desc *d)
283{
284 return irq_select_affinity(irq);

--- 994 unchanged lines hidden ---