From cdf8d75818e3cd30746d38f5fbcdb3745fd267a3 Mon Sep 17 00:00:00 2001 From: James Hogan Date: Thu, 14 Nov 2013 10:14:37 +0000 Subject: metag: dma: remove dead code in dma_alloc_init() Meta has 2 levels of page table so the pmd folds into the pud which folds into the pgd. Therefore the !pmd check in dma_alloc_init() is dead code since it essentially checks whether: (init_mm->pgd + 0x770) == 0 Remove the check. Reported-by: Chen Gang Signed-off-by: James Hogan --- arch/metag/kernel/dma.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/metag/kernel/dma.c b/arch/metag/kernel/dma.c index db589ad5dbc4..c700d625067a 100644 --- a/arch/metag/kernel/dma.c +++ b/arch/metag/kernel/dma.c @@ -399,11 +399,6 @@ static int __init dma_alloc_init(void) pgd = pgd_offset(&init_mm, CONSISTENT_START); pud = pud_alloc(&init_mm, pgd, CONSISTENT_START); pmd = pmd_alloc(&init_mm, pud, CONSISTENT_START); - if (!pmd) { - pr_err("%s: no pmd tables\n", __func__); - ret = -ENOMEM; - break; - } WARN_ON(!pmd_none(*pmd)); pte = pte_alloc_kernel(pmd, CONSISTENT_START); -- cgit v1.2.3 From 5a25f7bb5aa1b2f876d9df81c44b516e015022f8 Mon Sep 17 00:00:00 2001 From: James Hogan Date: Mon, 25 Nov 2013 11:14:50 +0000 Subject: metag: smp: don't set irq regs in do_IPI() Since commit f6b30d32d242 (metag: kick: add missing irq_enter/exit to kick_handler()), the main kick_handler() function deals with setting and restoring the irq registers pointer. Therefore do_IPI() which is called indirectly from kick_handler() doesn't need to do that itself any longer. Therefore remove that code and do_IPI()'s pt_regs argument. Signed-off-by: James Hogan Cc: linux-metag@vger.kernel.org Cc: Thomas Gleixner --- arch/metag/kernel/smp.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/metag/kernel/smp.c b/arch/metag/kernel/smp.c index 7c0113142981..177ffb408c5a 100644 --- a/arch/metag/kernel/smp.c +++ b/arch/metag/kernel/smp.c @@ -517,11 +517,10 @@ static DEFINE_SPINLOCK(stop_lock); * * Bit 0 - Inter-processor function call */ -static int do_IPI(struct pt_regs *regs) +static int do_IPI(void) { unsigned int cpu = smp_processor_id(); struct ipi_data *ipi = &per_cpu(ipi_data, cpu); - struct pt_regs *old_regs = set_irq_regs(regs); unsigned long msgs, nextmsg; int handled = 0; @@ -557,8 +556,6 @@ static int do_IPI(struct pt_regs *regs) } } - set_irq_regs(old_regs); - return handled; } @@ -624,7 +621,7 @@ static void kick_raise_softirq(cpumask_t callmap, unsigned int irq) static TBIRES ipi_handler(TBIRES State, int SigNum, int Triggers, int Inst, PTBI pTBI, int *handled) { - *handled = do_IPI((struct pt_regs *)State.Sig.pCtx); + *handled = do_IPI(); return State; } -- cgit v1.2.3 From 1d61cf121d7d9085145553294307e81c25586288 Mon Sep 17 00:00:00 2001 From: Jiang Liu Date: Thu, 5 Dec 2013 00:13:01 +0800 Subject: smp, metag: kill SMP single function call interrupt Commit 9a46ad6d6df3 "smp: make smp_call_function_many() use logic similar to smp_call_function_single()" has unified the way to handle single and multiple cross-CPU function calls. Now only one interrupt is needed for architecture specific code to support generic SMP function call interfaces, so kill the redundant single function call interrupt. Signed-off-by: Jiang Liu Cc: Andrew Morton Cc: Shaohua Li Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Steven Rostedt Cc: Jiri Kosina Signed-off-by: James Hogan --- arch/metag/include/asm/smp.h | 2 -- arch/metag/kernel/smp.c | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/metag/include/asm/smp.h b/arch/metag/include/asm/smp.h index e0373f81a117..1d7e770f7a54 100644 --- a/arch/metag/include/asm/smp.h +++ b/arch/metag/include/asm/smp.h @@ -7,13 +7,11 @@ enum ipi_msg_type { IPI_CALL_FUNC, - IPI_CALL_FUNC_SINGLE, IPI_RESCHEDULE, }; extern void arch_send_call_function_single_ipi(int cpu); extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); -#define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask asmlinkage void secondary_start_kernel(void); diff --git a/arch/metag/kernel/smp.c b/arch/metag/kernel/smp.c index 177ffb408c5a..f74008b6da07 100644 --- a/arch/metag/kernel/smp.c +++ b/arch/metag/kernel/smp.c @@ -491,7 +491,7 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask) void arch_send_call_function_single_ipi(int cpu) { - send_ipi_message(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE); + send_ipi_message(cpumask_of(cpu), IPI_CALL_FUNC); } void show_ipi_list(struct seq_file *p) @@ -545,10 +545,6 @@ static int do_IPI(void) generic_smp_call_function_interrupt(); break; - case IPI_CALL_FUNC_SINGLE: - generic_smp_call_function_single_interrupt(); - break; - default: pr_crit("CPU%u: Unknown IPI message 0x%lx\n", cpu, nextmsg); -- cgit v1.2.3 From 40979d327c99b20a938b2672d7e506f8fc41ddcc Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Thu, 19 Dec 2013 16:03:40 +0800 Subject: metag: topology: export 'cpu_core_map' We need to export 'cpu_core_map' since the topology_core_cpumask macro refers to it and is used by certain kernel modules. Found in allmodconfig build: ERROR: "cpu_core_map" [drivers/staging/lustre/lustre/libcfs/libcfs.ko] undefined! Signed-off-by: Chen Gang Signed-off-by: James Hogan --- arch/metag/kernel/topology.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/metag/kernel/topology.c b/arch/metag/kernel/topology.c index bec3dec4922e..4ba595701f7d 100644 --- a/arch/metag/kernel/topology.c +++ b/arch/metag/kernel/topology.c @@ -19,6 +19,7 @@ DEFINE_PER_CPU(struct cpuinfo_metag, cpu_data); cpumask_t cpu_core_map[NR_CPUS]; +EXPORT_SYMBOL(cpu_core_map); static cpumask_t cpu_coregroup_map(unsigned int cpu) { -- cgit v1.2.3 From e9a1d0165bbda4398d4a5d71736cf6390fb42c6f Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 3 Jan 2014 16:43:51 +0100 Subject: metag/smp: Make boot_secondary() static boot_secondary() is not used outside arch/metag/kernel/smp.c, hence make it static. Signed-off-by: Geert Uytterhoeven Signed-off-by: James Hogan --- arch/metag/kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/metag/kernel/smp.c b/arch/metag/kernel/smp.c index f74008b6da07..f006d2276f40 100644 --- a/arch/metag/kernel/smp.c +++ b/arch/metag/kernel/smp.c @@ -68,7 +68,7 @@ static DECLARE_COMPLETION(cpu_running); /* * "thread" is assumed to be a valid Meta hardware thread ID. */ -int boot_secondary(unsigned int thread, struct task_struct *idle) +static int boot_secondary(unsigned int thread, struct task_struct *idle) { u32 val; -- cgit v1.2.3