This is an automated email from Gerrit.

"Name of user not set <[email protected]>" just uploaded a new 
patch set to Gerrit, which you can find at 
https://review.openocd.org/c/openocd/+/9774

-- gerrit

commit 1bed4328574b4c14fff3185eee148538600e243a
Author: Konrad Dybcio <[email protected]>
Date:   Fri Jul 3 13:49:11 2026 +0200

    target/aarch64: accept cleared HALT as resume completion
    
    Some targets resume successfully after the CTI restart pulse but do not
    reliably latch PRSR.SDR.  In that case OpenOCD keeps waiting for SDR
    and eventually reports a resume timeout even though the core is already
    running.
    
    Treat PRSR.HALT clearing as sufficient evidence that the target
    resumed. This matches the existing SMP resume checks, which already
    accept either SDR or a non-halted PRSR state.
    
    Change-Id: I613ecc0c177e4785cc55b0a40f07d82028293120
    Signed-off-by: Konrad Dybcio <[email protected]>

diff --git a/src/target/aarch64.c b/src/target/aarch64.c
index f8962cbfd5..50a385363f 100644
--- a/src/target/aarch64.c
+++ b/src/target/aarch64.c
@@ -755,14 +755,17 @@ static int aarch64_do_restart_one(struct target *target, 
enum restart_mode mode)
        if (mode == RESTART_SYNC) {
                int64_t then = timeval_ms();
                for (;;) {
+                       uint32_t prsr;
                        int resumed;
                        /*
-                        * if PRSR.SDR is set now, the target did restart, even
-                        * if it's now already halted again (e.g. due to 
breakpoint)
+                        * If PRSR.SDR is set now, the target did restart, even
+                        * if it's now already halted again (e.g. due to 
breakpoint).
+                        * Some systems do not reliably latch SDR for this CTI 
resume,
+                        * so also accept PRSR.HALT clearing as proof of resume.
                         */
                        retval = aarch64_check_state_one(target,
-                                               PRSR_SDR, PRSR_SDR, &resumed, 
NULL);
-                       if (retval != ERROR_OK || resumed)
+                                               PRSR_SDR, PRSR_SDR, &resumed, 
&prsr);
+                       if (retval != ERROR_OK || resumed || !(prsr & 
PRSR_HALT))
                                break;
 
                        if (timeval_ms() > then + 1000) {

-- 

Reply via email to