media: cec: fix wrong tx/rx_status values when canceling a msg
When a message was canceled it could return tx_status with both OK and MAX_RETRIES set, which is illegal. If a canceled message was waiting for a reply, then rx_status wasn't updated, so set that as well. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
4ba610c8dc
commit
7367815849
|
@ -339,12 +339,19 @@ static void cec_data_cancel(struct cec_data *data)
|
||||||
data->adap->transmit_queue_sz--;
|
data->adap->transmit_queue_sz--;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Mark it as an error */
|
if (data->msg.tx_status & CEC_TX_STATUS_OK) {
|
||||||
data->msg.tx_ts = ktime_get_ns();
|
/* Mark the canceled RX as a timeout */
|
||||||
data->msg.tx_status |= CEC_TX_STATUS_ERROR |
|
data->msg.rx_ts = ktime_get_ns();
|
||||||
CEC_TX_STATUS_MAX_RETRIES;
|
data->msg.rx_status = CEC_RX_STATUS_TIMEOUT;
|
||||||
data->msg.tx_error_cnt++;
|
} else {
|
||||||
data->attempts = 0;
|
/* Mark the canceled TX as an error */
|
||||||
|
data->msg.tx_ts = ktime_get_ns();
|
||||||
|
data->msg.tx_status |= CEC_TX_STATUS_ERROR |
|
||||||
|
CEC_TX_STATUS_MAX_RETRIES;
|
||||||
|
data->msg.tx_error_cnt++;
|
||||||
|
data->attempts = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Queue transmitted message for monitoring purposes */
|
/* Queue transmitted message for monitoring purposes */
|
||||||
cec_queue_msg_monitor(data->adap, &data->msg, 1);
|
cec_queue_msg_monitor(data->adap, &data->msg, 1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue