aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-compliance
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-07-24 09:32:36 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2018-07-24 09:32:36 +0200
commit3ad1c7c075c46b4ac069be6f75d59d722f135bcc (patch)
treeabbaac33e7148a0323374f0048a40d48d0785ed1 /utils/cec-compliance
parent5a99dc69d0bf79bedadd5c9675033a8815fceb0e (diff)
cec-compliance: if MAX_RETRIES and OK were set, mark as RX timeout
Fix the previous fix. Upon closer examination of when both MAX_RETRIES and OK are set it became clear that this happens when the TX succeeded, but waiting for a reply was cancelled. So return an RX_TIMEOUT in that case. Note that this CEC framework bug was fixed in kernel 4.18. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'utils/cec-compliance')
-rw-r--r--utils/cec-compliance/cec-compliance.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp
index 66b102dc..f062f452 100644
--- a/utils/cec-compliance/cec-compliance.cpp
+++ b/utils/cec-compliance/cec-compliance.cpp
@@ -705,7 +705,18 @@ int cec_named_ioctl(struct node *node, const char *name,
if (!retval && request == CEC_TRANSMIT &&
(msg->tx_status & CEC_TX_STATUS_OK) && ((msg->tx_status & CEC_TX_STATUS_MAX_RETRIES))) {
warn("Both OK and MAX_RETRIES were set in tx_status!\n");
- msg->tx_status &= ~CEC_TX_STATUS_OK;
+ /*
+ * Workaround this bug in the CEC framework. This bug was solved
+ * in kernel 4.18 but older versions still can produce this incorrect
+ * combination of TX flags. If this occurs, then this really means
+ * that the transmit went OK, but the wait for the reply was
+ * cancelled (e.g. due to the HPD doing down).
+ */
+ msg->tx_status &= ~(CEC_TX_STATUS_MAX_RETRIES | CEC_TX_STATUS_ERROR);
+ if (msg->tx_error_cnt)
+ msg->tx_error_cnt--;
+ msg->rx_status = CEC_RX_STATUS_TIMEOUT;
+ msg->rx_ts = msg->tx_ts;
}
if (!retval && request == CEC_TRANSMIT && show_info) {

Privacy Policy