)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"ba2bfdea6b386f9360036f0869f1beef3f2cb08a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"2e8281bc_3351826f","updated":"2025-12-01 07:47:15.000000000","message":"Adding to CC Anatoly -- he is the original author.","commit_id":"e0475cc97848e9c4abbe87a32dcdb6d88bfd3b23"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"b200063ecef9524ecafdaa5f43baa5b0f3973c51","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"1263b866_7ac37269","updated":"2025-12-01 07:43:12.000000000","message":"Thank you for the patch!\n\nI\u0027ll need to look at it a bit more. The idea behind setting the version to unknown was to make sure `examine()` is re-enterable, making the state of the target after a failed `examine()` as close to the state before entry to examine as possible.\n\nHowever, the issue you are describing clearly needs fixing. Perhaps we can consider `examine()` as two-step process:\n1. Read `dtmcs.version`, init `target_type` (`tt-\u003einit_target`).\n2. Perform `dtmcs.version`-specific initialization.\n\nThis way when (2) fails we can fall-back to the state after (1).\n\nI had a patch addressing this by eliminating this additional `target_type`, instead modifying the original target type dynamically. This way after (1) completes, the function `target_type::examine` points to changes and it goes to the `examine()` from `riscv-013.c` directly.\n\nI will revive it and post ASAP.","commit_id":"e0475cc97848e9c4abbe87a32dcdb6d88bfd3b23"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"8035c58747e941f662c6a4bf85231168a23393b0","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"e8990816_66fb991d","in_reply_to":"1263b866_7ac37269","updated":"2025-12-01 08:44:25.000000000","message":"The patch has been working for some time in RP2350 fork.\nAFAIK riscv-013 `init_target` has no problems when re-entered.\nUnfortunately it\u0027s not true for riscv-011. At least `version_specific` struct is allocated every run and I suspect also multiple runs of `riscv011_reg_init_all()` would make memory leaks.\n\nLooks we could either\n- avoid re-running `tt-\u003einit_target` when `dtmcs.version` is already initialized\nor\n- make riscv-011 `init_target` re-entry proof","commit_id":"e0475cc97848e9c4abbe87a32dcdb6d88bfd3b23"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"c124821511f2b530950fd5b64a69b41030e12436","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"03841ea5_85f9a056","in_reply_to":"e8990816_66fb991d","updated":"2025-12-01 08:58:16.000000000","message":"The first point should read\n- avoid re-running `tt-\u003einit_target` when `info-\u003edtm_version` is already initialized\n\nThere is also a potential very rare problem if the first examine reads wrong value of `dtmcontrol` (e.g. random error on JTAG lines) and wrong `tt-\u003einit_target` is run, then following re-examines cannot change `info-\u003edtm_version`. But IMO we can neglect such scenario.","commit_id":"e0475cc97848e9c4abbe87a32dcdb6d88bfd3b23"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"43751953e91e2da2ec5d2690b3b7b7f831ed5650","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"0bb50203_82bd4554","updated":"2026-04-14 08:42:56.000000000","message":"Evgeniy, Anatoly, could you please look at this and the following patchset?","commit_id":"f1bbe279d983293e3b4aa14f174a975736e34194"}],"src/target/riscv/riscv.c":[{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"b200063ecef9524ecafdaa5f43baa5b0f3973c51","unresolved":true,"context_lines":[{"line_number":2499,"context_line":"\t\tgoto examine_fail;"},{"line_number":2500,"context_line":""},{"line_number":2501,"context_line":"\texamine_status \u003d tt-\u003eexamine(target);"},{"line_number":2502,"context_line":"\tif (examine_status !\u003d ERROR_OK)"},{"line_number":2503,"context_line":"\t\treturn examine_status;"},{"line_number":2504,"context_line":""},{"line_number":2505,"context_line":"\treturn ERROR_OK;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"044cc3b1_bec3209d","line":2502,"updated":"2025-12-01 07:43:12.000000000","message":"This `if` is redundant now. Please consider just\n```\nreturn tt-\u003eexamine(target);\n```\ninstead.","commit_id":"e0475cc97848e9c4abbe87a32dcdb6d88bfd3b23"}]}
