Skip to content

Commit

Permalink
Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm
Browse files Browse the repository at this point in the history
* 'fixes' of git://git.linaro.org/people/rmk/linux-arm: (31 commits)
  ARM: 7304/1: ioremap: fix boundary check when reusing static mapping
  ARM: 7301/1: Rename the T() macro to TUSER() to avoid namespace conflicts
  ARM: 7299/1: ftrace: clear zero bit in reported IPs for Thumb-2
  ARM: 7298/1: realview: fix mapping of MPCore private memory region
  PCMCIA: fix sa1111 oops on remove
  ARM: 7288/1: mach-sa1100: add missing module_init() call
  ARM: 7297/1: smp_twd: make sure timer is stopped before registering it
  ARM: 7296/1: proc-v7.S: remove HARVARD_CACHE preprocessor guards
  ARM: 7295/1: cortex-a7: move proc_info out of !CONFIG_ARM_LPAE block
  ARM: 7293/1: logical_cpu_map: decouple CPU mapping from SMP
  ARM: 7291/1: cache: assume 64-byte L1 cachelines for ARMv7 CPUs
  ARM: 7290/1: vmlinux.lds.S: align the exception fixup table to a 4-byte boundary
  ARM: 7289/1: vmlinux.lds.S: do not hardcode cacheline size as 32 bytes
  MFD: ucb1x00-ts: fix resume failure
  MFD: ucb1x00-core: fix gpiolib direction_output handling
  MFD: ucb1x00-core: fix missing restore of io output data on resume
  MFD: mcp-core: fix mcp_priv() to be more type safe
  MFD: mcp-core: fix complaints from the genirq layer
  Revert "ARM: sa11x0: Implement autoloading of codec and codec pdata for mcp bus."
  Revert "ARM: sa1100: Refactor mcp-sa11x0 to use platform resources."
  ...

Fix up conflict due to arch/arm/mach-mx5/Kconfig having been merged into
mach-imx5 (commit 784a90c: "ARM i.MX: Merge i.MX5 support into
mach-imx"), but the ARM_L1_CACHE_SHIFT_6 entry was moved to be driven by
the CPU_V7 logic from it in the old location in rmk's branch (commit
a092f2b: "ARM: 7291/1: cache: assume 64-byte L1 cachelines for
ARMv7 CPUs").
  • Loading branch information
Linus Torvalds committed Jan 28, 2012
2 parents 81bc300 + 3c424f3 commit deb9b4c
Show file tree
Hide file tree
Showing 69 changed files with 428 additions and 827 deletions.
4 changes: 1 addition & 3 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ config ARCH_SA1100
select ARCH_HAS_CPUFREQ
select CPU_FREQ
select GENERIC_CLOCKEVENTS
select CLKDEV_LOOKUP
select HAVE_CLK
select HAVE_SCHED_CLOCK
select TICK_ONESHOT
select ARCH_REQUIRE_GPIOLIB
Expand Down Expand Up @@ -825,7 +825,6 @@ config ARCH_S5PC100
select HAVE_CLK
select CLKDEV_LOOKUP
select CPU_V7
select ARM_L1_CACHE_SHIFT_6
select ARCH_USES_GETTIMEOFFSET
select HAVE_S3C2410_I2C if I2C
select HAVE_S3C_RTC if RTC_CLASS
Expand All @@ -842,7 +841,6 @@ config ARCH_S5PV210
select HAVE_CLK
select CLKDEV_LOOKUP
select CLKSRC_MMIO
select ARM_L1_CACHE_SHIFT_6
select ARCH_HAS_CPUFREQ
select GENERIC_CLOCKEVENTS
select HAVE_SCHED_CLOCK
Expand Down
7 changes: 2 additions & 5 deletions arch/arm/common/gic.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

#include <asm/irq.h>
#include <asm/exception.h>
#include <asm/smp_plat.h>
#include <asm/mach/irq.h>
#include <asm/hardware/gic.h>

Expand Down Expand Up @@ -352,11 +353,7 @@ static void __init gic_dist_init(struct gic_chip_data *gic)
unsigned int gic_irqs = gic->gic_irqs;
struct irq_domain *domain = &gic->domain;
void __iomem *base = gic_data_dist_base(gic);
u32 cpu = 0;

#ifdef CONFIG_SMP
cpu = cpu_logical_map(smp_processor_id());
#endif
u32 cpu = cpu_logical_map(smp_processor_id());

cpumask = 1 << cpu;
cpumask |= cpumask << 8;
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/include/asm/assembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
*/
#ifdef CONFIG_THUMB2_KERNEL

.macro usraccoff, instr, reg, ptr, inc, off, cond, abort, t=T()
.macro usraccoff, instr, reg, ptr, inc, off, cond, abort, t=TUSER()
9999:
.if \inc == 1
\instr\cond\()b\()\t\().w \reg, [\ptr, #\off]
Expand Down Expand Up @@ -277,7 +277,7 @@

#else /* !CONFIG_THUMB2_KERNEL */

.macro usracc, instr, reg, ptr, inc, cond, rept, abort, t=T()
.macro usracc, instr, reg, ptr, inc, cond, rept, abort, t=TUSER()
.rept \rept
9999:
.if \inc == 1
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/include/asm/domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
* instructions (inline assembly)
*/
#ifdef CONFIG_CPU_USE_DOMAINS
#define T(instr) #instr "t"
#define TUSER(instr) #instr "t"
#else
#define T(instr) #instr
#define TUSER(instr) #instr
#endif

#else /* __ASSEMBLY__ */
Expand All @@ -95,9 +95,9 @@
* instructions
*/
#ifdef CONFIG_CPU_USE_DOMAINS
#define T(instr) instr ## t
#define TUSER(instr) instr ## t
#else
#define T(instr) instr
#define TUSER(instr) instr
#endif

#endif /* __ASSEMBLY__ */
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/include/asm/futex.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,

#define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg) \
__asm__ __volatile__( \
"1: " T(ldr) " %1, [%3]\n" \
"1: " TUSER(ldr) " %1, [%3]\n" \
" " insn "\n" \
"2: " T(str) " %0, [%3]\n" \
"2: " TUSER(str) " %0, [%3]\n" \
" mov %0, #0\n" \
__futex_atomic_ex_table("%5") \
: "=&r" (ret), "=&r" (oldval), "=&r" (tmp) \
Expand All @@ -95,10 +95,10 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
return -EFAULT;

__asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n"
"1: " T(ldr) " %1, [%4]\n"
"1: " TUSER(ldr) " %1, [%4]\n"
" teq %1, %2\n"
" it eq @ explicit IT needed for the 2b label\n"
"2: " T(streq) " %3, [%4]\n"
"2: " TUSER(streq) " %3, [%4]\n"
__futex_atomic_ex_table("%5")
: "+r" (ret), "=&r" (val)
: "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT)
Expand Down
6 changes: 0 additions & 6 deletions arch/arm/include/asm/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ extern void platform_secondary_init(unsigned int cpu);
*/
extern void platform_smp_prepare_cpus(unsigned int);

/*
* Logical CPU mapping.
*/
extern int __cpu_logical_map[NR_CPUS];
#define cpu_logical_map(cpu) __cpu_logical_map[cpu]

/*
* Initial data for bringing up a secondary CPU.
*/
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/include/asm/smp_plat.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,10 @@ static inline int cache_ops_need_broadcast(void)
}
#endif

/*
* Logical CPU mapping.
*/
extern int __cpu_logical_map[];
#define cpu_logical_map(cpu) __cpu_logical_map[cpu]

#endif
16 changes: 8 additions & 8 deletions arch/arm/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ do { \

#define __get_user_asm_byte(x,addr,err) \
__asm__ __volatile__( \
"1: " T(ldrb) " %1,[%2],#0\n" \
"1: " TUSER(ldrb) " %1,[%2],#0\n" \
"2:\n" \
" .pushsection .fixup,\"ax\"\n" \
" .align 2\n" \
Expand Down Expand Up @@ -263,7 +263,7 @@ do { \

#define __get_user_asm_word(x,addr,err) \
__asm__ __volatile__( \
"1: " T(ldr) " %1,[%2],#0\n" \
"1: " TUSER(ldr) " %1,[%2],#0\n" \
"2:\n" \
" .pushsection .fixup,\"ax\"\n" \
" .align 2\n" \
Expand Down Expand Up @@ -308,7 +308,7 @@ do { \

#define __put_user_asm_byte(x,__pu_addr,err) \
__asm__ __volatile__( \
"1: " T(strb) " %1,[%2],#0\n" \
"1: " TUSER(strb) " %1,[%2],#0\n" \
"2:\n" \
" .pushsection .fixup,\"ax\"\n" \
" .align 2\n" \
Expand Down Expand Up @@ -341,7 +341,7 @@ do { \

#define __put_user_asm_word(x,__pu_addr,err) \
__asm__ __volatile__( \
"1: " T(str) " %1,[%2],#0\n" \
"1: " TUSER(str) " %1,[%2],#0\n" \
"2:\n" \
" .pushsection .fixup,\"ax\"\n" \
" .align 2\n" \
Expand All @@ -366,10 +366,10 @@ do { \

#define __put_user_asm_dword(x,__pu_addr,err) \
__asm__ __volatile__( \
ARM( "1: " T(str) " " __reg_oper1 ", [%1], #4\n" ) \
ARM( "2: " T(str) " " __reg_oper0 ", [%1]\n" ) \
THUMB( "1: " T(str) " " __reg_oper1 ", [%1]\n" ) \
THUMB( "2: " T(str) " " __reg_oper0 ", [%1, #4]\n" ) \
ARM( "1: " TUSER(str) " " __reg_oper1 ", [%1], #4\n" ) \
ARM( "2: " TUSER(str) " " __reg_oper0 ", [%1]\n" ) \
THUMB( "1: " TUSER(str) " " __reg_oper1 ", [%1]\n" ) \
THUMB( "2: " TUSER(str) " " __reg_oper0 ", [%1, #4]\n" ) \
"3:\n" \
" .pushsection .fixup,\"ax\"\n" \
" .align 2\n" \
Expand Down
15 changes: 9 additions & 6 deletions arch/arm/kernel/entry-common.S
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ ENDPROC(ret_from_fork)
#endif
#endif

.macro mcount_adjust_addr rd, rn
bic \rd, \rn, #1 @ clear the Thumb bit if present
sub \rd, \rd, #MCOUNT_INSN_SIZE
.endm

.macro __mcount suffix
mcount_enter
ldr r0, =ftrace_trace_function
Expand All @@ -173,8 +178,7 @@ ENDPROC(ret_from_fork)
mcount_exit

1: mcount_get_lr r1 @ lr of instrumented func
mov r0, lr @ instrumented function
sub r0, r0, #MCOUNT_INSN_SIZE
mcount_adjust_addr r0, lr @ instrumented function
adr lr, BSYM(2f)
mov pc, r2
2: mcount_exit
Expand All @@ -184,8 +188,7 @@ ENDPROC(ret_from_fork)
mcount_enter

mcount_get_lr r1 @ lr of instrumented func
mov r0, lr @ instrumented function
sub r0, r0, #MCOUNT_INSN_SIZE
mcount_adjust_addr r0, lr @ instrumented function

.globl ftrace_call\suffix
ftrace_call\suffix:
Expand All @@ -205,11 +208,11 @@ ftrace_graph_call\suffix:
#ifdef CONFIG_DYNAMIC_FTRACE
@ called from __ftrace_caller, saved in mcount_enter
ldr r1, [sp, #16] @ instrumented routine (func)
mcount_adjust_addr r1, r1
#else
@ called from __mcount, untouched in lr
mov r1, lr @ instrumented routine (func)
mcount_adjust_addr r1, lr @ instrumented routine (func)
#endif
sub r1, r1, #MCOUNT_INSN_SIZE
mov r2, fp @ frame pointer
bl prepare_ftrace_return
mcount_exit
Expand Down
17 changes: 15 additions & 2 deletions arch/arm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <linux/init.h>
#include <linux/kexec.h>
#include <linux/of_fdt.h>
#include <linux/crash_dump.h>
#include <linux/root_dev.h>
#include <linux/cpu.h>
#include <linux/interrupt.h>
Expand Down Expand Up @@ -160,7 +159,7 @@ static struct resource mem_res[] = {
.flags = IORESOURCE_MEM
},
{
.name = "Kernel text",
.name = "Kernel code",
.start = 0,
.end = 0,
.flags = IORESOURCE_MEM
Expand Down Expand Up @@ -427,6 +426,20 @@ void cpu_init(void)
: "r14");
}

int __cpu_logical_map[NR_CPUS];

void __init smp_setup_processor_id(void)
{
int i;
u32 cpu = is_smp() ? read_cpuid_mpidr() & 0xff : 0;

cpu_logical_map(0) = cpu;
for (i = 1; i < NR_CPUS; ++i)
cpu_logical_map(i) = i == cpu ? 0 : i;

printk(KERN_INFO "Booting Linux on physical CPU %d\n", cpu);
}

static void __init setup_processor(void)
{
struct proc_info_list *list;
Expand Down
24 changes: 8 additions & 16 deletions arch/arm/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,20 +233,6 @@ void __ref cpu_die(void)
}
#endif /* CONFIG_HOTPLUG_CPU */

int __cpu_logical_map[NR_CPUS];

void __init smp_setup_processor_id(void)
{
int i;
u32 cpu = is_smp() ? read_cpuid_mpidr() & 0xff : 0;

cpu_logical_map(0) = cpu;
for (i = 1; i < NR_CPUS; ++i)
cpu_logical_map(i) = i == cpu ? 0 : i;

printk(KERN_INFO "Booting Linux on physical CPU %d\n", cpu);
}

/*
* Called by both boot and secondaries to move global data into
* per-processor storage.
Expand Down Expand Up @@ -443,9 +429,7 @@ static DEFINE_PER_CPU(struct clock_event_device, percpu_clockevent);
static void ipi_timer(void)
{
struct clock_event_device *evt = &__get_cpu_var(percpu_clockevent);
irq_enter();
evt->event_handler(evt);
irq_exit();
}

#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
Expand Down Expand Up @@ -548,23 +532,31 @@ void handle_IPI(int ipinr, struct pt_regs *regs)

switch (ipinr) {
case IPI_TIMER:
irq_enter();
ipi_timer();
irq_exit();
break;

case IPI_RESCHEDULE:
scheduler_ipi();
break;

case IPI_CALL_FUNC:
irq_enter();
generic_smp_call_function_interrupt();
irq_exit();
break;

case IPI_CALL_FUNC_SINGLE:
irq_enter();
generic_smp_call_function_single_interrupt();
irq_exit();
break;

case IPI_CPU_STOP:
irq_enter();
ipi_cpu_stop(cpu);
irq_exit();
break;

default:
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/kernel/smp_twd.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk)
else
twd_calibrate_rate();

__raw_writel(0, twd_base + TWD_TIMER_CONTROL);

clk->name = "local_timer";
clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT |
CLOCK_EVT_FEAT_C3STOP;
Expand Down
9 changes: 5 additions & 4 deletions arch/arm/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <asm-generic/vmlinux.lds.h>
#include <asm/cache.h>
#include <asm/thread_info.h>
#include <asm/memory.h>
#include <asm/page.h>
Expand Down Expand Up @@ -181,7 +182,7 @@ SECTIONS
}
#endif

PERCPU_SECTION(32)
PERCPU_SECTION(L1_CACHE_BYTES)

#ifdef CONFIG_XIP_KERNEL
__data_loc = ALIGN(4); /* location in binary */
Expand Down Expand Up @@ -212,13 +213,13 @@ SECTIONS
#endif

NOSAVE_DATA
CACHELINE_ALIGNED_DATA(32)
READ_MOSTLY_DATA(32)
CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES)
READ_MOSTLY_DATA(L1_CACHE_BYTES)

/*
* The exception fixup table (might need resorting at runtime)
*/
. = ALIGN(32);
. = ALIGN(4);
__start___ex_table = .;
#ifdef CONFIG_MMU
*(__ex_table)
Expand Down
Loading

0 comments on commit deb9b4c

Please sign in to comment.