aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2021-08-11 13:36:54 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2021-09-09 10:07:15 +0200
commitd21a908c05190aaaf0443446c41e15acc48d4af2 (patch)
tree35697e1b1e61e7867bede0eb07324bafb1374de5
parent7d2a07b769330c34b4deabeed939325c77a7ec2f (diff)
cec-pin: fix off-by-one SFT check
The CEC pin framework has to wait for the CEC bus to be idle for the requested Signal Free Time before it can start a transmit. However, the check for that was off by one, so transmits would start one bit period (2.4ms) too late. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
-rw-r--r--drivers/media/cec/core/cec-pin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/cec/core/cec-pin.c b/drivers/media/cec/core/cec-pin.c
index f006bd8eec63..195576a53c82 100644
--- a/drivers/media/cec/core/cec-pin.c
+++ b/drivers/media/cec/core/cec-pin.c
@@ -957,7 +957,7 @@ static enum hrtimer_restart cec_pin_timer(struct hrtimer *timer)
* so we can kick off the pending transmit.
*/
delta = ktime_us_delta(ts, pin->ts);
- if (delta / CEC_TIM_DATA_BIT_TOTAL >
+ if (delta / CEC_TIM_DATA_BIT_TOTAL >=
pin->tx_signal_free_time) {
pin->tx_nacked = false;
if (tx_custom_start(pin))
@@ -968,7 +968,7 @@ static enum hrtimer_restart cec_pin_timer(struct hrtimer *timer)
cec_pin_low(pin);
break;
}
- if (delta / CEC_TIM_DATA_BIT_TOTAL >
+ if (delta / CEC_TIM_DATA_BIT_TOTAL >=
pin->tx_signal_free_time - 1)
pin->state = CEC_ST_TX_WAIT;
break;

Privacy Policy