Commit 1857a5b6 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'arc-fixes-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc

Pull ARC fixes from Vineet Gupta:
 "Some SMP changes, a ptrace request for NPTL debugging, bunch of build
  breakages/warnings"

* tag 'arc-fixes-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
  ARC: [SMP] Enable icache coherency
  ARC: [SMP] Fix IPI IRQ registration
  ARC: Implement ptrace(PTRACE_GET_THREAD_AREA)
  ARC: optimize kernel bss clearing in early boot code
  ARC: Fix build breakage for !CONFIG_ARC_DW2_UNWIND
  ARC: fix build warning in devtree
  ARC: remove checks for CONFIG_ARC_MMU_V4
parents 8dd68eb3 2328af0c
...@@ -60,7 +60,7 @@ extern void read_decode_cache_bcr(void); ...@@ -60,7 +60,7 @@ extern void read_decode_cache_bcr(void);
#define ARC_REG_IC_IVIC 0x10 #define ARC_REG_IC_IVIC 0x10
#define ARC_REG_IC_CTRL 0x11 #define ARC_REG_IC_CTRL 0x11
#define ARC_REG_IC_IVIL 0x19 #define ARC_REG_IC_IVIL 0x19
#if defined(CONFIG_ARC_MMU_V3) || defined (CONFIG_ARC_MMU_V4) #if defined(CONFIG_ARC_MMU_V3)
#define ARC_REG_IC_PTAG 0x1E #define ARC_REG_IC_PTAG 0x1E
#endif #endif
...@@ -74,7 +74,7 @@ extern void read_decode_cache_bcr(void); ...@@ -74,7 +74,7 @@ extern void read_decode_cache_bcr(void);
#define ARC_REG_DC_IVDL 0x4A #define ARC_REG_DC_IVDL 0x4A
#define ARC_REG_DC_FLSH 0x4B #define ARC_REG_DC_FLSH 0x4B
#define ARC_REG_DC_FLDL 0x4C #define ARC_REG_DC_FLDL 0x4C
#if defined(CONFIG_ARC_MMU_V3) || defined (CONFIG_ARC_MMU_V4) #if defined(CONFIG_ARC_MMU_V3)
#define ARC_REG_DC_PTAG 0x5C #define ARC_REG_DC_PTAG 0x5C
#endif #endif
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#ifndef _UAPI__ASM_ARC_PTRACE_H #ifndef _UAPI__ASM_ARC_PTRACE_H
#define _UAPI__ASM_ARC_PTRACE_H #define _UAPI__ASM_ARC_PTRACE_H
#define PTRACE_GET_THREAD_AREA 25
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/* /*
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
* -This is the more "natural" hand written assembler * -This is the more "natural" hand written assembler
*/ */
#include <linux/linkage.h>
#include <asm/entry.h> /* For the SAVE_* macros */ #include <asm/entry.h> /* For the SAVE_* macros */
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/linkage.h>
#define KSP_WORD_OFF ((TASK_THREAD + THREAD_KSP) / 4) #define KSP_WORD_OFF ((TASK_THREAD + THREAD_KSP) / 4)
......
...@@ -41,7 +41,7 @@ const struct machine_desc * __init setup_machine_fdt(void *dt) ...@@ -41,7 +41,7 @@ const struct machine_desc * __init setup_machine_fdt(void *dt)
{ {
const struct machine_desc *mdesc; const struct machine_desc *mdesc;
unsigned long dt_root; unsigned long dt_root;
void *clk; const void *clk;
int len; int len;
if (!early_init_dt_scan(dt)) if (!early_init_dt_scan(dt))
......
...@@ -77,10 +77,11 @@ stext: ...@@ -77,10 +77,11 @@ stext:
; Clear BSS before updating any globals ; Clear BSS before updating any globals
; XXX: use ZOL here ; XXX: use ZOL here
mov r5, __bss_start mov r5, __bss_start
mov r6, __bss_stop sub r6, __bss_stop, r5
lsr.f lp_count, r6, 2
lpnz 1f
st.ab 0, [r5, 4]
1: 1:
st.ab 0, [r5,4]
brlt r5, r6, 1b
; Uboot - kernel ABI ; Uboot - kernel ABI
; r0 = [0] No uboot interaction, [1] cmdline in r2, [2] DTB in r2 ; r0 = [0] No uboot interaction, [1] cmdline in r2, [2] DTB in r2
......
...@@ -146,6 +146,10 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -146,6 +146,10 @@ long arch_ptrace(struct task_struct *child, long request,
pr_debug("REQ=%ld: ADDR =0x%lx, DATA=0x%lx)\n", request, addr, data); pr_debug("REQ=%ld: ADDR =0x%lx, DATA=0x%lx)\n", request, addr, data);
switch (request) { switch (request) {
case PTRACE_GET_THREAD_AREA:
ret = put_user(task_thread_info(child)->thr_ptr,
(unsigned long __user *)data);
break;
default: default:
ret = ptrace_request(child, request, addr, data); ret = ptrace_request(child, request, addr, data);
break; break;
......
...@@ -337,8 +337,19 @@ irqreturn_t do_IPI(int irq, void *dev_id) ...@@ -337,8 +337,19 @@ irqreturn_t do_IPI(int irq, void *dev_id)
* API called by platform code to hookup arch-common ISR to their IPI IRQ * API called by platform code to hookup arch-common ISR to their IPI IRQ
*/ */
static DEFINE_PER_CPU(int, ipi_dev); static DEFINE_PER_CPU(int, ipi_dev);
static struct irqaction arc_ipi_irq = {
.name = "IPI Interrupt",
.flags = IRQF_PERCPU,
.handler = do_IPI,
};
int smp_ipi_irq_setup(int cpu, int irq) int smp_ipi_irq_setup(int cpu, int irq)
{ {
int *dev_id = &per_cpu(ipi_dev, smp_processor_id()); if (!cpu)
return request_percpu_irq(irq, do_IPI, "IPI Interrupt", dev_id); return setup_irq(irq, &arc_ipi_irq);
else
arch_unmask_irq(irq);
return 0;
} }
...@@ -116,7 +116,7 @@ SECTIONS ...@@ -116,7 +116,7 @@ SECTIONS
_edata = .; _edata = .;
BSS_SECTION(0, 0, 0) BSS_SECTION(4, 4, 4)
#ifdef CONFIG_ARC_DW2_UNWIND #ifdef CONFIG_ARC_DW2_UNWIND
. = ALIGN(PAGE_SIZE); . = ALIGN(PAGE_SIZE);
......
...@@ -389,7 +389,7 @@ static inline void __dc_line_op(unsigned long paddr, unsigned long vaddr, ...@@ -389,7 +389,7 @@ static inline void __dc_line_op(unsigned long paddr, unsigned long vaddr,
/*********************************************************** /***********************************************************
* Machine specific helper for per line I-Cache invalidate. * Machine specific helper for per line I-Cache invalidate.
*/ */
static void __ic_line_inv_vaddr(unsigned long paddr, unsigned long vaddr, static void __ic_line_inv_vaddr_local(unsigned long paddr, unsigned long vaddr,
unsigned long sz) unsigned long sz)
{ {
unsigned long flags; unsigned long flags;
...@@ -405,6 +405,23 @@ static inline void __ic_entire_inv(void) ...@@ -405,6 +405,23 @@ static inline void __ic_entire_inv(void)
read_aux_reg(ARC_REG_IC_CTRL); /* blocks */ read_aux_reg(ARC_REG_IC_CTRL); /* blocks */
} }
struct ic_line_inv_vaddr_ipi {
unsigned long paddr, vaddr;
int sz;
};
static void __ic_line_inv_vaddr_helper(void *info)
{
struct ic_line_inv_vaddr_ipi *ic_inv = (struct ic_line_inv_vaddr_ipi*) info;
__ic_line_inv_vaddr_local(ic_inv->paddr, ic_inv->vaddr, ic_inv->sz);
}
static void __ic_line_inv_vaddr(unsigned long paddr, unsigned long vaddr,
unsigned long sz)
{
struct ic_line_inv_vaddr_ipi ic_inv = { paddr, vaddr , sz};
on_each_cpu(__ic_line_inv_vaddr_helper, &ic_inv, 1);
}
#else #else
#define __ic_entire_inv() #define __ic_entire_inv()
...@@ -553,12 +570,8 @@ void flush_icache_range(unsigned long kstart, unsigned long kend) ...@@ -553,12 +570,8 @@ void flush_icache_range(unsigned long kstart, unsigned long kend)
*/ */
void __sync_icache_dcache(unsigned long paddr, unsigned long vaddr, int len) void __sync_icache_dcache(unsigned long paddr, unsigned long vaddr, int len)
{ {
unsigned long flags;
local_irq_save(flags);
__ic_line_inv_vaddr(paddr, vaddr, len);
__dc_line_op(paddr, vaddr, len, OP_FLUSH_N_INV); __dc_line_op(paddr, vaddr, len, OP_FLUSH_N_INV);
local_irq_restore(flags); __ic_line_inv_vaddr(paddr, vaddr, len);
} }
/* wrapper to compile time eliminate alignment checks in flush loop */ /* wrapper to compile time eliminate alignment checks in flush loop */
......
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