public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Kunal Joshi <kunal1.joshi@intel.com>
Subject: [igt-dev] [PATCH i-g-t] chamelium: Retry XMLRPC call when chamelond fails talking with a receiver
Date: Tue, 24 Mar 2020 10:38:48 +0200	[thread overview]
Message-ID: <20200324083848.1023708-1-arkadiusz.hiler@intel.com> (raw)

All the I2C errors we get from chameleond happen when it is talking the
receiver and seem to have nothing to do with the HDMI/DisplayPort
upstream.

Let's try reaching the receiver 3 times before we give up and settle on
an error.

Fixes: https://gitlab.freedesktop.org/drm/intel/issues/217
Issue: https://bugs.chromium.org/p/chromium/issues/detail?id=993738
Cc: Imre Deak <imre.deak@intel.com>
Cc: Kunal Joshi <kunal1.joshi@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 lib/igt_chamelium.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index f98f6746..7d8f057d 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -280,12 +280,6 @@ static xmlrpc_value *__chamelium_rpc_va(struct chamelium *chamelium,
 	struct fsm_monitor_args monitor_args;
 	pthread_t fsm_thread_id;
 
-	/* Cleanup the last error, if any */
-	if (chamelium->env.fault_occurred) {
-		xmlrpc_env_clean(&chamelium->env);
-		xmlrpc_env_init(&chamelium->env);
-	}
-
 	/* Unfortunately xmlrpc_client's event loop helpers are rather useless
 	 * for implementing any sort of event loop, since they provide no way
 	 * to poll for events other then the RPC response. This means in order
@@ -300,9 +294,25 @@ static xmlrpc_value *__chamelium_rpc_va(struct chamelium *chamelium,
 			       &monitor_args);
 	}
 
-	xmlrpc_client_call2f_va(&chamelium->env, chamelium->client,
-				chamelium->url, method_name, format_str, &res,
-				va_args);
+	for (int retries = 3; retries > 0; retries--) {
+		/* Cleanup the last error, if any */
+		if (chamelium->env.fault_occurred) {
+			xmlrpc_env_clean(&chamelium->env);
+			xmlrpc_env_init(&chamelium->env);
+		}
+
+		xmlrpc_client_call2f_va(&chamelium->env, chamelium->client,
+					chamelium->url, method_name, format_str, &res,
+					va_args);
+
+		if (!chamelium->env.fault_occurred)
+			break;
+
+		if (NULL == strstr(chamelium->env.fault_string, "I2C"))
+			break;
+
+		/* i2c error, let's try to retry */
+	}
 
 	if (fsm_port) {
 		pthread_cancel(fsm_thread_id);
-- 
2.24.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2020-03-24  8:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24  8:38 Arkadiusz Hiler [this message]
2020-03-24  2:36 ` [igt-dev] [PATCH i-g-t] chamelium: Retry XMLRPC call when chamelond fails talking with a receiver Kunal Joshi
2020-03-24  9:09 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-03-24  9:12 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
2020-03-24 10:11 ` [igt-dev] ✗ Fi.CI.IGT: failure for " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200324083848.1023708-1-arkadiusz.hiler@intel.com \
    --to=arkadiusz.hiler@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kunal1.joshi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox