File tree Expand file tree Collapse file tree 6 files changed +45
-22
lines changed Expand file tree Collapse file tree 6 files changed +45
-22
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ struct machdep_calls {
76
76
77
77
void __noreturn (* restart )(char * cmd );
78
78
void __noreturn (* halt )(void );
79
+ void (* panic )(char * str );
79
80
void (* cpu_die )(void );
80
81
81
82
long (* time_init )(void ); /* Optional, may be NULL */
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ extern void reloc_got2(unsigned long);
24
24
25
25
void check_for_initrd (void );
26
26
void initmem_init (void );
27
+ void setup_panic (void );
27
28
#define ARCH_PANIC_TIMEOUT 180
28
29
29
30
#ifdef CONFIG_PPC_PSERIES
Original file line number Diff line number Diff line change @@ -1462,25 +1462,6 @@ static void fadump_init_files(void)
1462
1462
return ;
1463
1463
}
1464
1464
1465
- static int fadump_panic_event (struct notifier_block * this ,
1466
- unsigned long event , void * ptr )
1467
- {
1468
- /*
1469
- * If firmware-assisted dump has been registered then trigger
1470
- * firmware-assisted dump and let firmware handle everything
1471
- * else. If this returns, then fadump was not registered, so
1472
- * go through the rest of the panic path.
1473
- */
1474
- crash_fadump (NULL , ptr );
1475
-
1476
- return NOTIFY_DONE ;
1477
- }
1478
-
1479
- static struct notifier_block fadump_panic_block = {
1480
- .notifier_call = fadump_panic_event ,
1481
- .priority = INT_MIN /* may not return; must be done last */
1482
- };
1483
-
1484
1465
/*
1485
1466
* Prepare for firmware-assisted dump.
1486
1467
*/
@@ -1513,9 +1494,6 @@ int __init setup_fadump(void)
1513
1494
init_fadump_mem_struct (& fdm , fw_dump .reserve_dump_area_start );
1514
1495
fadump_init_files ();
1515
1496
1516
- atomic_notifier_chain_register (& panic_notifier_list ,
1517
- & fadump_panic_block );
1518
-
1519
1497
return 1 ;
1520
1498
}
1521
1499
subsys_initcall (setup_fadump );
Original file line number Diff line number Diff line change @@ -704,6 +704,30 @@ int check_legacy_ioport(unsigned long base_port)
704
704
}
705
705
EXPORT_SYMBOL (check_legacy_ioport );
706
706
707
+ static int ppc_panic_event (struct notifier_block * this ,
708
+ unsigned long event , void * ptr )
709
+ {
710
+ /*
711
+ * If firmware-assisted dump has been registered then trigger
712
+ * firmware-assisted dump and let firmware handle everything else.
713
+ */
714
+ crash_fadump (NULL , ptr );
715
+ ppc_md .panic (ptr ); /* May not return */
716
+ return NOTIFY_DONE ;
717
+ }
718
+
719
+ static struct notifier_block ppc_panic_block = {
720
+ .notifier_call = ppc_panic_event ,
721
+ .priority = INT_MIN /* may not return; must be done last */
722
+ };
723
+
724
+ void __init setup_panic (void )
725
+ {
726
+ if (!ppc_md .panic )
727
+ return ;
728
+ atomic_notifier_chain_register (& panic_notifier_list , & ppc_panic_block );
729
+ }
730
+
707
731
#ifdef CONFIG_CHECK_CACHE_COHERENCY
708
732
/*
709
733
* For platforms that have configurable cache-coherency. This function
@@ -848,6 +872,9 @@ void __init setup_arch(char **cmdline_p)
848
872
/* Probe the machine type, establish ppc_md. */
849
873
probe_machine ();
850
874
875
+ /* Setup panic notifier if requested by the platform. */
876
+ setup_panic ();
877
+
851
878
/*
852
879
* Configure ppc_md.power_save (ppc32 only, 64-bit machines do
853
880
* it from their respective probe() function.
Original file line number Diff line number Diff line change @@ -104,6 +104,20 @@ static void __noreturn ps3_halt(void)
104
104
ps3_sys_manager_halt (); /* never returns */
105
105
}
106
106
107
+ static void ps3_panic (char * str )
108
+ {
109
+ DBG ("%s:%d %s\n" , __func__ , __LINE__ , str );
110
+
111
+ smp_send_stop ();
112
+ printk ("\n" );
113
+ printk (" System does not reboot automatically.\n" );
114
+ printk (" Please press POWER button.\n" );
115
+ printk ("\n" );
116
+
117
+ while (1 )
118
+ lv1_pause (1 );
119
+ }
120
+
107
121
#if defined(CONFIG_FB_PS3 ) || defined(CONFIG_FB_PS3_MODULE ) || \
108
122
defined(CONFIG_PS3_FLASH ) || defined(CONFIG_PS3_FLASH_MODULE )
109
123
static void __init prealloc (struct ps3_prealloc * p )
@@ -255,6 +269,7 @@ define_machine(ps3) {
255
269
.probe = ps3_probe ,
256
270
.setup_arch = ps3_setup_arch ,
257
271
.init_IRQ = ps3_init_IRQ ,
272
+ .panic = ps3_panic ,
258
273
.get_boot_time = ps3_get_boot_time ,
259
274
.set_dabr = ps3_set_dabr ,
260
275
.calibrate_decr = ps3_calibrate_decr ,
Original file line number Diff line number Diff line change @@ -726,6 +726,7 @@ define_machine(pseries) {
726
726
.pcibios_fixup = pSeries_final_fixup ,
727
727
.restart = rtas_restart ,
728
728
.halt = rtas_halt ,
729
+ .panic = rtas_os_term ,
729
730
.get_boot_time = rtas_get_boot_time ,
730
731
.get_rtc_time = rtas_get_rtc_time ,
731
732
.set_rtc_time = rtas_set_rtc_time ,
You can’t perform that action at this time.
0 commit comments