target/riscv: Fix some timeout check order#1265
Open
lz-bro wants to merge 3 commits intoriscv-collab:riscvfrom
Open
target/riscv: Fix some timeout check order#1265lz-bro wants to merge 3 commits intoriscv-collab:riscvfrom
lz-bro wants to merge 3 commits intoriscv-collab:riscvfrom
Conversation
Ubuntu 20.04 is no longer available. See actions/runner-images#11101 Checkpatch-ignore: BAD_SIGN_OFF Change-Id: I0ec3e3342f9212a2a79d8dca6274e7db62ecedab Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
when Debug Module is inactive, accesses to the nextdm may fail. Specifically, nextdm might not return correct data.
MarekVCodasip
previously approved these changes
Jun 13, 2025
Collaborator
MarekVCodasip
left a comment
There was a problem hiding this comment.
Thanks for adding the change elsewhere as well.
JanMatCodasip
requested changes
Jun 16, 2025
src/target/riscv/riscv-013.c
Outdated
Comment on lines
+1894
to
+1896
| if (!get_field32(dmcontrol, DM_DMCONTROL_DMACTIVE)) | ||
| break; |
Collaborator
There was a problem hiding this comment.
Detail:
During the refactor, the debug message DM reset initiated got removed. I am not sure if this was intended or simply an oversight.
I would prefer to keep the message there. The message can also be slightly reworded for clarity.
if (!get_field32(dmcontrol, DM_DMCONTROL_DMACTIVE)) {
LOG_TARGET_DEBUG(target, "The DM has just become deactivated (dmcontrol.dmactive: 1 -> 0).");
break;
}Reorder the timeout check and conditional judgment to ensure that timeout check is not wasted.
c9a7363 to
ded5f59
Compare
en-sc
reviewed
Jun 19, 2025
Collaborator
en-sc
left a comment
There was a problem hiding this comment.
@lz-bro, to be honest, I don't understand the need for this patch.
dmi_write()is time-bound by the sameriscv_get_command_timeout_sec()(see), therefore this is mostly a hypothetical issue.riscv-openocd/src/target/riscv/riscv-013.c
Line 2531 in 8d5f2fe
- IMHO, this is more straightforward when an operation that took longer then the timeout fails, indicating that you need to increase the timeout.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reorder the timeout check and conditional judgment to ensure that timeout check is not wasted.