target: improve robustness of polling and reexamination 70/2370/2
authorPaul Fertser <fercerpav@gmail.com>
Sun, 2 Nov 2014 12:03:16 +0000 (15:03 +0300)
committerSpencer Oliver <spen@spen-soft.co.uk>
Fri, 9 Jan 2015 08:36:06 +0000 (08:36 +0000)
When a target was present on OpenOCD start but later disappeared for
whatever reason (typically unstable connection or target going to
sleep) and reappeared only for a brief period of time, reexamination
would fail, and poll would no longer run. This patch fixes it.

Change-Id: I61f9b5a3f366a761320e233f4e1689f926b5556d
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2370
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
src/target/target.c

index d7a2c4815de22ee7b75e7bae9f0cd5891e504681..b74c6a0cc920323c3f185907da0894bbbecbc07d 100644 (file)
@@ -2425,7 +2425,13 @@ static int handle_target(void *priv)
                        if (target->backoff.times > 0) {
                                LOG_USER("Polling target %s succeeded again, trying to reexamine", target_name(target));
                                target_reset_examined(target);
-                               target_examine_one(target);
+                               retval = target_examine_one(target);
+                               /* Target examination could have failed due to unstable connection,
+                                * but we set the examined flag anyway to repoll it later */
+                               if (retval != ERROR_OK) {
+                                       target->examined = true;
+                                       return retval;
+                               }
                        }
 
                        target->backoff.times = 0;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)