Commit 5c159422 authored by Jiang Liu's avatar Jiang Liu Committed by Ralf Baechle

MIPS: irq: Use access helper irq_data_get_affinity_mask()

This is a preparatory patch for moving irq_data struct members.
Signed-off-by: default avatarJiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: linux-mips@linux-mips.org
Cc: LKML <linux-kernel@vger.kernel.org>
Patchwork: https://patchwork.linux-mips.org/patch/10699/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 586134a8
...@@ -60,7 +60,7 @@ static inline int enable_irq_for_cpu(int cpu, struct irq_data *d, ...@@ -60,7 +60,7 @@ static inline int enable_irq_for_cpu(int cpu, struct irq_data *d,
if (m) if (m)
enable &= cpumask_test_cpu(cpu, m); enable &= cpumask_test_cpu(cpu, m);
else if (irqd_affinity_was_set(d)) else if (irqd_affinity_was_set(d))
enable &= cpumask_test_cpu(cpu, d->affinity); enable &= cpumask_test_cpu(cpu, irq_data_get_affinity_mask(d));
#endif #endif
return enable; return enable;
} }
......
...@@ -225,13 +225,14 @@ static int next_cpu_for_irq(struct irq_data *data) ...@@ -225,13 +225,14 @@ static int next_cpu_for_irq(struct irq_data *data)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
int cpu; int cpu;
int weight = cpumask_weight(data->affinity); struct cpumask *mask = irq_data_get_affinity_mask(data);
int weight = cpumask_weight(mask);
struct octeon_ciu_chip_data *cd = irq_data_get_irq_chip_data(data); struct octeon_ciu_chip_data *cd = irq_data_get_irq_chip_data(data);
if (weight > 1) { if (weight > 1) {
cpu = cd->current_cpu; cpu = cd->current_cpu;
for (;;) { for (;;) {
cpu = cpumask_next(cpu, data->affinity); cpu = cpumask_next(cpu, mask);
if (cpu >= nr_cpu_ids) { if (cpu >= nr_cpu_ids) {
cpu = -1; cpu = -1;
continue; continue;
...@@ -240,7 +241,7 @@ static int next_cpu_for_irq(struct irq_data *data) ...@@ -240,7 +241,7 @@ static int next_cpu_for_irq(struct irq_data *data)
} }
} }
} else if (weight == 1) { } else if (weight == 1) {
cpu = cpumask_first(data->affinity); cpu = cpumask_first(mask);
} else { } else {
cpu = smp_processor_id(); cpu = smp_processor_id();
} }
...@@ -712,16 +713,17 @@ static void octeon_irq_cpu_offline_ciu(struct irq_data *data) ...@@ -712,16 +713,17 @@ static void octeon_irq_cpu_offline_ciu(struct irq_data *data)
{ {
int cpu = smp_processor_id(); int cpu = smp_processor_id();
cpumask_t new_affinity; cpumask_t new_affinity;
struct cpumask *mask = irq_data_get_affinity_mask(data);
if (!cpumask_test_cpu(cpu, data->affinity)) if (!cpumask_test_cpu(cpu, mask))
return; return;
if (cpumask_weight(data->affinity) > 1) { if (cpumask_weight(mask) > 1) {
/* /*
* It has multi CPU affinity, just remove this CPU * It has multi CPU affinity, just remove this CPU
* from the affinity set. * from the affinity set.
*/ */
cpumask_copy(&new_affinity, data->affinity); cpumask_copy(&new_affinity, mask);
cpumask_clear_cpu(cpu, &new_affinity); cpumask_clear_cpu(cpu, &new_affinity);
} else { } else {
/* Otherwise, put it on lowest numbered online CPU. */ /* Otherwise, put it on lowest numbered online CPU. */
......
...@@ -88,7 +88,8 @@ static void unmask_cic_irq(struct irq_data *d) ...@@ -88,7 +88,8 @@ static void unmask_cic_irq(struct irq_data *d)
* Make sure we have IRQ affinity. It may have changed while * Make sure we have IRQ affinity. It may have changed while
* we were processing the IRQ. * we were processing the IRQ.
*/ */
if (!cpumask_test_cpu(smp_processor_id(), d->affinity)) if (!cpumask_test_cpu(smp_processor_id(),
irq_data_get_affinity_mask(d)))
return; return;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment