This is an automated email from Gerrit.

"Tomas Vanek <[email protected]>" just uploaded a new patch set to Gerrit, which 
you can find at https://review.openocd.org/c/openocd/+/9277

-- gerrit

commit 19d8c50b755f86be90d2ba1001063733168f34ea
Author: Tomas Vanek <[email protected]>
Date:   Sat Feb 3 10:22:11 2024 +0100

    target/riscv: respect DM_DMSTATUS_ALLUNAVAIL bit during examine
    
    Do not throw nonsense errors if a hart has DM_DMSTATUS_ALLUNAVAIL
    set. Postpone examination till DM_DMSTATUS_ALLUNAVAIL is cleared.
    
    Signed-off-by: Tomas Vanek <[email protected]>
    Change-Id: I94ccf5cc80e104abb606c7c3798ff70bd8f8e707

diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c
index 6fa5e025be..8963a8e896 100644
--- a/src/target/riscv/riscv-013.c
+++ b/src/target/riscv/riscv-013.c
@@ -2121,6 +2121,12 @@ static int examine(struct target *target)
        if (riscv_get_hart_state(target, &state_at_examine_start) != ERROR_OK)
                return ERROR_FAIL;
 
+       if (state_at_examine_start == RISCV_STATE_UNAVAILABLE) {
+               target->state = TARGET_UNAVAILABLE;
+               LOG_TARGET_INFO(target, "unavailable.");
+               return ERROR_FAIL;
+       }
+
        RISCV_INFO(r);
        const bool hart_halted_at_examine_start = state_at_examine_start == 
RISCV_STATE_HALTED;
        if (!hart_halted_at_examine_start) {

-- 

Reply via email to