Patch "media: tegra-cec: reset rx_buf_cnt when start bit detected" has been added to the 4.15-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
media: tegra-cec: reset rx_buf_cnt when start bit detected
to the 4.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
media-tegra-cec-reset-rx_buf_cnt-when-start-bit-detected.patch
and it can be found in the queue-4.15 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
e113d65ae417ae6d9be229649b81d404c47ade79Mon Sep 17 00:00:00 2001
From: Hans Verkuil <[email protected]>
Date: Wed, 28 Feb 2018 05:47:07 -0500
Subject: media: tegra-cec: reset rx_buf_cnt when start bit detected
From: Hans Verkuil <[email protected]>
commit e113d65ae417ae6d9be229649b81d404c47ade79 upstream.
If a start bit is detected, then reset the receive buffer counter to 0.
This ensures that no stale data is in the buffer if a message is broken off midstream due to e.g. a Low Drive condition and then retransmitted.
The only Rx interrupts we need to listen to are RX_REGISTER_FULL (i.e. a valid byte was received) and RX_START_BIT_DETECTED (i.e. a new message starts and we need to reset the counter).
--- drivers/media/platform/tegra-cec/tegra_cec.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
drivers/media/platform/tegra-cec/tegra_cec.c +7 -10
@@ -172,16 +172,13 @@ static irqreturn_t tegra_cec_irq_handler } } -if (status & (TEGRA_CEC_INT_STAT_RX_REGISTER_OVERRUN | -TEGRA_CEC_INT_STAT_RX_BUS_ANOMALY_DETECTED | -TEGRA_CEC_INT_STAT_RX_START_BIT_DETECTED | -TEGRA_CEC_INT_STAT_RX_BUS_ERROR_DETECTED )) { +if (status &TEGRA_CEC_INT_STAT_RX_START_BIT_DETECTED ) {cec_write (cec,TEGRA_CEC_INT_STAT , - (TEGRA_CEC_INT_STAT_RX_REGISTER_OVERRUN | -TEGRA_CEC_INT_STAT_RX_BUS_ANOMALY_DETECTED | -TEGRA_CEC_INT_STAT_RX_START_BIT_DETECTED | -TEGRA_CEC_INT_STAT_RX_BUS_ERROR_DETECTED )); - }else if (status &TEGRA_CEC_INT_STAT_RX_REGISTER_FULL ) { +TEGRA_CEC_INT_STAT_RX_START_BIT_DETECTED ); + cec->rx_done = false; + cec->rx_buf_cnt =0 ; + } +if (status &TEGRA_CEC_INT_STAT_RX_REGISTER_FULL ) {u32 v; cec_write(cec, TEGRA_CEC_INT_STAT,
@@ -255,7 +252,7 @@ static int tegra_cec_adap_enable(structTEGRA_CEC_INT_MASK_TX_BUS_ANOMALY_DETECTED |TEGRA_CEC_INT_MASK_TX_FRAME_TRANSMITTED |TEGRA_CEC_INT_MASK_RX_REGISTER_FULL | - TEGRA_CEC_INT_MASK_RX_REGISTER_OVERRUN); + TEGRA_CEC_INT_MASK_RX_START_BIT_DETECTED);cec_write (cec,TEGRA_CEC_HW_CONTROL ,TEGRA_CEC_HWCTRL_TX_RX_MODE );return 0 ;
Patches currently in stable-queue which might be from [email protected] are
queue-4.15/media-tegra-cec-reset-rx_buf_cnt-when-start-bit-detected.patch