Skip to content

Commit

Permalink
Merge branch 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm
Browse files Browse the repository at this point in the history
* 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm:
  ARM: 6879/1: fix personality test wrt usage of domain handlers
  ARM: 6878/1: fix personality flag propagation across an exec
  ARM: 6877/1: the ADDR_NO_RANDOMIZE personality flag should be honored with mmap()
  ARM: 6876/1: Kconfig.debug: Remove unused CONFIG_DEBUG_ERRORS
  ARM: pxa: convert incorrect IRQ_TO_IRQ() to irq_to_gpio()
  ARM: mmp: align NR_BUILTIN_GPIO with gpio interrupt number
  ARM: pxa: align NR_BUILTIN_GPIO with GPIO interrupt number
  ARM: pxa: always clear LPM bits for PXA168 MFPR
  pcmcia: limit pxa2xx_trizeps4 subdriver to trizeps4 platform
  pcmcia: limit pxa2xx_balloon3 subdriver to balloon3 platform
  ARM: pxafb: Fix access to nonexistent member of pxafb_info
  ARM: 6872/1: arch:common:Makefile Remove unused config in the Makefile.
  ARM: 6868/1: Preserve the VFP state during fork
  ARM: 6867/1: Introduce THREAD_NOTIFY_COPY for copy_thread() hooks
  ARM: 6866/1: Do not restrict HIGHPTE to !OUTER_CACHE
  ARM: 6865/1: perf: ensure pass through zero is counted on overflow
  ARM: 6864/1: hw_breakpoint: clear DBGVCR out of reset
  ARM: Only allow PM_SLEEP with CPUs which support suspend
  ARM: Make consolidated PM sleep code depend on PM_SLEEP
  • Loading branch information
torvalds committed Apr 16, 2011
2 parents c153001 + 88b9ef4 commit c98ece6
Show file tree
Hide file tree
Showing 28 changed files with 108 additions and 52 deletions.
3 changes: 2 additions & 1 deletion arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,6 @@ config HIGHMEM
config HIGHPTE
bool "Allocate 2nd-level pagetables from highmem"
depends on HIGHMEM
depends on !OUTER_CACHE

config HW_PERF_EVENTS
bool "Enable hardware performance counter support for perf events"
Expand Down Expand Up @@ -2012,6 +2011,8 @@ source "kernel/power/Kconfig"

config ARCH_SUSPEND_POSSIBLE
depends on !ARCH_S5P64X0 && !ARCH_S5P6442
depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \
CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE
def_bool y

endmenu
Expand Down
11 changes: 0 additions & 11 deletions arch/arm/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,6 @@ config DEBUG_USER
8 - SIGSEGV faults
16 - SIGBUS faults

config DEBUG_ERRORS
bool "Verbose kernel error messages"
depends on DEBUG_KERNEL
help
This option controls verbose debugging information which can be
printed when the kernel detects an internal error. This debugging
information is useful to kernel hackers when tracking down problems,
but mostly meaningless to other people. It's safe to say Y unless
you are concerned with the code size or don't want to see these
messages.

config DEBUG_STACK_USAGE
bool "Enable stack utilization instrumentation"
depends on DEBUG_KERNEL
Expand Down
1 change: 0 additions & 1 deletion arch/arm/common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ obj-$(CONFIG_SHARP_SCOOP) += scoop.o
obj-$(CONFIG_ARCH_IXP2000) += uengine.o
obj-$(CONFIG_ARCH_IXP23XX) += uengine.o
obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o
obj-$(CONFIG_COMMON_CLKDEV) += clkdev.o
obj-$(CONFIG_ARM_TIMER_SP804) += timer-sp.o
1 change: 1 addition & 0 deletions arch/arm/include/asm/thread_notify.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ static inline void thread_notify(unsigned long rc, struct thread_info *thread)
#define THREAD_NOTIFY_FLUSH 0
#define THREAD_NOTIFY_EXIT 1
#define THREAD_NOTIFY_SWITCH 2
#define THREAD_NOTIFY_COPY 3

