]> git.gag.com Git - fw/openocd/commitdiff
aarch64: don't wait for smp targets halted in deassert reset
authorAntonio Borneo <borneo.antonio@gmail.com>
Mon, 25 Apr 2022 20:25:08 +0000 (22:25 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 14 May 2022 08:57:36 +0000 (08:57 +0000)
The function target_type::deassert_reset() is called for every
target after reset is deasserted. If the target fails to get
halted, we log a warning and issue a halt request for the target
itself.

Current code calls the generic target_halt() that:
- extends the halt to all the targets in the SMP node;
- waits for targets to halt.
This breaks the logic of running target_type::deassert_reset()
per target. Plus, waiting for targets to halt delays the call of
target_type::deassert_reset() for the next targets.

Replace the call to target_halt() with the aarch64 specific
function to halt the single target. Pass the parameter HALT_LAZY
to prevent the wait for target halted.
Similar solution is already implemented for cortex_a.

Change-Id: I446dc03cb91524c6d388db485bc2388177af77b6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6947
Tested-by: jenkins
src/target/aarch64.c

index d8a9664d72bf9bd4fee86b2e70b098f237fd9a9a..ecd93248c11c6774c0ea06b703570320f44d4a1b 100644 (file)
@@ -2026,9 +2026,13 @@ static int aarch64_deassert_reset(struct target *target)
                if (target->state != TARGET_HALTED) {
                        LOG_WARNING("%s: ran after reset and before halt ...",
                                target_name(target));
-                       retval = target_halt(target);
-                       if (retval != ERROR_OK)
-                               return retval;
+                       if (target_was_examined(target)) {
+                               retval = aarch64_halt_one(target, HALT_LAZY);
+                               if (retval != ERROR_OK)
+                                       return retval;
+                       } else {
+                               target->state = TARGET_UNKNOWN;
+                       }
                }
        }