diff options
Diffstat (limited to 'import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_threads.c')
-rw-r--r-- | import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_threads.c | 62 |
1 files changed, 22 insertions, 40 deletions
diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_threads.c b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_threads.c index b13c35cb..fc2f72b9 100644 --- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_threads.c +++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_threads.c @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HCODE Project */ /* */ -/* COPYRIGHT 2015,2017 */ +/* COPYRIGHT 2015,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -38,7 +38,7 @@ p9_sgpe_stop_exit_thread(void* arg) // Thread goes to sleep pk_semaphore_pend(&(G_sgpe_stop_record.sem[1]), PK_WAIT_FOREVER); - G_sgpe_stop_record.wof.status_stop = STATUS_PROCESSING; + G_sgpe_stop_record.wof.status_stop |= STATUS_STOP_PROCESSING; wrteei(1); // The actual exit sequence @@ -46,34 +46,25 @@ p9_sgpe_stop_exit_thread(void* arg) if (!G_sgpe_stop_record.fit.entry_pending) { + G_sgpe_stop_record.wof.status_stop &= ~STATUS_STOP_PROCESSING; #if !SKIP_IPC - if (G_sgpe_stop_record.wof.status_stop == STATUS_SUSPENDING) + if (G_sgpe_stop_record.wof.status_stop & STATUS_SUSPEND_PENDING) { p9_sgpe_stop_suspend_all_cmes(); } - else if (G_sgpe_stop_record.wof.status_stop != STATUS_SUSPENDED) - { - G_sgpe_stop_record.wof.status_stop = STATUS_IDLE; -#endif - - if (G_sgpe_stop_record.wof.update_pgpe & - IPC_SGPE_PGPE_UPDATE_CTRL_ONGOING) - { - p9_sgpe_ack_pgpe_ctrl_stop_updates(); - } - - PK_TRACE_INF("Setup: Exit Done,no Entry Request.Enable Type2/3/5/6 Interrupt"); - g_oimr_override &= ~(BITS64(47, 2) | BITS64(50, 2)); - pk_irq_vec_restore(&ctx); -#if !SKIP_IPC +#endif + if (G_sgpe_stop_record.wof.update_pgpe & IPC_SGPE_PGPE_UPDATE_CTRL_ONGOING) + { + p9_sgpe_ack_pgpe_ctrl_stop_updates(); } -#endif - + PK_TRACE_INF("Setup: Exit Done,no Entry Request.Enable Type2/3/5/6 Interrupt"); + g_oimr_override &= ~(BITS64(47, 2) | BITS64(50, 2)); + pk_irq_vec_restore(&ctx); } } } @@ -90,40 +81,31 @@ p9_sgpe_stop_enter_thread(void* arg) // Thread goes to sleep pk_semaphore_pend(&(G_sgpe_stop_record.sem[0]), PK_WAIT_FOREVER); - G_sgpe_stop_record.wof.status_stop = STATUS_PROCESSING; + G_sgpe_stop_record.wof.status_stop |= STATUS_STOP_PROCESSING; wrteei(1); // The actual entry sequence p9_sgpe_stop_entry(); + G_sgpe_stop_record.fit.entry_pending = 0; + G_sgpe_stop_record.wof.status_stop &= ~STATUS_STOP_PROCESSING; + #if !SKIP_IPC - if (G_sgpe_stop_record.wof.status_stop == STATUS_SUSPENDING) + if (G_sgpe_stop_record.wof.status_stop & STATUS_SUSPEND_PENDING) { p9_sgpe_stop_suspend_all_cmes(); } - else if (G_sgpe_stop_record.wof.status_stop != STATUS_SUSPENDED) - { - G_sgpe_stop_record.wof.status_stop = STATUS_IDLE; #endif - if (G_sgpe_stop_record.wof.update_pgpe & - IPC_SGPE_PGPE_UPDATE_CTRL_ONGOING) - { - p9_sgpe_ack_pgpe_ctrl_stop_updates(); - } - - G_sgpe_stop_record.fit.entry_pending = 0; - PK_TRACE_INF("Setup: Entry done. Enable Type2/3/5/6 Interrupt"); - g_oimr_override &= ~(BITS64(47, 2) | BITS64(50, 2)); - pk_irq_vec_restore(&ctx); - -#if !SKIP_IPC - + if (G_sgpe_stop_record.wof.update_pgpe & IPC_SGPE_PGPE_UPDATE_CTRL_ONGOING) + { + p9_sgpe_ack_pgpe_ctrl_stop_updates(); } -#endif - + PK_TRACE_INF("Setup: Entry done. Enable Type2/3/5/6 Interrupt"); + g_oimr_override &= ~(BITS64(47, 2) | BITS64(50, 2)); + pk_irq_vec_restore(&ctx); } } |