Unstable system power resulted in hung PRUs in two separate ways that prevented powerfail from performing an orderly shutdown, as mfm_emu never terminated:
If /SEEK is endlessly asserted, shutdown fails because PRU0 will not leave an infinite loop until /SEEK goes high again.
After glitched external signals, due to disorderly shutdown in an ornery host, PRU1 signals PRU0 write_done and is in write_done_wait waiting to hear PRU0 is in STATE_READ. But PRU0 is in selected waiting to hear STATE_READ_DONE from PRU1. Deadlock.
In both cases a check for PRU0_EXIT is now made, and EXIT is immediately performed should it be found. Putting a check for EXIT into glitch did not avoid the second case, unfortunately, so the PRU0_EXIT check was inlined directly where the deadlock was observed.
This patch eliminates all observed failed shutdowns during extensive testing.
Unstable system power resulted in hung PRUs in two separate ways that prevented
powerfail
from performing an orderly shutdown, asmfm_emu
never terminated:If
/SEEK
is endlessly asserted, shutdown fails because PRU0 will not leave an infinite loop until/SEEK
goes high again.After glitched external signals, due to disorderly shutdown in an ornery host, PRU1 signals PRU0
write_done
and is inwrite_done_wait
waiting to hear PRU0 is inSTATE_READ
. But PRU0 is inselected
waiting to hearSTATE_READ_DONE
from PRU1. Deadlock.In both cases a check for
PRU0_EXIT
is now made, and EXIT is immediately performed should it be found. Putting a check for EXIT intoglitch
did not avoid the second case, unfortunately, so thePRU0_EXIT
check was inlined directly where the deadlock was observed.This patch eliminates all observed failed shutdowns during extensive testing.