public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] chamelium: Retry XMLRPC call when chamelond fails talking with a receiver
@ 2020-03-24  8:38 Arkadiusz Hiler
  2020-03-24  2:36 ` Kunal Joshi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Arkadiusz Hiler @ 2020-03-24  8:38 UTC (permalink / raw)
  To: igt-dev; +Cc: Kunal Joshi

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-24 10:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-24  8:38 [igt-dev] [PATCH i-g-t] chamelium: Retry XMLRPC call when chamelond fails talking with a receiver Arkadiusz Hiler
2020-03-24  2:36 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox