From 710e6cf9082b5c33836922ed252e0dec653d563e Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Fri, 20 Nov 2020 23:21:05 -0600 Subject: [PATCH] rmtfs: Exit even though there's no rprocfd Attempting to shut down a system with rmtfs running without an associated remoteproc results in systemd waiting forever for the remoteproc code to never signal that it's done. Instead exit immediately when signalled, when there's no associated remoteproc. Signed-off-by: Bjorn Andersson --- rmtfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rmtfs.c b/rmtfs.c index 26c0488..25862d1 100644 --- a/rmtfs.c +++ b/rmtfs.c @@ -445,7 +445,10 @@ static int run_rmtfs(int rprocfd) rproc_start(); for (;;) { - if (rprocfd >= 0 && sig_int_count == 1 && !sig_int_handled) { + if (sig_int_count == 1 && !sig_int_handled) { + if (rprocfd < 0) + break; + rproc_stop(); sig_int_handled = true; } else if (sig_int_count > 1) {