#endif
#endif
2 changes: 1 addition & 1 deletion arch/arm/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ obj-$(CONFIG_MODULES) += armksyms.o module.o
obj-$(CONFIG_ARTHUR) += arthur.o
obj-$(CONFIG_ISA_DMA) += dma-isa.o
obj-$(CONFIG_PCI) += bios32.o isa.o
obj-$(CONFIG_PM) += sleep.o
obj-$(CONFIG_PM_SLEEP) += sleep.o
obj-$(CONFIG_HAVE_SCHED_CLOCK) += sched_clock.o
obj-$(CONFIG_SMP) += smp.o smp_tlb.o
obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o
Expand Down
17 changes: 12 additions & 5 deletions arch/arm/kernel/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,22 @@ EXPORT_SYMBOL(elf_check_arch);
void elf_set_personality(const struct elf32_hdr *x)
{
unsigned int eflags = x->e_flags;
unsigned int personality = PER_LINUX_32BIT;
unsigned int personality = current->personality & ~PER_MASK;

/*
* We only support Linux ELF executables, so always set the
* personality to LINUX.
*/
personality |= PER_LINUX;

/*
* APCS-26 is only valid for OABI executables
*/
if ((eflags & EF_ARM_EABI_MASK) == EF_ARM_EABI_UNKNOWN) {
if (eflags & EF_ARM_APCS_26)
personality = PER_LINUX;
}
if ((eflags & EF_ARM_EABI_MASK) == EF_ARM_EABI_UNKNOWN &&
(eflags & EF_ARM_APCS_26))
personality &= ~ADDR_LIMIT_32BIT;
else
personality |= ADDR_LIMIT_32BIT;

set_personality(personality);

Expand Down
7 changes: 7 additions & 0 deletions arch/arm/kernel/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,13 @@ static void reset_ctrl_regs(void *info)
*/
asm volatile("mcr p14, 0, %0, c1, c0, 4" : : "r" (0));
isb();

/*
* Clear any configured vector-catch events before
* enabling monitor mode.
*/
asm volatile("mcr p14, 0, %0, c0, c7, 0" : : "r" (0));
isb();
}

if (enable_monitor_mode())
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ armpmu_event_update(struct perf_event *event,
prev_raw_count &= armpmu->max_period;

if (overflow)
delta = armpmu->max_period - prev_raw_count + new_raw_count;
delta = armpmu->max_period - prev_raw_count + new_raw_count + 1;
else
delta = new_raw_count - prev_raw_count;

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
if (clone_flags & CLONE_SETTLS)
thread->tp_value = regs->ARM_r3;

thread_notify(THREAD_NOTIFY_COPY, thread);

return 0;
}

Expand Down
3 changes: 1 addition & 2 deletions arch/arm/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,7 @@ static int bad_syscall(int n, struct pt_regs *regs)
struct thread_info *thread = current_thread_info();
siginfo_t info;

if (current->personality != PER_LINUX &&
current->personality != PER_LINUX_32BIT &&
if ((current->personality & PER_MASK) != PER_LINUX &&
thread->exec_domain->handler) {
thread->exec_domain->handler(n, regs);
return regs->ARM_r0;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-mmp/include/mach/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
#define GPIO_REG(x) (*((volatile u32 *)(GPIO_REGS_VIRT + (x))))

#define NR_BUILTIN_GPIO (192)
#define NR_BUILTIN_GPIO IRQ_GPIO_NUM

#define gpio_to_bank(gpio) ((gpio) >> 5)
#define gpio_to_irq(gpio) (IRQ_GPIO_START + (gpio))
Expand Down
9 changes: 9 additions & 0 deletions arch/arm/mach-mmp/include/mach/mfp-pxa168.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
#define MFP_DRIVE_MEDIUM (0x2 << 13)
#define MFP_DRIVE_FAST (0x3 << 13)

#undef MFP_CFG
#undef MFP_CFG_DRV

#define MFP_CFG(pin, af) \
(MFP_LPM_INPUT | MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_DRIVE_MEDIUM)

#define MFP_CFG_DRV(pin, af, drv) \
(MFP_LPM_INPUT | MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_DRIVE_##drv)

/* GPIO */
#define GPIO0_GPIO MFP_CFG(GPIO0, AF5)
#define GPIO1_GPIO MFP_CFG(GPIO1, AF5)
Expand Down
17 changes: 15 additions & 2 deletions arch/arm/mach-pxa/include/mach/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,24 @@
#define GAFR(x) GPIO_REG(0x54 + (((x) & 0x70) >> 2))


#define NR_BUILTIN_GPIO 128
#define NR_BUILTIN_GPIO PXA_GPIO_IRQ_NUM

#define gpio_to_bank(gpio) ((gpio) >> 5)
#define gpio_to_irq(gpio) IRQ_GPIO(gpio)
#define irq_to_gpio(irq) IRQ_TO_GPIO(irq)

static inline int irq_to_gpio(unsigned int irq)
{
int gpio;

if (irq == IRQ_GPIO0 || irq == IRQ_GPIO1)
return irq - IRQ_GPIO0;

gpio = irq - PXA_GPIO_IRQ_BASE;
if (gpio >= 2 && gpio < NR_BUILTIN_GPIO)
return gpio;

return -1;
}

#ifdef CONFIG_CPU_PXA26x
/* GPIO86/87/88/89 on PXA26x have their direction bits in GPDR2 inverted,
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/mach-pxa/include/mach/irqs.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@
#define GPIO_2_x_TO_IRQ(x) (PXA_GPIO_IRQ_BASE + (x))
#define IRQ_GPIO(x) (((x) < 2) ? (IRQ_GPIO0 + (x)) : GPIO_2_x_TO_IRQ(x))

#define IRQ_TO_GPIO_2_x(i) ((i) - PXA_GPIO_IRQ_BASE)
#define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i))

/*
* The following interrupts are for board specific purposes. Since
* the kernel can only run on one machine at a time, we can re-use
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/pxa25x.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ static inline void pxa25x_init_pm(void) {}

static int pxa25x_set_wake(struct irq_data *d, unsigned int on)
{
int gpio = IRQ_TO_GPIO(d->irq);
int gpio = irq_to_gpio(d->irq);
uint32_t mask = 0;

if (gpio >= 0 && gpio < 85)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/pxa27x.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static inline void pxa27x_init_pm(void) {}
*/
static int pxa27x_set_wake(struct irq_data *d, unsigned int on)
{
int gpio = IRQ_TO_GPIO(d->irq);
int gpio = irq_to_gpio(d->irq);
uint32_t mask;

if (gpio >= 0 && gpio < 128)
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <linux/shm.h>
#include <linux/sched.h>
#include <linux/io.h>
#include <linux/personality.h>
#include <linux/random.h>
#include <asm/cputype.h>
#include <asm/system.h>
Expand Down Expand Up @@ -82,7 +83,8 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
mm->cached_hole_size = 0;
}
/* 8 bits of randomness in 20 address space bits */
if (current->flags & PF_RANDOMIZE)
if ((current->flags & PF_RANDOMIZE) &&
!(current->personality & ADDR_NO_RANDOMIZE))
addr += (get_random_int() % (1 << 8)) << PAGE_SHIFT;

full_search:
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-arm920.S
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ ENTRY(cpu_arm920_set_pte_ext)
/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
.globl cpu_arm920_suspend_size
.equ cpu_arm920_suspend_size, 4 * 3
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
ENTRY(cpu_arm920_do_suspend)
stmfd sp!, {r4 - r7, lr}
mrc p15, 0, r4, c13, c0, 0 @ PID
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-arm926.S
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ ENTRY(cpu_arm926_set_pte_ext)
/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
.globl cpu_arm926_suspend_size
.equ cpu_arm926_suspend_size, 4 * 3
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
ENTRY(cpu_arm926_do_suspend)
stmfd sp!, {r4 - r7, lr}
mrc p15, 0, r4, c13, c0, 0 @ PID
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-sa1100.S
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ ENTRY(cpu_sa1100_set_pte_ext)

.globl cpu_sa1100_suspend_size
.equ cpu_sa1100_suspend_size, 4*4
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
ENTRY(cpu_sa1100_do_suspend)
stmfd sp!, {r4 - r7, lr}
mrc p15, 0, r4, c3, c0, 0 @ domain ID
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-v6.S
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ ENTRY(cpu_v6_set_pte_ext)
/* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */
.globl cpu_v6_suspend_size
.equ cpu_v6_suspend_size, 4 * 8
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
ENTRY(cpu_v6_do_suspend)
stmfd sp!, {r4 - r11, lr}
mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-v7.S
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ cpu_v7_name:
/* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */
.globl cpu_v7_suspend_size
.equ cpu_v7_suspend_size, 4 * 8
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
ENTRY(cpu_v7_do_suspend)
stmfd sp!, {r4 - r11, lr}
mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-xsc3.S
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ ENTRY(cpu_xsc3_set_pte_ext)

.globl cpu_xsc3_suspend_size
.equ cpu_xsc3_suspend_size, 4 * 8
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
ENTRY(cpu_xsc3_do_suspend)
stmfd sp!, {r4 - r10, lr}
mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/proc-xscale.S
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ ENTRY(cpu_xscale_set_pte_ext)

.globl cpu_xscale_suspend_size
.equ cpu_xscale_suspend_size, 4 * 7
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
ENTRY(cpu_xscale_do_suspend)
stmfd sp!, {r4 - r10, lr}
mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
Expand Down
34 changes: 27 additions & 7 deletions arch/arm/vfp/vfpmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ static void vfp_thread_exit(struct thread_info *thread)
put_cpu();
}

static void vfp_thread_copy(struct thread_info *thread)
{
struct thread_info *parent = current_thread_info();

vfp_sync_hwstate(parent);
thread->vfpstate = parent->vfpstate;
}

/*
* When this function is called with the following 'cmd's, the following
* is true while this function is being run:
Expand All @@ -104,12 +112,17 @@ static void vfp_thread_exit(struct thread_info *thread)
static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
{
struct thread_info *thread = v;
u32 fpexc;
#ifdef CONFIG_SMP
unsigned int cpu;
#endif

if (likely(cmd == THREAD_NOTIFY_SWITCH)) {
u32 fpexc = fmrx(FPEXC);
switch (cmd) {
case THREAD_NOTIFY_SWITCH:
fpexc = fmrx(FPEXC);

#ifdef CONFIG_SMP
unsigned int cpu = thread->cpu;
cpu = thread->cpu;

/*
* On SMP, if VFP is enabled, save the old state in
Expand All @@ -134,13 +147,20 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
* old state.
*/
fmxr(FPEXC, fpexc & ~FPEXC_EN);
return NOTIFY_DONE;
}
break;

if (cmd == THREAD_NOTIFY_FLUSH)
case THREAD_NOTIFY_FLUSH:
vfp_thread_flush(thread);
else
break;

case THREAD_NOTIFY_EXIT:
vfp_thread_exit(thread);
break;

case THREAD_NOTIFY_COPY:
vfp_thread_copy(thread);
break;
}

return NOTIFY_DONE;
}
Expand Down
5 changes: 5 additions & 0 deletions drivers/pcmcia/pxa2xx_balloon3.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include <mach/balloon3.h>

#include <asm/mach-types.h>

#include "soc_common.h"

/*
Expand Down Expand Up @@ -127,6 +129,9 @@ static int __init balloon3_pcmcia_init(void)
{
int ret;

if (!machine_is_balloon3())
return -ENODEV;

balloon3_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
if (!balloon3_pcmcia_device)
return -ENOMEM;
Expand Down
Loading

0 comments on commit c98ece6

Please sign in to comment.