From: Hans Verkuil Date: Wed, 14 Nov 2018 08:37:53 +0000 (-0500) Subject: media: cec-pin: fix broken tx_ignore_nack_until_eom error injection X-Git-Tag: v4.19.14~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f8cff22960b4b41e8aac2063f931c10d44fdc6c;p=platform%2Fkernel%2Flinux-rpi.git media: cec-pin: fix broken tx_ignore_nack_until_eom error injection commit ac791f19a273a7fe254a7596f193af6534582a9f upstream. If the tx_ignore_nack_until_eom error injection was activated, then tx_nacked was never set instead of setting it when the last byte of the message was transmitted. As a result the transmit was marked as OK, when it should have been NACKed. Modify the condition so that it always sets tx_nacked when the last byte of the message was transmitted. Signed-off-by: Hans Verkuil Cc: # for v4.17 and up Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/media/cec/cec-pin.c b/drivers/media/cec/cec-pin.c index 6e31142..0496d93 100644 --- a/drivers/media/cec/cec-pin.c +++ b/drivers/media/cec/cec-pin.c @@ -601,8 +601,9 @@ static void cec_pin_tx_states(struct cec_pin *pin, ktime_t ts) break; /* Was the message ACKed? */ ack = cec_msg_is_broadcast(&pin->tx_msg) ? v : !v; - if (!ack && !pin->tx_ignore_nack_until_eom && - pin->tx_bit / 10 < pin->tx_msg.len && !pin->tx_post_eom) { + if (!ack && (!pin->tx_ignore_nack_until_eom || + pin->tx_bit / 10 == pin->tx_msg.len - 1) && + !pin->tx_post_eom) { /* * Note: the CEC spec is ambiguous regarding * what action to take when a NACK appears