aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2013-10-16 18:42:20 -0400
committerChris Zankel <chris@zankel.net>2014-01-14 13:19:55 -0500
commit59970753536d98d33efcbe4f119ad8e3e399a46b (patch)
tree7445d002749479bfea2938e591ce7b2e1d72df83 /arch/xtensa
parent6235153170db777296b6a47181056dd30a027d03 (diff)
xtensa: call check_s32c1i after trap_init
Otherwise exceptions may occur prior to exception handling mechanism initialization, resulting in silently dead system. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa')
-rw-r--r--arch/xtensa/kernel/setup.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
index 6e2b6638122d..9bc6f0644892 100644
--- a/arch/xtensa/kernel/setup.c
+++ b/arch/xtensa/kernel/setup.c
@@ -354,7 +354,8 @@ static inline int probed_compare_swap(int *v, int cmp, int set)
354 354
355/* Handle probed exception */ 355/* Handle probed exception */
356 356
357void __init do_probed_exception(struct pt_regs *regs, unsigned long exccause) 357static void __init do_probed_exception(struct pt_regs *regs,
358 unsigned long exccause)
358{ 359{
359 if (regs->pc == rcw_probe_pc) { /* exception on s32c1i ? */ 360 if (regs->pc == rcw_probe_pc) { /* exception on s32c1i ? */
360 regs->pc += 3; /* skip the s32c1i instruction */ 361 regs->pc += 3; /* skip the s32c1i instruction */
@@ -366,7 +367,7 @@ void __init do_probed_exception(struct pt_regs *regs, unsigned long exccause)
366 367
367/* Simple test of S32C1I (soc bringup assist) */ 368/* Simple test of S32C1I (soc bringup assist) */
368 369
369void __init check_s32c1i(void) 370static int __init check_s32c1i(void)
370{ 371{
371 int n, cause1, cause2; 372 int n, cause1, cause2;
372 void *handbus, *handdata, *handaddr; /* temporarily saved handlers */ 373 void *handbus, *handdata, *handaddr; /* temporarily saved handlers */
@@ -421,24 +422,21 @@ void __init check_s32c1i(void)
421 trap_set_handler(EXCCAUSE_LOAD_STORE_ERROR, handbus); 422 trap_set_handler(EXCCAUSE_LOAD_STORE_ERROR, handbus);
422 trap_set_handler(EXCCAUSE_LOAD_STORE_DATA_ERROR, handdata); 423 trap_set_handler(EXCCAUSE_LOAD_STORE_DATA_ERROR, handdata);
423 trap_set_handler(EXCCAUSE_LOAD_STORE_ADDR_ERROR, handaddr); 424 trap_set_handler(EXCCAUSE_LOAD_STORE_ADDR_ERROR, handaddr);
425 return 0;
424} 426}
425 427
426#else /* XCHAL_HAVE_S32C1I */ 428#else /* XCHAL_HAVE_S32C1I */
427 429
428/* This condition should not occur with a commercially deployed processor. 430/* This condition should not occur with a commercially deployed processor.
429 Display reminder for early engr test or demo chips / FPGA bitstreams */ 431 Display reminder for early engr test or demo chips / FPGA bitstreams */
430void __init check_s32c1i(void) 432static int __init check_s32c1i(void)
431{ 433{
432 pr_warn("Processor configuration lacks atomic compare-and-swap support!\n"); 434 pr_warn("Processor configuration lacks atomic compare-and-swap support!\n");
435 return 0;
433} 436}
434 437
435#endif /* XCHAL_HAVE_S32C1I */ 438#endif /* XCHAL_HAVE_S32C1I */
436#else /* CONFIG_S32C1I_SELFTEST */ 439early_initcall(check_s32c1i);
437
438void __init check_s32c1i(void)
439{
440}
441
442#endif /* CONFIG_S32C1I_SELFTEST */ 440#endif /* CONFIG_S32C1I_SELFTEST */
443 441
444 442
@@ -447,8 +445,6 @@ void __init setup_arch(char **cmdline_p)
447 strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); 445 strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
448 *cmdline_p = command_line; 446 *cmdline_p = command_line;
449 447
450 check_s32c1i();
451
452 /* Reserve some memory regions */ 448 /* Reserve some memory regions */
453 449
454#ifdef CONFIG_BLK_DEV_INITRD 450#ifdef CONFIG_BLK_DEV_INITRD