Skip to content

Commit 3ddc14e

Browse files
committed
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King: "A few ARM fixes: - Dietmar Eggemann noticed an issue with IRQ migration during CPU hotplug stress testing. - Mathieu Desnoyers noticed that a previous fix broke optimised kprobes. - Robin Murphy noticed a case where we were not clearing the dma_ops" * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 8835/1: dma-mapping: Clear DMA ops on teardown ARM: 8834/1: Fix: kprobes: optimized kprobes illegal instruction ARM: 8824/1: fix a migrating irq bug when hotplug cpu
2 parents 10f4902 + fc67e6f commit 3ddc14e

File tree

6 files changed

+5
-65
lines changed

6 files changed

+5
-65
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,7 @@ config NR_CPUS
14001400
config HOTPLUG_CPU
14011401
bool "Support for hot-pluggable CPUs"
14021402
depends on SMP
1403+
select GENERIC_IRQ_MIGRATION
14031404
help
14041405
Say Y here to experiment with turning CPUs off and on. CPUs
14051406
can be controlled through /sys/devices/system/cpu.

arch/arm/include/asm/irq.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#ifndef __ASSEMBLY__
2626
struct irqaction;
2727
struct pt_regs;
28-
extern void migrate_irqs(void);
2928

3029
extern void asm_do_IRQ(unsigned int, struct pt_regs *);
3130
void handle_IRQ(unsigned int, struct pt_regs *);

arch/arm/kernel/irq.c

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <linux/smp.h>
3232
#include <linux/init.h>
3333
#include <linux/seq_file.h>
34-
#include <linux/ratelimit.h>
3534
#include <linux/errno.h>
3635
#include <linux/list.h>
3736
#include <linux/kallsyms.h>
@@ -109,64 +108,3 @@ int __init arch_probe_nr_irqs(void)
109108
return nr_irqs;
110109
}
111110
#endif
112-
113-
#ifdef CONFIG_HOTPLUG_CPU
114-
static bool migrate_one_irq(struct irq_desc *desc)
115-
{
116-
struct irq_data *d = irq_desc_get_irq_data(desc);
117-
const struct cpumask *affinity = irq_data_get_affinity_mask(d);
118-
struct irq_chip *c;
119-
bool ret = false;
120-
121-
/*
122-
* If this is a per-CPU interrupt, or the affinity does not
123-
* include this CPU, then we have nothing to do.
124-
*/
125-
if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), affinity))
126-
return false;
127-
128-
if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
129-
affinity = cpu_online_mask;
130-
ret = true;
131-
}
132-
133-
c = irq_data_get_irq_chip(d);
134-
if (!c->irq_set_affinity)
135-
pr_debug("IRQ%u: unable to set affinity\n", d->irq);
136-
else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret)
137-
cpumask_copy(irq_data_get_affinity_mask(d), affinity);
138-
139-
return ret;
140-
}
141-
142-
/*
143-
* The current CPU has been marked offline. Migrate IRQs off this CPU.
144-
* If the affinity settings do not allow other CPUs, force them onto any
145-
* available CPU.
146-
*
147-
* Note: we must iterate over all IRQs, whether they have an attached
148-
* action structure or not, as we need to get chained interrupts too.
149-
*/
150-
void migrate_irqs(void)
151-
{
152-
unsigned int i;
153-
struct irq_desc *desc;
154-
unsigned long flags;
155-
156-
local_irq_save(flags);
157-
158-
for_each_irq_desc(i, desc) {
159-
bool affinity_broken;
160-
161-
raw_spin_lock(&desc->lock);
162-
affinity_broken = migrate_one_irq(desc);
163-
raw_spin_unlock(&desc->lock);
164-
165-
if (affinity_broken)
166-
pr_warn_ratelimited("IRQ%u no longer affine to CPU%u\n",
167-
i, smp_processor_id());
168-
}
169-
170-
local_irq_restore(flags);
171-
}
172-
#endif /* CONFIG_HOTPLUG_CPU */

arch/arm/kernel/smp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ int __cpu_disable(void)
254254
/*
255255
* OK - migrate IRQs away from this CPU
256256
*/
257-
migrate_irqs();
257+
irq_migrate_all_off_this_cpu();
258258

259259
/*
260260
* Flush user cache and TLB mappings, and then remove this CPU

arch/arm/mm/dma-mapping.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,4 +2390,6 @@ void arch_teardown_dma_ops(struct device *dev)
23902390
return;
23912391

23922392
arm_teardown_iommu_dma_ops(dev);
2393+
/* Let arch_setup_dma_ops() start again from scratch upon re-probe */
2394+
set_dma_ops(dev, NULL);
23932395
}

arch/arm/probes/kprobes/opt-arm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *or
247247
}
248248

249249
/* Copy arch-dep-instance from template. */
250-
memcpy(code, (unsigned char *)optprobe_template_entry,
250+
memcpy(code, (unsigned long *)&optprobe_template_entry,
251251
TMPL_END_IDX * sizeof(kprobe_opcode_t));
252252

253253
/* Adjust buffer according to instruction. */

0 commit comments

Comments
 (0)