Skip to content

Commit

Permalink
Merge tag 'arc-fixes-for-3.16' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Linus Torvalds committed Jun 28, 2014
2 parents 8dd68eb + 2328af0 commit 1857a5b
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 16 deletions.
4 changes: 2 additions & 2 deletions arch/arc/include/asm/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extern void read_decode_cache_bcr(void);
#define ARC_REG_IC_IVIC 0x10
#define ARC_REG_IC_CTRL 0x11
#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
#endif

Expand All @@ -74,7 +74,7 @@ extern void read_decode_cache_bcr(void);
#define ARC_REG_DC_IVDL 0x4A
#define ARC_REG_DC_FLSH 0x4B
#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
#endif

Expand Down
1 change: 1 addition & 0 deletions arch/arc/include/uapi/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#ifndef _UAPI__ASM_ARC_PTRACE_H
#define _UAPI__ASM_ARC_PTRACE_H

#define PTRACE_GET_THREAD_AREA 25

#ifndef __ASSEMBLY__
/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arc/kernel/ctx_sw_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
* -This is the more "natural" hand written assembler
*/

#include <linux/linkage.h>
#include <asm/entry.h> /* For the SAVE_* macros */
#include <asm/asm-offsets.h>
#include <asm/linkage.h>

#define KSP_WORD_OFF ((TASK_THREAD + THREAD_KSP) / 4)

Expand Down
2 changes: 1 addition & 1 deletion arch/arc/kernel/devtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const struct machine_desc * __init setup_machine_fdt(void *dt)
{
const struct machine_desc *mdesc;
unsigned long dt_root;
void *clk;
const void *clk;
int len;

if (!early_init_dt_scan(dt))
Expand Down
7 changes: 4 additions & 3 deletions arch/arc/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ stext:
; Clear BSS before updating any globals
; XXX: use ZOL here
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:
st.ab 0, [r5,4]
brlt r5, r6, 1b

; Uboot - kernel ABI
; r0 = [0] No uboot interaction, [1] cmdline in r2, [2] DTB in r2
Expand Down
4 changes: 4 additions & 0 deletions arch/arc/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

switch (request) {
case PTRACE_GET_THREAD_AREA:
ret = put_user(task_thread_info(child)->thr_ptr,
(unsigned long __user *)data);
break;
default:
ret = ptrace_request(child, request, addr, data);
break;
Expand Down
15 changes: 13 additions & 2 deletions arch/arc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
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 *dev_id = &per_cpu(ipi_dev, smp_processor_id());
return request_percpu_irq(irq, do_IPI, "IPI Interrupt", dev_id);
if (!cpu)
return setup_irq(irq, &arc_ipi_irq);
else
arch_unmask_irq(irq);

return 0;
}
2 changes: 1 addition & 1 deletion arch/arc/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ SECTIONS

_edata = .;

BSS_SECTION(0, 0, 0)
BSS_SECTION(4, 4, 4)

#ifdef CONFIG_ARC_DW2_UNWIND
. = ALIGN(PAGE_SIZE);
Expand Down
25 changes: 19 additions & 6 deletions arch/arc/mm/cache_arc700.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
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 flags;
Expand All @@ -405,6 +405,23 @@ static inline void __ic_entire_inv(void)
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

#define __ic_entire_inv()
Expand Down Expand Up @@ -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)
{
unsigned long flags;

local_irq_save(flags);
__ic_line_inv_vaddr(paddr, vaddr, len);
__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 */
Expand Down

0 comments on commit 1857a5b

Please sign in to comment.