This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: cec-compliance: retry poll in case of Arbitration Lost
Author:  Hans Verkuil <hans.verk...@cisco.com>
Date:    Mon Oct 8 10:48:58 2018 +0200

Polling for remote devices can fail due to an Arbitration Lost
condition. Check for this and retry if that was the reason why
the poll failed.

Signed-off-by: Hans Verkuil <hans.verk...@cisco.com>

 utils/cec-compliance/cec-compliance.cpp | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=a94b3b1d6ab7a67ac2496e0f99c26b097922948d
diff --git a/utils/cec-compliance/cec-compliance.cpp 
b/utils/cec-compliance/cec-compliance.cpp
index ad81d80e9180..0d146b18a362 100644
--- a/utils/cec-compliance/cec-compliance.cpp
+++ b/utils/cec-compliance/cec-compliance.cpp
@@ -874,6 +874,8 @@ retry:
 
 static int poll_remote_devs(struct node *node)
 {
+       unsigned retries = 0;
+
        node->remote_la_mask = 0;
        if (!(node->caps & CEC_CAP_TRANSMIT))
                return 0;
@@ -882,10 +884,21 @@ static int poll_remote_devs(struct node *node)
                struct cec_msg msg;
 
                cec_msg_init(&msg, node->log_addr[0], i);
-
                fail_on_test(doioctl(node, CEC_TRANSMIT, &msg));
-               if (msg.tx_status & CEC_TX_STATUS_OK)
+
+               if (msg.tx_status & CEC_TX_STATUS_OK) {
                        node->remote_la_mask |= 1 << i;
+                       retries = 0;
+               } else if (msg.tx_status & CEC_TX_STATUS_NACK) {
+                       retries = 0;
+               } else {
+                       if (!(msg.tx_status & CEC_TX_STATUS_ARB_LOST))
+                               warn("retry poll due to unexpected status: 
%s\n",
+                                    status2s(msg).c_str());
+                       retries++;
+                       fail_on_test(retries > 10);
+                       i--;
+               }
        }
        return 0;
 }

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to