aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-10-22 16:11:14 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-10-22 16:11:14 +0200
commit94c0844b06c2c2517fdfe97e84c047ca3b2d67d8 (patch)
treee164c2a8e00b3f6ea528da77f562c1844d50efed
parent070b352e55fb8d8549afc86088584837ba9532b6 (diff)
cec-ctl: really wait for 2 seconds when the HPD is low
The purpose of commit 5b4a5a96ebe5 ("cec-ctl: improve wait_for_pwr_state") was to: "if, while waiting for Standby, the HPD is pulled low, then do not immediately assume the device is in standby, instead wait for two consecutive low HPDs before reporting that the device is in standby.". However, CEC_ADAP_G_LOG_ADDRS calls that checked if the logical address was invalid prevented that commit from actually doing the right thing. Those CEC_ADAP_G_LOG_ADDRS calls should have been removed, so do this now. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/cec-ctl/cec-ctl.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/utils/cec-ctl/cec-ctl.cpp b/utils/cec-ctl/cec-ctl.cpp
index a7b35826..9536d3cd 100644
--- a/utils/cec-ctl/cec-ctl.cpp
+++ b/utils/cec-ctl/cec-ctl.cpp
@@ -1225,12 +1225,10 @@ static int init_power_cycle_test(const struct node &node, unsigned repeats, unsi
tries = 0;
unsigned hpd_is_low_cnt = 0;
for (;;) {
- doioctl(&node, CEC_ADAP_G_LOG_ADDRS, &laddrs);
- if (laddrs.log_addr[0] == CEC_LOG_ADDR_INVALID)
- break;
-
ret = transmit_msg_retry(node, msg);
- if (ret) {
+ // The first standby transmit must always succeed,
+ // later standbys may fail with ENONET
+ if (ret && (ret != ENONET || !tries)) {
printf("FAIL: %s\n", strerror(ret));
std::exit(EXIT_FAILURE);
}
@@ -1440,9 +1438,6 @@ static void test_power_cycle(const struct node &node, unsigned int max_tries,
bool first_standby = true;
unsigned hpd_is_low_cnt = 0;
for (;;) {
- doioctl(&node, CEC_ADAP_G_LOG_ADDRS, &laddrs);
- if (laddrs.log_addr[0] == CEC_LOG_ADDR_INVALID)
- break;
if (!hpd_is_low)
hpd_is_low_cnt = 0;
if (wait_for_power_off(node, from, hpd_is_low_cnt))
@@ -1656,9 +1651,6 @@ static void stress_test_power_cycle(const struct node &node, unsigned cnt,
tries = 0;
unsigned hpd_is_low_cnt = 0;
for (;;) {
- doioctl(&node, CEC_ADAP_G_LOG_ADDRS, &laddrs);
- if (laddrs.log_addr[0] == CEC_LOG_ADDR_INVALID)
- break;
if (!hpd_is_low)
hpd_is_low_cnt = 0;
if (wait_for_power_off(node, from, hpd_is_low_cnt))

Privacy Policy