)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"01dde8a449c584f10ce8f759d129055417722463","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"0f0b192f_9957e1bb","updated":"2022-05-03 22:23:18.000000000","message":"Tim, I\u0027m not sure if the \u0027hart\u0027 concept of Risc-V does not require a bit different handling.\n\nLet me describe how we handle other (e.g. ARM) multicore:\n- one (system boot) core is active after reset, OpenOCD examine it immediately\n- other cores are switched off after reset. They are configured with the flag -defer-examine, so OpenOCD doesn\u0027t try to examine them.\n- as soon as one of other (non system boot) core is active, user (or some script) issues command \u0027arp_examine\u0027 and OpenOCD examines that core.\n\nIs your method for Risc-V similar? Please correct me if I\u0027m wrong: your changes in target.c looks like the Risc-V target wants to poll not active cores to sense when they are woken up.","commit_id":"3f7599d09ee5a4e6d4431926371ff2d69b5c9829"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"cc21a05f5ffb94217d3fa19a660523475813e741","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"53ca7fce_90e473e7","in_reply_to":"0f0b192f_9957e1bb","updated":"2022-05-04 20:38:58.000000000","message":"I suspect that you are right, and the problem could also be solved by using -defer-examine. When the problem was reported to me I didn\u0027t realize that feature existed.\n\nI still think this code change makes dealing with such systems simpler, but it shouldn\u0027t be necessary.","commit_id":"3f7599d09ee5a4e6d4431926371ff2d69b5c9829"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"3de8700dbe4f3f8dee2d4db68340849909cf899b","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"c6e3e130_043f5b37","in_reply_to":"53ca7fce_90e473e7","updated":"2022-05-05 04:29:54.000000000","message":"I\u0027m ready to accept all changes but the one I commented.\nI\u0027d prefer splitting them to \u0027fix poll timing\u0027 and the rest (riscv stuff).\n\nBTW You agreed with\n6667: helper/log: Add macros for target-related errors/warnings/... | https://review.openocd.org/c/openocd/+/6667\nso please use LOG_TARGET_xxx() instead of target_name() in your new code\n(or port 6667 to riscv fork ;-)","commit_id":"3f7599d09ee5a4e6d4431926371ff2d69b5c9829"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f959f910267e7e0e2dd3f1f0327b8ea624f6aa54","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"f2edea3e_a40e7f60","in_reply_to":"aa1cadee_6b1738db","updated":"2025-10-22 08:15:04.000000000","message":"Done","commit_id":"3f7599d09ee5a4e6d4431926371ff2d69b5c9829"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"d99db65f7b76b35594584a9c41c4f6a6f4c1aae9","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"aa1cadee_6b1738db","in_reply_to":"c6e3e130_043f5b37","updated":"2025-10-21 17:38:37.000000000","message":"Tomas, I\u0027ve tried to preserve the logic around `target-\u003eexamined`. Please take a look at the new version.","commit_id":"3f7599d09ee5a4e6d4431926371ff2d69b5c9829"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"14965a79d37fdcae857f7db1288a1c8e9bdbb683","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"37586ba7_44a72c64","updated":"2022-09-14 09:39:08.000000000","message":"As commented in\n6363: Call poll at a fixed interval. | https://review.openocd.org/c/openocd/+/6363\nthe back-off timing should use timeval_ms() instead of counting handle_target() invocations.","commit_id":"adf05b0ff40ae320788a05995f891c32c41a5a38"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"a188e0d4873482222eae33d1fba44385cb49346d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"e9c10d63_316d3fc9","updated":"2022-05-12 17:36:16.000000000","message":"Gerrit shows it\u0027s my turn to do something here. What is the thing that I need to do?","commit_id":"adf05b0ff40ae320788a05995f891c32c41a5a38"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"3b0c135d4090dbbcb8272c37b34329561a99ad8a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"d02254a1_e4e4e0a0","in_reply_to":"0a10c6c7_ee7dcb2d","updated":"2022-09-27 20:09:49.000000000","message":"OK, I\u0027ve updated this PR.","commit_id":"adf05b0ff40ae320788a05995f891c32c41a5a38"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"8aff92be86d67778b1f833e29a76faafa43a9965","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"cdf73cd3_aa71317f","in_reply_to":"37586ba7_44a72c64","updated":"2022-09-16 22:23:01.000000000","message":"Thanks. I made https://github.com/riscv/riscv-openocd/pull/727 to address this. Can you take a quick look over there to see if that\u0027s what you were thinking? If it is, I\u0027ll merge it there and then update the PR here. Just trying to keep my workflow more or less consistent for my personal sanity.","commit_id":"adf05b0ff40ae320788a05995f891c32c41a5a38"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"04ffdc579d45ae2621db66f053553373ecdfb3be","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"0a10c6c7_ee7dcb2d","in_reply_to":"cdf73cd3_aa71317f","updated":"2022-09-21 19:48:02.000000000","message":"Yes, it looks promising.\n\nJust a comment to \u0027const\u0027 @\nhttps://github.com/riscv/riscv-openocd/pull/727/files/b7738370b75543870c4cbb15061b8e7b38887e9e#diff-4fad8fd962323385752b18f6b15d3a5a568e08420e849c0258767c821d0dfa39R3053\n\nplease see relevant\nhttps://review.openocd.org/c/openocd/+/6319/comment/6c45e326_a5f9192e/","commit_id":"adf05b0ff40ae320788a05995f891c32c41a5a38"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"855e1abce8d5de0bd2ebcd61d549e3f907357743","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"7e0552e4_b75ab140","updated":"2022-09-30 09:08:51.000000000","message":"Looks good, just the first line of commit message should follow rules from\nhttps://openocd.org/doc/doxygen/html/patchguide.html\n(no problem this time, please remember next time).\n\nIMO the change should wait after 0.12 release. Or should we risk a regression and include it to rc2?","commit_id":"c0a62beaad75efa673a646d55583ddecbdee4493"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"15af53044941bdb28760aff8a929e085313c130d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"d729b600_a2cac27c","updated":"2025-10-21 13:22:59.000000000","message":"Antonio, Tomas, this is part of the difference wrt RISC-V Sync. Assigning the topic.","commit_id":"6d0bc1497320150512f3416403ad90e1fe4b83e4"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f959f910267e7e0e2dd3f1f0327b8ea624f6aa54","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"8ba519e7_12b7f98d","in_reply_to":"127b1880_87ab52e0","updated":"2025-10-22 08:15:04.000000000","message":"Neither I\u0027m allowed to set the topic.\nNo problem in treating this patch separately, the riscv-sync series is long more than enough.","commit_id":"6d0bc1497320150512f3416403ad90e1fe4b83e4"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"5f9443a7965d86fac990b69b5ea99313bb0fa9eb","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":5,"id":"127b1880_87ab52e0","in_reply_to":"d729b600_a2cac27c","updated":"2025-10-21 13:25:13.000000000","message":"Oh, this was silly) I\u0027m not the owner so I can not assign the topic.\nIn any case, I believe this patch should be dealt with.","commit_id":"6d0bc1497320150512f3416403ad90e1fe4b83e4"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"d99db65f7b76b35594584a9c41c4f6a6f4c1aae9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"89c34b61_fd9c65cb","updated":"2025-10-21 17:38:37.000000000","message":"Antonio, Tomas, I believe this change should be merged before the RISC-V sync is done.\nI\u0027ve tried to address the concerns raised. Please, take a look.","commit_id":"9f3264f6315fb5fae0d762e667e864c69674aea9"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"ea22f8ed0c410f563850640e9d8052c8ace0b64f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"815f1245_d74f845b","in_reply_to":"89c34b61_fd9c65cb","updated":"2025-10-21 19:55:21.000000000","message":"Thanks, I\u0027ll try tomorrow.","commit_id":"9f3264f6315fb5fae0d762e667e864c69674aea9"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"80dd5c62687c7ccfab84eda03325133d99e8dcca","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"28a4b09b_67942f09","updated":"2025-10-23 08:33:16.000000000","message":"Evgeniy, I submitted a mini series which fixes two ugly hacks around the examined flag. Please rebase this patch on top of it:\n9181: target: drop useless call target_set_examined() | https://review.openocd.org/c/openocd/+/9181","commit_id":"9ff8f1cae5d304ebdb76fd553ae5156dec713bde"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"5757fd42315613068e44511370767ebcfec15322","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"ef524b53_d0101bcf","in_reply_to":"28a4b09b_67942f09","updated":"2026-02-27 13:31:46.000000000","message":"Addressed.","commit_id":"9ff8f1cae5d304ebdb76fd553ae5156dec713bde"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"0c38ed404cca7569fb964fde68784ab4da28a98b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":12,"id":"4509eb0e_37dee8b1","updated":"2026-04-13 16:52:33.000000000","message":"The Jenkins error\n`Build timed out (after 45 minutes). Marking the build as aborted.`\nis strange. I\u0027ll try rebasing to trigger Jenkins build again","commit_id":"477dcb3bef64b147d78d61d9600732a762b743f2"}],"src/target/target.c":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"3de8700dbe4f3f8dee2d4db68340849909cf899b","unresolved":true,"context_lines":[{"line_number":3037,"context_line":"\t\t\tis_jtag_poll_safe() \u0026\u0026 target;"},{"line_number":3038,"context_line":"\t\t\ttarget \u003d target-\u003enext) {"},{"line_number":3039,"context_line":""},{"line_number":3040,"context_line":"\t\tif (!target_was_examined(target))"},{"line_number":3041,"context_line":"\t\t\tcontinue;"},{"line_number":3042,"context_line":""},{"line_number":3043,"context_line":"\t\tif (!target-\u003etap-\u003eenabled)"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"8c7b331a_e19b5ef6","side":"PARENT","line":3040,"range":{"start_line":3040,"start_character":7,"end_line":3040,"end_character":26},"updated":"2022-05-05 04:29:54.000000000","message":"We cannot remove this test without checking all target specific code (and reworking lot of them). I\u0027m almost sure that typical multicore targets (cortex_a, aarch64) would fail badly if we poll them before examination.\n\nMy idea for the future OpenOCD development (after 0.12) is replacing this test and similar ones in target_read/write_memory() with something like target_query(target, TARGET_READY_TO_POLL) or TARGET_READY_TO_MEM_RW. The default implementation would return target examined state and any target can redefine it to control precisely what is possible.","commit_id":"66335683fec62ac89da48d64932fd9d082314225"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"be5b9a187c407b74a87560a6b4d2c57f01467b12","unresolved":true,"context_lines":[{"line_number":3037,"context_line":"\t\t\tis_jtag_poll_safe() \u0026\u0026 target;"},{"line_number":3038,"context_line":"\t\t\ttarget \u003d target-\u003enext) {"},{"line_number":3039,"context_line":""},{"line_number":3040,"context_line":"\t\tif (!target_was_examined(target))"},{"line_number":3041,"context_line":"\t\t\tcontinue;"},{"line_number":3042,"context_line":""},{"line_number":3043,"context_line":"\t\tif (!target-\u003etap-\u003eenabled)"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"6ca72a91_28fcd7e2","side":"PARENT","line":3040,"range":{"start_line":3040,"start_character":7,"end_line":3040,"end_character":26},"in_reply_to":"36ba27b0_243bc8b2","updated":"2022-05-05 18:49:07.000000000","message":"\u003e My idea for the future OpenOCD development (after 0.12) is replacing this test and similar ones in target_read/write_memory() with something like target_query(target, TARGET_READY_TO_POLL) or TARGET_READY_TO_MEM_RW. The default implementation would return target examined state and any target can redefine it to control precisely what is possible.\n\nCan I just implement that for this one instance, without waiting for 0.12? It seems like a small change, and it can be expanded later.","commit_id":"66335683fec62ac89da48d64932fd9d082314225"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f533a2f8452935f2f70c027f591dea4e0dd4ab2f","unresolved":true,"context_lines":[{"line_number":3037,"context_line":"\t\t\tis_jtag_poll_safe() \u0026\u0026 target;"},{"line_number":3038,"context_line":"\t\t\ttarget \u003d target-\u003enext) {"},{"line_number":3039,"context_line":""},{"line_number":3040,"context_line":"\t\tif (!target_was_examined(target))"},{"line_number":3041,"context_line":"\t\t\tcontinue;"},{"line_number":3042,"context_line":""},{"line_number":3043,"context_line":"\t\tif (!target-\u003etap-\u003eenabled)"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"822aafa7_7265ee38","side":"PARENT","line":3040,"range":{"start_line":3040,"start_character":7,"end_line":3040,"end_character":26},"in_reply_to":"6ca72a91_28fcd7e2","updated":"2022-05-05 21:03:57.000000000","message":"Any work welcomed and we can prepare patches now and merge them after 0.12.\nI think we should rather design a complete conception of the target state logic.\nSome requirements:\n- replace (? maybe not all occurrences) target_was_examined(target) with something more detailed\n- fix crazy examination logic: some targets e.g. Cortex-M have an examination procedure which needs to set examined state first to enable memory access\n- tolerate short outages of communication (random errors from poll and polling wait loops) without forcing re-examination and discarding the current state (setting TARGET_UNKNOWN)\n- maintain reasonable compatibility with the old code: OpenOCD contains targets nobody of core team can test\n- little bit out of topic of target state: make possible to query target capabilities like r/w mem while running before the target is run (flash algos needs this info to decide if async work is possible)\n\nAnd then start the boring rework of all target specific code.","commit_id":"66335683fec62ac89da48d64932fd9d082314225"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"0ee35a6f8d22c6c3048f3d5f07e1b74b5435d9e5","unresolved":true,"context_lines":[{"line_number":3037,"context_line":"\t\t\tis_jtag_poll_safe() \u0026\u0026 target;"},{"line_number":3038,"context_line":"\t\t\ttarget \u003d target-\u003enext) {"},{"line_number":3039,"context_line":""},{"line_number":3040,"context_line":"\t\tif (!target_was_examined(target))"},{"line_number":3041,"context_line":"\t\t\tcontinue;"},{"line_number":3042,"context_line":""},{"line_number":3043,"context_line":"\t\tif (!target-\u003etap-\u003eenabled)"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"a849c78a_8d6da573","side":"PARENT","line":3040,"range":{"start_line":3040,"start_character":7,"end_line":3040,"end_character":26},"in_reply_to":"822aafa7_7265ee38","updated":"2022-05-06 16:32:03.000000000","message":"The behavior I\u0027d like to see in OpenOCD, is to repeatedly call examine() until it works, without requiring the user to issue `arp_examine` at the right time. Is that behavior you\u0027d like to see in OpenOCD as well?\n\nI would hope to achieve this by implementing target_query(target, TARGET_READY_TO_POLL) as you described above, just for this one instance. So that\u0027s adding a target function, an implementation for RISC-V, and only call it from one spot. Would that kind of change be accepted (without waiting for 0.12)?\n\nI unfortunately don\u0027t have time to take on a grand refactor.","commit_id":"66335683fec62ac89da48d64932fd9d082314225"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"5757fd42315613068e44511370767ebcfec15322","unresolved":true,"context_lines":[{"line_number":3037,"context_line":"\t\t\tis_jtag_poll_safe() \u0026\u0026 target;"},{"line_number":3038,"context_line":"\t\t\ttarget \u003d target-\u003enext) {"},{"line_number":3039,"context_line":""},{"line_number":3040,"context_line":"\t\tif (!target_was_examined(target))"},{"line_number":3041,"context_line":"\t\t\tcontinue;"},{"line_number":3042,"context_line":""},{"line_number":3043,"context_line":"\t\tif (!target-\u003etap-\u003eenabled)"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"3cfc5ae9_a944a34a","side":"PARENT","line":3040,"range":{"start_line":3040,"start_character":7,"end_line":3040,"end_character":26},"in_reply_to":"89aaaee3_fd398a8b","updated":"2026-02-27 13:31:46.000000000","message":"Tomas, seems like this is also resolved by your patch series.","commit_id":"66335683fec62ac89da48d64932fd9d082314225"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"cd000649159358f3226423328843f046308e533c","unresolved":true,"context_lines":[{"line_number":3037,"context_line":"\t\t\tis_jtag_poll_safe() \u0026\u0026 target;"},{"line_number":3038,"context_line":"\t\t\ttarget \u003d target-\u003enext) {"},{"line_number":3039,"context_line":""},{"line_number":3040,"context_line":"\t\tif (!target_was_examined(target))"},{"line_number":3041,"context_line":"\t\t\tcontinue;"},{"line_number":3042,"context_line":""},{"line_number":3043,"context_line":"\t\tif (!target-\u003etap-\u003eenabled)"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"36ba27b0_243bc8b2","side":"PARENT","line":3040,"range":{"start_line":3040,"start_character":7,"end_line":3040,"end_character":26},"in_reply_to":"8c7b331a_e19b5ef6","updated":"2022-05-05 17:23:44.000000000","message":"OK, but that negates (for me) the main benefit of this change. With removing the target_was_examined() check, unexamined targets won\u0027t be examined periodically.\n\nI\u0027ll rework this change to only include the 5s fix.","commit_id":"66335683fec62ac89da48d64932fd9d082314225"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"d99db65f7b76b35594584a9c41c4f6a6f4c1aae9","unresolved":true,"context_lines":[{"line_number":3037,"context_line":"\t\t\tis_jtag_poll_safe() \u0026\u0026 target;"},{"line_number":3038,"context_line":"\t\t\ttarget \u003d target-\u003enext) {"},{"line_number":3039,"context_line":""},{"line_number":3040,"context_line":"\t\tif (!target_was_examined(target))"},{"line_number":3041,"context_line":"\t\t\tcontinue;"},{"line_number":3042,"context_line":""},{"line_number":3043,"context_line":"\t\tif (!target-\u003etap-\u003eenabled)"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"89aaaee3_fd398a8b","side":"PARENT","line":3040,"range":{"start_line":3040,"start_character":7,"end_line":3040,"end_character":26},"in_reply_to":"a849c78a_8d6da573","updated":"2025-10-21 17:38:37.000000000","message":"I\u0027ve added a `FIXME` regarding the proposed refactor. Please, take a look.","commit_id":"66335683fec62ac89da48d64932fd9d082314225"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"5179a95362d7b6c7d655ea79966e6d6a919f6d26","unresolved":true,"context_lines":[{"line_number":3050,"context_line":""},{"line_number":3051,"context_line":"\t\t/* only poll target if we\u0027ve got power and srst isn\u0027t asserted */"},{"line_number":3052,"context_line":"\t\tif (!power_dropout \u0026\u0026 !srst_asserted) {"},{"line_number":3053,"context_line":"\t\t\t/* polling may fail silently until the target has been examined */"},{"line_number":3054,"context_line":"\t\t\tretval \u003d target_poll(target);"},{"line_number":3055,"context_line":"\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":3056,"context_line":"\t\t\t\t/* 100ms polling interval. Increase interval between polling up to 5000ms */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"9493c8a8_8c865b2e","line":3053,"updated":"2022-05-05 17:25:47.000000000","message":"How does this comment fit with the target_was_examined() check that exists in the original code above?","commit_id":"3f7599d09ee5a4e6d4431926371ff2d69b5c9829"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"d99db65f7b76b35594584a9c41c4f6a6f4c1aae9","unresolved":true,"context_lines":[{"line_number":3050,"context_line":""},{"line_number":3051,"context_line":"\t\t/* only poll target if we\u0027ve got power and srst isn\u0027t asserted */"},{"line_number":3052,"context_line":"\t\tif (!power_dropout \u0026\u0026 !srst_asserted) {"},{"line_number":3053,"context_line":"\t\t\t/* polling may fail silently until the target has been examined */"},{"line_number":3054,"context_line":"\t\t\tretval \u003d target_poll(target);"},{"line_number":3055,"context_line":"\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":3056,"context_line":"\t\t\t\t/* 100ms polling interval. Increase interval between polling up to 5000ms */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"8d8d8d4e_6d6f95b6","line":3053,"in_reply_to":"41d4a278_f7ac1c30","updated":"2025-10-21 17:38:37.000000000","message":"The comment is replaced with a more appropriate one.","commit_id":"3f7599d09ee5a4e6d4431926371ff2d69b5c9829"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"0ee35a6f8d22c6c3048f3d5f07e1b74b5435d9e5","unresolved":true,"context_lines":[{"line_number":3050,"context_line":""},{"line_number":3051,"context_line":"\t\t/* only poll target if we\u0027ve got power and srst isn\u0027t asserted */"},{"line_number":3052,"context_line":"\t\tif (!power_dropout \u0026\u0026 !srst_asserted) {"},{"line_number":3053,"context_line":"\t\t\t/* polling may fail silently until the target has been examined */"},{"line_number":3054,"context_line":"\t\t\tretval \u003d target_poll(target);"},{"line_number":3055,"context_line":"\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":3056,"context_line":"\t\t\t\t/* 100ms polling interval. Increase interval between polling up to 5000ms */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"41d4a278_f7ac1c30","line":3053,"in_reply_to":"4c64f7c1_0286aaa7","updated":"2022-05-06 16:32:03.000000000","message":"Thanks for digging that up.","commit_id":"3f7599d09ee5a4e6d4431926371ff2d69b5c9829"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f533a2f8452935f2f70c027f591dea4e0dd4ab2f","unresolved":true,"context_lines":[{"line_number":3050,"context_line":""},{"line_number":3051,"context_line":"\t\t/* only poll target if we\u0027ve got power and srst isn\u0027t asserted */"},{"line_number":3052,"context_line":"\t\tif (!power_dropout \u0026\u0026 !srst_asserted) {"},{"line_number":3053,"context_line":"\t\t\t/* polling may fail silently until the target has been examined */"},{"line_number":3054,"context_line":"\t\t\tretval \u003d target_poll(target);"},{"line_number":3055,"context_line":"\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":3056,"context_line":"\t\t\t\t/* 100ms polling interval. Increase interval between polling up to 5000ms */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"4c64f7c1_0286aaa7","line":3053,"in_reply_to":"9493c8a8_8c865b2e","updated":"2022-05-05 21:03:57.000000000","message":"This comment is unchanged since 2008. It was probably true that time.\nThe test\n if (!target_was_examined(target)) continue\n\non line 3040 is 6 years younger. What a mess!","commit_id":"3f7599d09ee5a4e6d4431926371ff2d69b5c9829"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f533a2f8452935f2f70c027f591dea4e0dd4ab2f","unresolved":true,"context_lines":[{"line_number":3073,"context_line":"\t\t\t\t/* Target examination could have failed due to unstable connection,"},{"line_number":3074,"context_line":"\t\t\t\t * but we set the examined flag anyway to repoll it later */"},{"line_number":3075,"context_line":"\t\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":3076,"context_line":"\t\t\t\t\ttarget_set_examined(target);"},{"line_number":3077,"context_line":"\t\t\t\t\tLOG_USER(\"Examination failed, GDB will be halted. Polling again in %dms\","},{"line_number":3078,"context_line":"\t\t\t\t\t\t target-\u003ebackoff.times * polling_interval);"},{"line_number":3079,"context_line":"\t\t\t\t\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"9fc528e4_f56de3f9","side":"PARENT","line":3076,"range":{"start_line":3076,"start_character":5,"end_line":3076,"end_character":33},"updated":"2022-05-05 21:03:57.000000000","message":"Ooops! This awful hack is important to preserve too or we break this crazy logic :-(","commit_id":"66335683fec62ac89da48d64932fd9d082314225"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"d99db65f7b76b35594584a9c41c4f6a6f4c1aae9","unresolved":true,"context_lines":[{"line_number":3073,"context_line":"\t\t\t\t/* Target examination could have failed due to unstable connection,"},{"line_number":3074,"context_line":"\t\t\t\t * but we set the examined flag anyway to repoll it later */"},{"line_number":3075,"context_line":"\t\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":3076,"context_line":"\t\t\t\t\ttarget_set_examined(target);"},{"line_number":3077,"context_line":"\t\t\t\t\tLOG_USER(\"Examination failed, GDB will be halted. Polling again in %dms\","},{"line_number":3078,"context_line":"\t\t\t\t\t\t target-\u003ebackoff.times * polling_interval);"},{"line_number":3079,"context_line":"\t\t\t\t\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"42d2c4e7_7b7b3e89","side":"PARENT","line":3076,"range":{"start_line":3076,"start_character":5,"end_line":3076,"end_character":33},"in_reply_to":"1176ef97_3202e47a","updated":"2025-10-21 17:38:37.000000000","message":"Reverted. Please see the FIXME.","commit_id":"66335683fec62ac89da48d64932fd9d082314225"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"0ee35a6f8d22c6c3048f3d5f07e1b74b5435d9e5","unresolved":true,"context_lines":[{"line_number":3073,"context_line":"\t\t\t\t/* Target examination could have failed due to unstable connection,"},{"line_number":3074,"context_line":"\t\t\t\t * but we set the examined flag anyway to repoll it later */"},{"line_number":3075,"context_line":"\t\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":3076,"context_line":"\t\t\t\t\ttarget_set_examined(target);"},{"line_number":3077,"context_line":"\t\t\t\t\tLOG_USER(\"Examination failed, GDB will be halted. Polling again in %dms\","},{"line_number":3078,"context_line":"\t\t\t\t\t\t target-\u003ebackoff.times * polling_interval);"},{"line_number":3079,"context_line":"\t\t\t\t\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"1176ef97_3202e47a","side":"PARENT","line":3076,"range":{"start_line":3076,"start_character":5,"end_line":3076,"end_character":33},"in_reply_to":"9fc528e4_f56de3f9","updated":"2022-05-06 16:32:03.000000000","message":"I\u0027ll revert it.","commit_id":"66335683fec62ac89da48d64932fd9d082314225"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f533a2f8452935f2f70c027f591dea4e0dd4ab2f","unresolved":true,"context_lines":[{"line_number":3067,"context_line":"\t\t\t\ttarget_call_event_callbacks(target, TARGET_EVENT_GDB_HALT);"},{"line_number":3068,"context_line":"\t\t\t}"},{"line_number":3069,"context_line":"\t\t\tif (target-\u003ebackoff.times \u003e 0) {"},{"line_number":3070,"context_line":"\t\t\t\tLOG_TARGET_DEBUG(target, \"Polling failed, trying to reexamine\");"},{"line_number":3071,"context_line":"\t\t\t\ttarget_reset_examined(target);"},{"line_number":3072,"context_line":"\t\t\t\tretval \u003d target_examine_one(target);"},{"line_number":3073,"context_line":"\t\t\t\tif (retval !\u003d ERROR_OK) {"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"193e4d44_9f4b0f22","line":3070,"range":{"start_line":3070,"start_character":15,"end_line":3070,"end_character":20},"updated":"2022-05-05 21:03:57.000000000","message":"Seems me too quiet. And not described in commit msg.","commit_id":"3b7631133f5d734dc04ba7d8467315098140099c"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"d99db65f7b76b35594584a9c41c4f6a6f4c1aae9","unresolved":true,"context_lines":[{"line_number":3067,"context_line":"\t\t\t\ttarget_call_event_callbacks(target, TARGET_EVENT_GDB_HALT);"},{"line_number":3068,"context_line":"\t\t\t}"},{"line_number":3069,"context_line":"\t\t\tif (target-\u003ebackoff.times \u003e 0) {"},{"line_number":3070,"context_line":"\t\t\t\tLOG_TARGET_DEBUG(target, \"Polling failed, trying to reexamine\");"},{"line_number":3071,"context_line":"\t\t\t\ttarget_reset_examined(target);"},{"line_number":3072,"context_line":"\t\t\t\tretval \u003d target_examine_one(target);"},{"line_number":3073,"context_line":"\t\t\t\tif (retval !\u003d ERROR_OK) {"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"66a7dd44_8a3b1f55","line":3070,"range":{"start_line":3070,"start_character":15,"end_line":3070,"end_character":20},"in_reply_to":"0925b490_29fdfa6f","updated":"2025-10-21 17:38:37.000000000","message":"Reverted. The message about failure to examine is promoted to LOG_ERROR.","commit_id":"3b7631133f5d734dc04ba7d8467315098140099c"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"0ee35a6f8d22c6c3048f3d5f07e1b74b5435d9e5","unresolved":true,"context_lines":[{"line_number":3067,"context_line":"\t\t\t\ttarget_call_event_callbacks(target, TARGET_EVENT_GDB_HALT);"},{"line_number":3068,"context_line":"\t\t\t}"},{"line_number":3069,"context_line":"\t\t\tif (target-\u003ebackoff.times \u003e 0) {"},{"line_number":3070,"context_line":"\t\t\t\tLOG_TARGET_DEBUG(target, \"Polling failed, trying to reexamine\");"},{"line_number":3071,"context_line":"\t\t\t\ttarget_reset_examined(target);"},{"line_number":3072,"context_line":"\t\t\t\tretval \u003d target_examine_one(target);"},{"line_number":3073,"context_line":"\t\t\t\tif (retval !\u003d ERROR_OK) {"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"0925b490_29fdfa6f","line":3070,"range":{"start_line":3070,"start_character":15,"end_line":3070,"end_character":20},"in_reply_to":"193e4d44_9f4b0f22","updated":"2022-05-06 16:32:03.000000000","message":"I\u0027ll revert it.","commit_id":"3b7631133f5d734dc04ba7d8467315098140099c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f959f910267e7e0e2dd3f1f0327b8ea624f6aa54","unresolved":false,"context_lines":[{"line_number":3067,"context_line":"\t\t\t\ttarget_call_event_callbacks(target, TARGET_EVENT_GDB_HALT);"},{"line_number":3068,"context_line":"\t\t\t}"},{"line_number":3069,"context_line":"\t\t\tif (target-\u003ebackoff.times \u003e 0) {"},{"line_number":3070,"context_line":"\t\t\t\tLOG_TARGET_DEBUG(target, \"Polling failed, trying to reexamine\");"},{"line_number":3071,"context_line":"\t\t\t\ttarget_reset_examined(target);"},{"line_number":3072,"context_line":"\t\t\t\tretval \u003d target_examine_one(target);"},{"line_number":3073,"context_line":"\t\t\t\tif (retval !\u003d ERROR_OK) {"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"1ff5dc1b_4025fff9","line":3070,"range":{"start_line":3070,"start_character":15,"end_line":3070,"end_character":20},"in_reply_to":"66a7dd44_8a3b1f55","updated":"2025-10-22 08:15:04.000000000","message":"Done","commit_id":"3b7631133f5d734dc04ba7d8467315098140099c"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f533a2f8452935f2f70c027f591dea4e0dd4ab2f","unresolved":true,"context_lines":[{"line_number":3071,"context_line":"\t\t\t\ttarget_reset_examined(target);"},{"line_number":3072,"context_line":"\t\t\t\tretval \u003d target_examine_one(target);"},{"line_number":3073,"context_line":"\t\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":3074,"context_line":"\t\t\t\t\tLOG_TARGET_DEBUG(target,"},{"line_number":3075,"context_line":"\t\t\t\t\t\t\t\"Examination failed, GDB will be halted. Polling again in %dms\","},{"line_number":3076,"context_line":"\t\t\t\t\t\t\ttarget-\u003ebackoff.times * polling_interval);"},{"line_number":3077,"context_line":"\t\t\t\t\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"096ceb96_8e623031","line":3074,"range":{"start_line":3074,"start_character":16,"end_line":3074,"end_character":21},"updated":"2022-05-05 21:03:57.000000000","message":"Seems me too quiet. And not described in commit msg.\nThis or the one above message indicates the target is unresponsive and I also appreciate it is repeated until the communication is fixed.\nAt least one msg should stay at USER level.","commit_id":"3b7631133f5d734dc04ba7d8467315098140099c"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"0ee35a6f8d22c6c3048f3d5f07e1b74b5435d9e5","unresolved":true,"context_lines":[{"line_number":3071,"context_line":"\t\t\t\ttarget_reset_examined(target);"},{"line_number":3072,"context_line":"\t\t\t\tretval \u003d target_examine_one(target);"},{"line_number":3073,"context_line":"\t\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":3074,"context_line":"\t\t\t\t\tLOG_TARGET_DEBUG(target,"},{"line_number":3075,"context_line":"\t\t\t\t\t\t\t\"Examination failed, GDB will be halted. Polling again in %dms\","},{"line_number":3076,"context_line":"\t\t\t\t\t\t\ttarget-\u003ebackoff.times * polling_interval);"},{"line_number":3077,"context_line":"\t\t\t\t\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"927a0e22_7cbb533e","line":3074,"range":{"start_line":3074,"start_character":16,"end_line":3074,"end_character":21},"in_reply_to":"096ceb96_8e623031","updated":"2022-05-06 16:32:03.000000000","message":"I\u0027ll revert it.","commit_id":"3b7631133f5d734dc04ba7d8467315098140099c"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"d99db65f7b76b35594584a9c41c4f6a6f4c1aae9","unresolved":true,"context_lines":[{"line_number":3071,"context_line":"\t\t\t\ttarget_reset_examined(target);"},{"line_number":3072,"context_line":"\t\t\t\tretval \u003d target_examine_one(target);"},{"line_number":3073,"context_line":"\t\t\t\tif (retval !\u003d ERROR_OK) {"},{"line_number":3074,"context_line":"\t\t\t\t\tLOG_TARGET_DEBUG(target,"},{"line_number":3075,"context_line":"\t\t\t\t\t\t\t\"Examination failed, GDB will be halted. Polling again in %dms\","},{"line_number":3076,"context_line":"\t\t\t\t\t\t\ttarget-\u003ebackoff.times * polling_interval);"},{"line_number":3077,"context_line":"\t\t\t\t\treturn retval;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"19a940f0_88acbeb7","line":3074,"range":{"start_line":3074,"start_character":16,"end_line":3074,"end_character":21},"in_reply_to":"927a0e22_7cbb533e","updated":"2025-10-21 17:38:37.000000000","message":"Reverted. The message about failure to examine is promoted to LOG_ERROR.","commit_id":"3b7631133f5d734dc04ba7d8467315098140099c"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"4186088e386ea4b5c44a21af3c3a2f4247b38bea","unresolved":true,"context_lines":[{"line_number":3057,"context_line":"\t\t\t\t\tMIN(target-\u003ebackoff.interval * 2 + 1, 5000));"},{"line_number":3058,"context_line":"\t\t\t/* Tell GDB to halt the debugger. This allows the user to run"},{"line_number":3059,"context_line":"\t\t\t * monitor commands to handle the situation. */"},{"line_number":3060,"context_line":"\t\t\ttarget_call_event_callbacks(target, TARGET_EVENT_GDB_HALT);"},{"line_number":3061,"context_line":"\t\t}"},{"line_number":3062,"context_line":"\t\ttarget-\u003ebackoff.next_attempt \u003d timeval_ms() + target-\u003ebackoff.interval;"},{"line_number":3063,"context_line":"\t\tLOG_TARGET_DEBUG(target, \"target_poll() -\u003e %d, next attempt in %dms\","}],"source_content_type":"text/x-csrc","patch_set":5,"id":"1aabace1_9ef5fed8","line":3060,"updated":"2025-10-21 15:39:38.000000000","message":"It seems like this is not the best idea.\nPlease, see [1].\n1: https://github.com/riscv-collab/riscv-openocd/commit/21433e83eeda7abe621027f12d588ebdea7760d3","commit_id":"6d0bc1497320150512f3416403ad90e1fe4b83e4"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"d99db65f7b76b35594584a9c41c4f6a6f4c1aae9","unresolved":false,"context_lines":[{"line_number":3057,"context_line":"\t\t\t\t\tMIN(target-\u003ebackoff.interval * 2 + 1, 5000));"},{"line_number":3058,"context_line":"\t\t\t/* Tell GDB to halt the debugger. This allows the user to run"},{"line_number":3059,"context_line":"\t\t\t * monitor commands to handle the situation. */"},{"line_number":3060,"context_line":"\t\t\ttarget_call_event_callbacks(target, TARGET_EVENT_GDB_HALT);"},{"line_number":3061,"context_line":"\t\t}"},{"line_number":3062,"context_line":"\t\ttarget-\u003ebackoff.next_attempt \u003d timeval_ms() + target-\u003ebackoff.interval;"},{"line_number":3063,"context_line":"\t\tLOG_TARGET_DEBUG(target, \"target_poll() -\u003e %d, next attempt in %dms\","}],"source_content_type":"text/x-csrc","patch_set":5,"id":"4ca1ba3b_280628f7","line":3060,"in_reply_to":"1aabace1_9ef5fed8","updated":"2025-10-21 17:38:37.000000000","message":"Addressed.","commit_id":"6d0bc1497320150512f3416403ad90e1fe4b83e4"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f959f910267e7e0e2dd3f1f0327b8ea624f6aa54","unresolved":true,"context_lines":[{"line_number":694,"context_line":"\t\treturn retval;"},{"line_number":695,"context_line":"\t}"},{"line_number":696,"context_line":""},{"line_number":697,"context_line":"\tLOG_TARGET_USER(target, \"Target successfully examined.\");"},{"line_number":698,"context_line":"\ttarget_set_examined(target);"},{"line_number":699,"context_line":"\ttarget_call_event_callbacks(target, TARGET_EVENT_EXAMINE_END);"},{"line_number":700,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":10,"id":"fe25f06f_d3d2febe","line":697,"range":{"start_line":697,"start_character":1,"end_line":697,"end_character":58},"updated":"2025-10-22 08:15:04.000000000","message":"Why? See 3 lines below...","commit_id":"9ff8f1cae5d304ebdb76fd553ae5156dec713bde"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"5757fd42315613068e44511370767ebcfec15322","unresolved":true,"context_lines":[{"line_number":694,"context_line":"\t\treturn retval;"},{"line_number":695,"context_line":"\t}"},{"line_number":696,"context_line":""},{"line_number":697,"context_line":"\tLOG_TARGET_USER(target, \"Target successfully examined.\");"},{"line_number":698,"context_line":"\ttarget_set_examined(target);"},{"line_number":699,"context_line":"\ttarget_call_event_callbacks(target, TARGET_EVENT_EXAMINE_END);"},{"line_number":700,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":10,"id":"4fd0b8b1_e267d651","line":697,"range":{"start_line":697,"start_character":1,"end_line":697,"end_character":58},"in_reply_to":"fe25f06f_d3d2febe","updated":"2026-02-27 13:31:46.000000000","message":"Addressed.","commit_id":"9ff8f1cae5d304ebdb76fd553ae5156dec713bde"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f959f910267e7e0e2dd3f1f0327b8ea624f6aa54","unresolved":true,"context_lines":[{"line_number":2934,"context_line":"\t\treturn res;"},{"line_number":2935,"context_line":""},{"line_number":2936,"context_line":"\t/* Allow poll to fail silently if the follow-up reexamination succeeds. */"},{"line_number":2937,"context_line":"\tLOG_TARGET_USER(target, \"Polling failed, trying to reexamine\");"},{"line_number":2938,"context_line":"\ttarget_reset_examined(target);"},{"line_number":2939,"context_line":"\tres \u003d target_examine_one(target);"},{"line_number":2940,"context_line":"\tif (res !\u003d ERROR_OK) {"}],"source_content_type":"text/x-csrc","patch_set":10,"id":"ce43347d_c7f4abd2","line":2937,"updated":"2025-10-22 08:15:04.000000000","message":"See\n8314: target: Do not use LOG_USER() for error messages | https://review.openocd.org/c/openocd/+/8314\n\nDo not revert it!","commit_id":"9ff8f1cae5d304ebdb76fd553ae5156dec713bde"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"5757fd42315613068e44511370767ebcfec15322","unresolved":true,"context_lines":[{"line_number":2934,"context_line":"\t\treturn res;"},{"line_number":2935,"context_line":""},{"line_number":2936,"context_line":"\t/* Allow poll to fail silently if the follow-up reexamination succeeds. */"},{"line_number":2937,"context_line":"\tLOG_TARGET_USER(target, \"Polling failed, trying to reexamine\");"},{"line_number":2938,"context_line":"\ttarget_reset_examined(target);"},{"line_number":2939,"context_line":"\tres \u003d target_examine_one(target);"},{"line_number":2940,"context_line":"\tif (res !\u003d ERROR_OK) {"}],"source_content_type":"text/x-csrc","patch_set":10,"id":"d4097f57_09b9d4cd","line":2937,"in_reply_to":"ce43347d_c7f4abd2","updated":"2026-02-27 13:31:46.000000000","message":"Addressed.","commit_id":"9ff8f1cae5d304ebdb76fd553ae5156dec713bde"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f959f910267e7e0e2dd3f1f0327b8ea624f6aa54","unresolved":true,"context_lines":[{"line_number":2940,"context_line":"\tif (res !\u003d ERROR_OK) {"},{"line_number":2941,"context_line":"\t\tLOG_TARGET_ERROR(target, \"Examination failed\");"},{"line_number":2942,"context_line":"\t\t/* FIXME: this call, together with the `!target_was_examined()` check"},{"line_number":2943,"context_line":"\t\t * at the beginning of this function seem like an abuse of"},{"line_number":2944,"context_line":"\t\t * `target-\u003eexamined` flag. Setting `target-\u003eexamined` like this breaks"},{"line_number":2945,"context_line":"\t\t * the assumption `target_was_examined()` \u003d\u003e `examine()` has succeeded."},{"line_number":2946,"context_line":"\t\t * However, first it is needed to verify all the targets will be able"},{"line_number":2947,"context_line":"\t\t * to poll without being having `examine` bit set. As an alternative we"},{"line_number":2948,"context_line":"\t\t * can add a guard around the call to `target_poll()`, something like"},{"line_number":2949,"context_line":"\t\t * `target_query(target, TARGET_READY_TO_POLL)`. */"},{"line_number":2950,"context_line":"\t\ttarget_set_examined(target);"},{"line_number":2951,"context_line":"\t}"},{"line_number":2952,"context_line":"\treturn res;"}],"source_content_type":"text/x-csrc","patch_set":10,"id":"2e21b08d_5f82d56d","line":2949,"range":{"start_line":2943,"start_character":1,"end_line":2949,"end_character":49},"updated":"2025-10-22 08:15:04.000000000","message":"I would prefer a reference to\n6753: Revert \"target: reset target examined flag if target::examine() fails\" | https://review.openocd.org/c/openocd/+/6753\ninstead of this somewhat unclear explanation","commit_id":"9ff8f1cae5d304ebdb76fd553ae5156dec713bde"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"5757fd42315613068e44511370767ebcfec15322","unresolved":true,"context_lines":[{"line_number":2940,"context_line":"\tif (res !\u003d ERROR_OK) {"},{"line_number":2941,"context_line":"\t\tLOG_TARGET_ERROR(target, \"Examination failed\");"},{"line_number":2942,"context_line":"\t\t/* FIXME: this call, together with the `!target_was_examined()` check"},{"line_number":2943,"context_line":"\t\t * at the beginning of this function seem like an abuse of"},{"line_number":2944,"context_line":"\t\t * `target-\u003eexamined` flag. Setting `target-\u003eexamined` like this breaks"},{"line_number":2945,"context_line":"\t\t * the assumption `target_was_examined()` \u003d\u003e `examine()` has succeeded."},{"line_number":2946,"context_line":"\t\t * However, first it is needed to verify all the targets will be able"},{"line_number":2947,"context_line":"\t\t * to poll without being having `examine` bit set. As an alternative we"},{"line_number":2948,"context_line":"\t\t * can add a guard around the call to `target_poll()`, something like"},{"line_number":2949,"context_line":"\t\t * `target_query(target, TARGET_READY_TO_POLL)`. */"},{"line_number":2950,"context_line":"\t\ttarget_set_examined(target);"},{"line_number":2951,"context_line":"\t}"},{"line_number":2952,"context_line":"\treturn res;"}],"source_content_type":"text/x-csrc","patch_set":10,"id":"718856d8_0c25e578","line":2949,"range":{"start_line":2943,"start_character":1,"end_line":2949,"end_character":49},"in_reply_to":"2e21b08d_5f82d56d","updated":"2026-02-27 13:31:46.000000000","message":"AFAIU, this is addressed by your patch series.","commit_id":"9ff8f1cae5d304ebdb76fd553ae5156dec713bde"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f959f910267e7e0e2dd3f1f0327b8ea624f6aa54","unresolved":true,"context_lines":[{"line_number":3019,"context_line":"\t\t\ttarget-\u003ebackoff.interval \u003d MAX(polling_interval,"},{"line_number":3020,"context_line":"\t\t\t\t\tMIN(target-\u003ebackoff.interval * 2u + 1u, TARGET_MAX_POLLING_INTERVAL_MS));"},{"line_number":3021,"context_line":"\t\t} else {"},{"line_number":3022,"context_line":"\t\t\ttarget-\u003ebackoff.interval \u003d polling_interval;"},{"line_number":3023,"context_line":"\t\t}"},{"line_number":3024,"context_line":"\t\ttarget-\u003ebackoff.next_attempt \u003d timeval_ms() + target-\u003ebackoff.interval;"},{"line_number":3025,"context_line":"\t\tLOG_TARGET_DEBUG(target, \"target_poll() -\u003e %d, next attempt in %ums\","}],"source_content_type":"text/x-csrc","patch_set":10,"id":"225c49a7_6cb89de6","line":3022,"updated":"2025-10-22 08:15:04.000000000","message":"Increasing backoff.interval does not work!\nIf backoff.interval \u003e polling_interval then `handle_one_target()` returns ERROR_OK every time polling is postponed due to waiting to backoff.next_attempt\nAnd this resets backoff.interval to the base polling_interval!\n\nPLEASE DON\u0027T SUBMIT UNTESTED CODE!!","commit_id":"9ff8f1cae5d304ebdb76fd553ae5156dec713bde"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"5757fd42315613068e44511370767ebcfec15322","unresolved":true,"context_lines":[{"line_number":3019,"context_line":"\t\t\ttarget-\u003ebackoff.interval \u003d MAX(polling_interval,"},{"line_number":3020,"context_line":"\t\t\t\t\tMIN(target-\u003ebackoff.interval * 2u + 1u, TARGET_MAX_POLLING_INTERVAL_MS));"},{"line_number":3021,"context_line":"\t\t} else {"},{"line_number":3022,"context_line":"\t\t\ttarget-\u003ebackoff.interval \u003d polling_interval;"},{"line_number":3023,"context_line":"\t\t}"},{"line_number":3024,"context_line":"\t\ttarget-\u003ebackoff.next_attempt \u003d timeval_ms() + target-\u003ebackoff.interval;"},{"line_number":3025,"context_line":"\t\tLOG_TARGET_DEBUG(target, \"target_poll() -\u003e %d, next attempt in %ums\","}],"source_content_type":"text/x-csrc","patch_set":10,"id":"2b7888f8_a92d90ec","line":3022,"in_reply_to":"225c49a7_6cb89de6","updated":"2026-02-27 13:31:46.000000000","message":"Thanks for the catch! Addressed.","commit_id":"9ff8f1cae5d304ebdb76fd553ae5156dec713bde"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"f959f910267e7e0e2dd3f1f0327b8ea624f6aa54","unresolved":true,"context_lines":[{"line_number":3022,"context_line":"\t\t\ttarget-\u003ebackoff.interval \u003d polling_interval;"},{"line_number":3023,"context_line":"\t\t}"},{"line_number":3024,"context_line":"\t\ttarget-\u003ebackoff.next_attempt \u003d timeval_ms() + target-\u003ebackoff.interval;"},{"line_number":3025,"context_line":"\t\tLOG_TARGET_DEBUG(target, \"target_poll() -\u003e %d, next attempt in %ums\","},{"line_number":3026,"context_line":"\t\t\t\t tgt_res, target-\u003ebackoff.interval);"},{"line_number":3027,"context_line":"\t}"},{"line_number":3028,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":10,"id":"e9b170a4_f37aa0ef","line":3025,"updated":"2025-10-22 08:15:04.000000000","message":"Too noisy.\nSee C style guide https://openocd.org/doc/doxygen/html/stylec.html\n\u003e Try to avoid flooding the log with frequently generated messages.\n\u003e For example, do not use LOG_DEBUG() in operations used for polling the target.\n\u003e Use LOG_DEBUG_IO() for such frequent messages.","commit_id":"9ff8f1cae5d304ebdb76fd553ae5156dec713bde"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"5757fd42315613068e44511370767ebcfec15322","unresolved":true,"context_lines":[{"line_number":3022,"context_line":"\t\t\ttarget-\u003ebackoff.interval \u003d polling_interval;"},{"line_number":3023,"context_line":"\t\t}"},{"line_number":3024,"context_line":"\t\ttarget-\u003ebackoff.next_attempt \u003d timeval_ms() + target-\u003ebackoff.interval;"},{"line_number":3025,"context_line":"\t\tLOG_TARGET_DEBUG(target, \"target_poll() -\u003e %d, next attempt in %ums\","},{"line_number":3026,"context_line":"\t\t\t\t tgt_res, target-\u003ebackoff.interval);"},{"line_number":3027,"context_line":"\t}"},{"line_number":3028,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":10,"id":"1f72fa4c_0e1b907b","line":3025,"in_reply_to":"e9b170a4_f37aa0ef","updated":"2026-02-27 13:31:46.000000000","message":"Addressed.","commit_id":"9ff8f1cae5d304ebdb76fd553ae5156dec713bde"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"5a9db75423d8569d0928f654a01436ce824e1756","unresolved":true,"context_lines":[{"line_number":2944,"context_line":"\t\trecursive \u003d 0;"},{"line_number":2945,"context_line":"\t}"},{"line_number":2946,"context_line":""},{"line_number":2947,"context_line":"\tif (power_dropout || srst_asserted)"},{"line_number":2948,"context_line":"\t\treturn ERROR_OK;"},{"line_number":2949,"context_line":""},{"line_number":2950,"context_line":"\tint retval \u003d ERROR_OK;"}],"source_content_type":"text/x-csrc","patch_set":13,"id":"efc1c8c2_9f1eb6f5","line":2947,"range":{"start_line":2947,"start_character":22,"end_line":2947,"end_character":35},"updated":"2026-04-14 08:38:10.000000000","message":"Avoiding poll during power_dropout is probably correct.\nOn the other hand srst_asserted condition may break targets configured with `reset_config srst_nogate`\n\nMoreover, seems me as a broken duplicate of tests in `is_jtag_poll_safe()`\n\nAny reason why the test was added in the recent patchsets?","commit_id":"5c840c44c0fd1308fa4926ffeaf22c0f584f6661"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"651b992acc40e1516523de7e58a2e5fd9cf83103","unresolved":false,"context_lines":[{"line_number":2944,"context_line":"\t\trecursive \u003d 0;"},{"line_number":2945,"context_line":"\t}"},{"line_number":2946,"context_line":""},{"line_number":2947,"context_line":"\tif (power_dropout || srst_asserted)"},{"line_number":2948,"context_line":"\t\treturn ERROR_OK;"},{"line_number":2949,"context_line":""},{"line_number":2950,"context_line":"\tint retval \u003d ERROR_OK;"}],"source_content_type":"text/x-csrc","patch_set":13,"id":"68be9b07_ac11198e","line":2947,"range":{"start_line":2947,"start_character":22,"end_line":2947,"end_character":35},"in_reply_to":"37914157_e4c101ee","updated":"2026-04-28 12:18:58.000000000","message":"\u003e \u003e Any reason why the test was added in the recent patchsets?\n\u003e \n\u003e These checks are not introduced by this patch, they are just moved out of the loop. Please take a look at the deleted line bellow the comment:\n\u003e ```\n\u003e /* only poll target if we\u0027ve got power and srst isn\u0027t asserted */\n\nOh yes, I was aware of `power_dropout` test but didn\u0027t noticed that `srst_asserted` was tested too. Sorry.\n\nSo okay then, the new code is not more broken than original one 😊\n\n\u003e Moreover, seems me as a broken duplicate of tests in is_jtag_poll_safe()\n\u003e \n\u003e Are you sure? AFAIU there is nothing connected to `power_dropout` anywhere in the `is_jtag_poll_safe()`.\n\nDid not mean both tests, I meant just `srst_asserted`.\nI looked more carefully at `is_jtag_poll_safe()` and seems broken too as it honours RESET_SRST_NO_GATING option for JTAG transport only whereas lot of SWD devices uses it as well.\nI will address both in a separate patch.\n\n\u003e These `power_dropout` and `srst_asserted` are related to the `sence_handler()` and the corresponding features of a debug adapter driver:\n\u003e `adapter_driver::srst_asserted()` and `adapter_driver::power_dropout()` methods.\n\u003e \n\u003e Curiously, these methods are not implemented for any of the drivers. So the whole deal around `sence_handler()` is dead code. I\u0027ve prepared a patch series that removes them (the final goal of that series is to eliminate assertion failures in case JTAG commands are called before `init`, the removal of this dead code was just a side quest). I will post this series shortly.\n\nYes, `power_dropout` handling was implemented in ZY1000 minidriver which was dropped in 2020. Since then it is dead code but intentionally preserved for future use. Also see\n7126: jtag/adapter: Add GPIOs for power and srst sensing | https://review.openocd.org/c/openocd/+/7126","commit_id":"5c840c44c0fd1308fa4926ffeaf22c0f584f6661"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"aff1e19c5ac15fa73b23550e13ff377528c59471","unresolved":true,"context_lines":[{"line_number":2944,"context_line":"\t\trecursive \u003d 0;"},{"line_number":2945,"context_line":"\t}"},{"line_number":2946,"context_line":""},{"line_number":2947,"context_line":"\tif (power_dropout || srst_asserted)"},{"line_number":2948,"context_line":"\t\treturn ERROR_OK;"},{"line_number":2949,"context_line":""},{"line_number":2950,"context_line":"\tint retval \u003d ERROR_OK;"}],"source_content_type":"text/x-csrc","patch_set":13,"id":"37914157_e4c101ee","line":2947,"range":{"start_line":2947,"start_character":22,"end_line":2947,"end_character":35},"in_reply_to":"efc1c8c2_9f1eb6f5","updated":"2026-04-28 11:32:05.000000000","message":"\u003e Any reason why the test was added in the recent patchsets?\n\nThese checks are not introduced by this patch, they are just moved out of the loop. Please take a look at the deleted line bellow the comment:\n```\n/* only poll target if we\u0027ve got power and srst isn\u0027t asserted */\n```\n\nAfter the move to time-based backoff there is nothing to do in the loop body for the case poll is not attempted, so the check can be safely moved out of the loop.\n\n\u003e Moreover, seems me as a broken duplicate of tests in is_jtag_poll_safe()\n\nAre you sure? AFAIU there is nothing connected to `power_dropout` anywhere in the `is_jtag_poll_safe()`.\n\nThese `power_dropout` and `srst_asserted` are related to the `sence_handler()` and the corresponding features of a debug adapter driver:\n`adapter_driver::srst_asserted()` and `adapter_driver::power_dropout()` methods.\n\nCuriously, these methods are not implemented for any of the drivers. So the whole deal around `sence_handler()` is dead code. I\u0027ve prepared a patch series that removes them (the final goal of that series is to eliminate assertion failures in case JTAG commands are called before `init`, the removal of this dead code was just a side quest). I will post this series shortly.","commit_id":"5c840c44c0fd1308fa4926ffeaf22c0f584f6661"}]}
