All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/igt_chamelium: Retry DP FSM on Failure
@ 2021-05-04  7:04 Kunal Joshi
  2021-05-04  7:38 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_chamelium: Retry DP FSM on Failure (rev2) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kunal Joshi @ 2021-05-04  7:04 UTC (permalink / raw)
  To: igt-dev; +Cc: Kunal Joshi, Petri Latvala

We have a thread called chamelium_fsm_mon which monitors HPD events
triggered by chamelium, Unfortunately not always the HPD event arrives
in a fixed interval (mostly does), Quick fix to this is to retry.

v2: Remove redundant assert (Bhanu)

Fixes :- https://gitlab.freedesktop.org/drm/intel/-/issues/262
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Modem Bhanuprakash <bhanuprakash.modem@intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
---
 lib/igt_chamelium.c | 28 ++++++++++++++++++++++++----
 1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index 7085122a7..c385534c6 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -522,12 +522,32 @@ static xmlrpc_value *chamelium_rpc(struct chamelium *chamelium,
 {
 	xmlrpc_value *res;
 	va_list va_args;
+	int fsm_trials_left = 5;
 
-	va_start(va_args, format_str);
-	res = __chamelium_rpc_va(chamelium, fsm_port, method_name,
-				 format_str, va_args);
-	va_end(va_args);
+	if (strcmp(method_name, "CaptureVideo") == 0) {
+
+		while (fsm_trials_left) {
+
+			va_start(va_args, format_str);
+			res = __chamelium_rpc_va(chamelium, fsm_port,
+						 method_name, format_str,
+						 va_args);
+			va_end(va_args);
 
+			if (!chamelium->env.fault_occurred)
+				break;
+
+			igt_debug("DP FSM failed retrying, tries left %d\n", fsm_trials_left);
+			--fsm_trials_left;
+		}
+	} else {
+
+		va_start(va_args, format_str);
+		res = __chamelium_rpc_va(chamelium, fsm_port, method_name,
+					 format_str, va_args);
+		va_end(va_args);
+	}
+	
 	igt_assert_f(!chamelium->env.fault_occurred,
 		     "Chamelium RPC call failed: %s\n",
 		     chamelium->env.fault_string);
-- 
2.25.1

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [igt-dev] [PATCH i-g-t] lib/igt_chamelium: Retry DP FSM on Failure
@ 2021-05-10 17:59 Kunal Joshi
  0 siblings, 0 replies; 7+ messages in thread
From: Kunal Joshi @ 2021-05-10 17:59 UTC (permalink / raw)
  To: igt-dev; +Cc: petri.latvala

We have a thread called chamelium_fsm_mon which monitors HPD events
triggered by chamelium, Unfortunately not always the HPD event arrives
in a fixed interval (mostly does), Quick fix to this is to retry.

v2: Remove redundant assert (Bhanu)
v3: Cleanup (Petri)

Fixes :- https://gitlab.freedesktop.org/drm/intel/-/issues/262
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Modem Bhanuprakash <bhanuprakash.modem@intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
---
 lib/igt_chamelium.c | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index 7085122a..b4d838bb 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -522,12 +522,29 @@ static xmlrpc_value *chamelium_rpc(struct chamelium *chamelium,
 {
 	xmlrpc_value *res;
 	va_list va_args;
+	int fsm_trials_left = 5;
+
+	if (strcmp(method_name, "CaptureVideo") == 0
+	    || strcmp(method_name, "StartCapturingVideo") == 0) {
+		while (fsm_trials_left) {
+			va_start(va_args, format_str);
+			res = __chamelium_rpc_va(chamelium, fsm_port,
+						 method_name, format_str,
+						 va_args);
+			va_end(va_args);
+
+			if (!chamelium->env.fault_occurred)
+				break;
 
-	va_start(va_args, format_str);
-	res = __chamelium_rpc_va(chamelium, fsm_port, method_name,
-				 format_str, va_args);
-	va_end(va_args);
-
+			igt_debug("DP FSM failed retrying, tries left %d\n", fsm_trials_left);
+			--fsm_trials_left;
+		}
+	} else {
+		va_start(va_args, format_str);
+		res = __chamelium_rpc_va(chamelium, fsm_port, method_name,
+					 format_str, va_args);
+		va_end(va_args);
+	}
 	igt_assert_f(!chamelium->env.fault_occurred,
 		     "Chamelium RPC call failed: %s\n",
 		     chamelium->env.fault_string);
-- 
2.25.1

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [igt-dev] [PATCH i-g-t] lib/igt_chamelium: Retry DP FSM on Failure
@ 2021-05-04  6:12 Kunal Joshi
  0 siblings, 0 replies; 7+ messages in thread
From: Kunal Joshi @ 2021-05-04  6:12 UTC (permalink / raw)
  To: igt-dev; +Cc: Kunal Joshi, Petri Latvala

We have a thread called chamelium_fsm_mon which monitors HPD events
triggered by chamelium, Unfortunately not always the HPD event arrives
in a fixed interval (mostly does), Quick fix to this is to retry.

Fixes :- https://gitlab.freedesktop.org/drm/intel/-/issues/262
         https://jira.devtools.intel.com/browse/VLK-8093
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
---
 lib/igt_chamelium.c | 38 +++++++++++++++++++++++++++++++-------
 1 file changed, 31 insertions(+), 7 deletions(-)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index 7085122a7..39f0d01bf 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -522,15 +522,39 @@ static xmlrpc_value *chamelium_rpc(struct chamelium *chamelium,
 {
 	xmlrpc_value *res;
 	va_list va_args;
+	int fsm_trials_left = 5;
 
-	va_start(va_args, format_str);
-	res = __chamelium_rpc_va(chamelium, fsm_port, method_name,
-				 format_str, va_args);
-	va_end(va_args);
+	if (strcmp(method_name, "CaptureVideo") == 0) {
 
-	igt_assert_f(!chamelium->env.fault_occurred,
-		     "Chamelium RPC call failed: %s\n",
-		     chamelium->env.fault_string);
+		while (fsm_trials_left) {
+
+			va_start(va_args, format_str);
+			res = __chamelium_rpc_va(chamelium, fsm_port,
+						 method_name, format_str,
+						 va_args);
+			va_end(va_args);
+
+			if (!chamelium->env.fault_occurred)
+				break;
+
+			igt_debug("DP FSM failed retrying, tries left %d\n", fsm_trials_left);
+			--fsm_trials_left;
+		}
+
+		igt_assert_f(!chamelium->env.fault_occurred,
+			     "Chamelium RPC call failed: %s\n",
+			     chamelium->env.fault_string);
+	} else {
+
+		va_start(va_args, format_str);
+		res = __chamelium_rpc_va(chamelium, fsm_port, method_name,
+					 format_str, va_args);
+		va_end(va_args);
+
+		igt_assert_f(!chamelium->env.fault_occurred,
+			     "Chamelium RPC call failed: %s\n",
+			     chamelium->env.fault_string);
+	}
 
 	return res;
 }
-- 
2.25.1

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

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

end of thread, other threads:[~2021-05-10 18:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04  7:04 [igt-dev] [PATCH i-g-t] lib/igt_chamelium: Retry DP FSM on Failure Kunal Joshi
2021-05-04  7:38 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_chamelium: Retry DP FSM on Failure (rev2) Patchwork
2021-05-04  9:06 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-05-05  8:19 ` [igt-dev] [PATCH i-g-t] lib/igt_chamelium: Retry DP FSM on Failure Petri Latvala
2021-05-06  8:02   ` Joshi, Kunal1
  -- strict thread matches above, loose matches on Subject: below --
2021-05-10 17:59 Kunal Joshi
2021-05-04  6:12 Kunal Joshi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.