Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm

Pull ARM fixes from Russell King:
"Some more ARM fixes, nothing particularly major here. The biggest
change is to fix the SMP_ON_UP code so that it works with TI's Aegis
cores"

* 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
ARM: 7851/1: check for number of arguments in syscall_get/set_arguments()
ARM: 7846/1: Update SMP_ON_UP code to detect A9MPCore with 1 CPU devices
ARM: 7845/1: sharpsl_param.c: fix invalid memory access for pxa devices
ARM: 7843/1: drop asm/types.h from generic-y
ARM: 7842/1: MCPM: don't explode if invoked without being initialized first

+44 -9
+4 -2
arch/arm/common/mcpm_entry.c
··· 51 51 { 52 52 phys_reset_t phys_reset; 53 53 54 - BUG_ON(!platform_ops); 54 + if (WARN_ON_ONCE(!platform_ops || !platform_ops->power_down)) 55 + return; 55 56 BUG_ON(!irqs_disabled()); 56 57 57 58 /* ··· 94 93 { 95 94 phys_reset_t phys_reset; 96 95 97 - BUG_ON(!platform_ops); 96 + if (WARN_ON_ONCE(!platform_ops || !platform_ops->suspend)) 97 + return; 98 98 BUG_ON(!irqs_disabled()); 99 99 100 100 /* Very similar to mcpm_cpu_power_down() */
+4 -1
arch/arm/common/sharpsl_param.c
··· 15 15 #include <linux/module.h> 16 16 #include <linux/string.h> 17 17 #include <asm/mach/sharpsl_param.h> 18 + #include <asm/memory.h> 18 19 19 20 /* 20 21 * Certain hardware parameters determined at the time of device manufacture, ··· 26 25 */ 27 26 #ifdef CONFIG_ARCH_SA1100 28 27 #define PARAM_BASE 0xe8ffc000 28 + #define param_start(x) (void *)(x) 29 29 #else 30 30 #define PARAM_BASE 0xa0000a00 31 + #define param_start(x) __va(x) 31 32 #endif 32 33 #define MAGIC_CHG(a,b,c,d) ( ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a ) 33 34 ··· 44 41 45 42 void sharpsl_save_param(void) 46 43 { 47 - memcpy(&sharpsl_param, (void *)PARAM_BASE, sizeof(struct sharpsl_param_info)); 44 + memcpy(&sharpsl_param, param_start(PARAM_BASE), sizeof(struct sharpsl_param_info)); 48 45 49 46 if (sharpsl_param.comadj_keyword != COMADJ_MAGIC) 50 47 sharpsl_param.comadj=-1;
-1
arch/arm/include/asm/Kbuild
··· 31 31 generic-y += termios.h 32 32 generic-y += timex.h 33 33 generic-y += trace_clock.h 34 - generic-y += types.h 35 34 generic-y += unaligned.h
+10 -4
arch/arm/include/asm/mcpm.h
··· 76 76 * 77 77 * This must be called with interrupts disabled. 78 78 * 79 - * This does not return. Re-entry in the kernel is expected via 80 - * mcpm_entry_point. 79 + * On success this does not return. Re-entry in the kernel is expected 80 + * via mcpm_entry_point. 81 + * 82 + * This will return if mcpm_platform_register() has not been called 83 + * previously in which case the caller should take appropriate action. 81 84 */ 82 85 void mcpm_cpu_power_down(void); 83 86 ··· 101 98 * 102 99 * This must be called with interrupts disabled. 103 100 * 104 - * This does not return. Re-entry in the kernel is expected via 105 - * mcpm_entry_point. 101 + * On success this does not return. Re-entry in the kernel is expected 102 + * via mcpm_entry_point. 103 + * 104 + * This will return if mcpm_platform_register() has not been called 105 + * previously in which case the caller should take appropriate action. 106 106 */ 107 107 void mcpm_cpu_suspend(u64 expected_residency); 108 108
+6
arch/arm/include/asm/syscall.h
··· 57 57 unsigned int i, unsigned int n, 58 58 unsigned long *args) 59 59 { 60 + if (n == 0) 61 + return; 62 + 60 63 if (i + n > SYSCALL_MAX_ARGS) { 61 64 unsigned long *args_bad = args + SYSCALL_MAX_ARGS - i; 62 65 unsigned int n_bad = n + i - SYSCALL_MAX_ARGS; ··· 84 81 unsigned int i, unsigned int n, 85 82 const unsigned long *args) 86 83 { 84 + if (n == 0) 85 + return; 86 + 87 87 if (i + n > SYSCALL_MAX_ARGS) { 88 88 pr_warning("%s called with max args %d, handling only %d\n", 89 89 __func__, i + n, SYSCALL_MAX_ARGS);
+20 -1
arch/arm/kernel/head.S
··· 487 487 mrc p15, 0, r0, c0, c0, 5 @ read MPIDR 488 488 and r0, r0, #0xc0000000 @ multiprocessing extensions and 489 489 teq r0, #0x80000000 @ not part of a uniprocessor system? 490 - moveq pc, lr @ yes, assume SMP 490 + bne __fixup_smp_on_up @ no, assume UP 491 + 492 + @ Core indicates it is SMP. Check for Aegis SOC where a single 493 + @ Cortex-A9 CPU is present but SMP operations fault. 494 + mov r4, #0x41000000 495 + orr r4, r4, #0x0000c000 496 + orr r4, r4, #0x00000090 497 + teq r3, r4 @ Check for ARM Cortex-A9 498 + movne pc, lr @ Not ARM Cortex-A9, 499 + 500 + @ If a future SoC *does* use 0x0 as the PERIPH_BASE, then the 501 + @ below address check will need to be #ifdef'd or equivalent 502 + @ for the Aegis platform. 503 + mrc p15, 4, r0, c15, c0 @ get SCU base address 504 + teq r0, #0x0 @ '0' on actual UP A9 hardware 505 + beq __fixup_smp_on_up @ So its an A9 UP 506 + ldr r0, [r0, #4] @ read SCU Config 507 + and r0, r0, #0x3 @ number of CPUs 508 + teq r0, #0x0 @ is 1? 509 + movne pc, lr 491 510 492 511 __fixup_smp_on_up: 493 512 adr r0, 1f