drm/i2c: tda9950: set MAX_RETRIES for errors only
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 27 Aug 2018 12:28:50 +0000 (14:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Nov 2018 13:51:40 +0000 (14:51 +0100)
[ Upstream commit e0dccce1193f87597548d0db6ecc942fb92c04cd ]

The CEC_TX_STATUS_MAX_RETRIES should be set for errors only to
prevent the CEC framework from retrying the transmit. If the
transmit was successful, then don't set this flag.

Found by running 'cec-compliance -A' on a beaglebone box.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/i2c/tda9950.c

index f2186409f0cfb402893abeb7a8e2726d4e9c6483..ccd355d0c123064dd5a34e8b002d738faeec4b93 100644 (file)
@@ -188,7 +188,8 @@ static irqreturn_t tda9950_irq(int irq, void *data)
                        break;
                }
                /* TDA9950 executes all retries for us */
-               tx_status |= CEC_TX_STATUS_MAX_RETRIES;
+               if (tx_status != CEC_TX_STATUS_OK)
+                       tx_status |= CEC_TX_STATUS_MAX_RETRIES;
                cec_transmit_done(priv->adap, tx_status, arb_lost_cnt,
                                  nack_cnt, 0, err_cnt);
                break;