runtime: Stop kernel CPU before restarting comms CPU on panic

Before, the system would enter a boot loop when a panic occurred
while the kernel CPU was active (and panic_reset == 1), as
kernel::start() for the startup kernel would panic.
This commit is contained in:
David Nadlinger 2020-06-30 21:44:36 +01:00 committed by Sébastien Bourdeauducq
parent 95807234d9
commit 3f0cf6e683
2 changed files with 6 additions and 1 deletions

View File

@ -21,6 +21,8 @@ Highlights:
be brought up Ctrl-P (Ctrl+Return to immediately submit the selected entry be brought up Ctrl-P (Ctrl+Return to immediately submit the selected entry
with the default arguments). with the default arguments).
* Experiment results are now always saved to HDF5, even if run() fails. * Experiment results are now always saved to HDF5, even if run() fails.
* Core device: ``panic_reset 1`` now correctly resets the kernel CPU as well if
communication CPU panic occurs.
Breaking changes: Breaking changes:

View File

@ -323,7 +323,10 @@ pub fn panic_impl(info: &core::panic::PanicInfo) -> ! {
if config::read_str("panic_reset", |r| r == Ok("1")) { if config::read_str("panic_reset", |r| r == Ok("1")) {
println!("restarting..."); println!("restarting...");
unsafe { boot::reset() } unsafe {
kernel::stop();
boot::reset();
}
} else { } else {
println!("halting."); println!("halting.");
println!("use `artiq_coremgmt config write -s panic_reset 1` to restart instead"); println!("use `artiq_coremgmt config write -s panic_reset 1` to restart instead");