Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c97d4869 authored by Russell King's avatar Russell King Committed by Russell King
Browse files

[ARM] Fix SMP irqflags support



The IRQ changes a while back broke the build for SMP machines.
Fix up the SMP code to use set_irq_regs/get_irq_regs as
appropriate.  Also, fix a warning in arch/arm/kernel/time.c
where 'regs' becomes unused for SMP builds.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 858cbcdd
Loading
Loading
Loading
Loading
+13 −7
Original line number Original line Diff line number Diff line
@@ -7,6 +7,7 @@
 * it under the terms of the GNU General Public License version 2 as
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 * published by the Free Software Foundation.
 */
 */
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/spinlock.h>
@@ -19,6 +20,7 @@
#include <linux/cpu.h>
#include <linux/cpu.h>
#include <linux/smp.h>
#include <linux/smp.h>
#include <linux/seq_file.h>
#include <linux/seq_file.h>
#include <linux/irq.h>


#include <asm/atomic.h>
#include <asm/atomic.h>
#include <asm/cacheflush.h>
#include <asm/cacheflush.h>
@@ -474,25 +476,26 @@ void show_local_irqs(struct seq_file *p)
	seq_putc(p, '\n');
	seq_putc(p, '\n');
}
}


static void ipi_timer(struct pt_regs *regs)
static void ipi_timer(void)
{
{
	int user = user_mode(regs);

	irq_enter();
	irq_enter();
	profile_tick(CPU_PROFILING, regs);
	profile_tick(CPU_PROFILING);
	update_process_times(user);
	update_process_times(user_mode(get_irq_regs()));
	irq_exit();
	irq_exit();
}
}


#ifdef CONFIG_LOCAL_TIMERS
#ifdef CONFIG_LOCAL_TIMERS
asmlinkage void do_local_timer(struct pt_regs *regs)
asmlinkage void do_local_timer(struct pt_regs *regs)
{
{
	struct pt_regs *old_regs = set_irq_regs(regs);
	int cpu = smp_processor_id();
	int cpu = smp_processor_id();


	if (local_timer_ack()) {
	if (local_timer_ack()) {
		irq_stat[cpu].local_timer_irqs++;
		irq_stat[cpu].local_timer_irqs++;
		ipi_timer(regs);
		ipi_timer();
	}
	}

	set_irq_regs(old_regs);
}
}
#endif
#endif


@@ -551,6 +554,7 @@ asmlinkage void do_IPI(struct pt_regs *regs)
{
{
	unsigned int cpu = smp_processor_id();
	unsigned int cpu = smp_processor_id();
	struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
	struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
	struct pt_regs *old_regs = set_irq_regs(regs);


	ipi->ipi_count++;
	ipi->ipi_count++;


@@ -574,7 +578,7 @@ asmlinkage void do_IPI(struct pt_regs *regs)


			switch (nextmsg) {
			switch (nextmsg) {
			case IPI_TIMER:
			case IPI_TIMER:
				ipi_timer(regs);
				ipi_timer();
				break;
				break;


			case IPI_RESCHEDULE:
			case IPI_RESCHEDULE:
@@ -599,6 +603,8 @@ asmlinkage void do_IPI(struct pt_regs *regs)
			}
			}
		} while (msgs);
		} while (msgs);
	}
	}

	set_irq_regs(old_regs);
}
}


void smp_send_reschedule(int cpu)
void smp_send_reschedule(int cpu)
+1 −2
Original line number Original line Diff line number Diff line
@@ -327,13 +327,12 @@ EXPORT_SYMBOL(restore_time_delta);
 */
 */
void timer_tick(void)
void timer_tick(void)
{
{
	struct pt_regs *regs = get_irq_regs();
	profile_tick(CPU_PROFILING);
	profile_tick(CPU_PROFILING);
	do_leds();
	do_leds();
	do_set_rtc();
	do_set_rtc();
	do_timer(1);
	do_timer(1);
#ifndef CONFIG_SMP
#ifndef CONFIG_SMP
	update_process_times(user_mode(regs));
	update_process_times(user_mode(get_irq_regs()));
#endif
#endif
}
}