Camera: fix kernel warning after VI timeout

VI return timeout status when no frames are
received from camera sensor. During the error
recovery, the v4l2 buffers are set to
VB2_BUF_STATE_ERROR, this causes kernel warning.
As per the v4l2 framework correct buffer state
for timeout is VB2_BUF_STATE_QUEUED.

Bug 5512645

Change-Id: Iafc720b1ba74f04490d7d14e2e9014bd599b3cba
Signed-off-by: Ankur Pawar <ankurp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3462547
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Ankur Pawar
2025-10-02 16:26:12 +00:00
committed by mobile promotions
parent d6685995db
commit 1d659b240c

View File

@@ -594,10 +594,14 @@ static void vi5_capture_dequeue(struct tegra_channel *chan,
uncorr_err: uncorr_err:
spin_lock_irqsave(&chan->capture_state_lock, flags); spin_lock_irqsave(&chan->capture_state_lock, flags);
if (err == -ETIMEDOUT) {
chan->capture_state = CAPTURE_TIMEOUT;
buf->vb2_state = VB2_BUF_STATE_QUEUED;
} else {
chan->capture_state = CAPTURE_ERROR; chan->capture_state = CAPTURE_ERROR;
spin_unlock_irqrestore(&chan->capture_state_lock, flags);
buf->vb2_state = VB2_BUF_STATE_ERROR; buf->vb2_state = VB2_BUF_STATE_ERROR;
}
spin_unlock_irqrestore(&chan->capture_state_lock, flags);
rel_buf: rel_buf:
vi5_release_buffer(chan, buf); vi5_release_buffer(chan, buf);
@@ -659,6 +663,9 @@ static int vi5_channel_error_recover(struct tegra_channel *chan,
buf = dequeue_dequeue_buffer(chan); buf = dequeue_dequeue_buffer(chan);
if (!buf) if (!buf)
break; break;
if (chan->capture_state == CAPTURE_TIMEOUT)
buf->vb2_state = VB2_BUF_STATE_QUEUED;
else
buf->vb2_state = VB2_BUF_STATE_ERROR; buf->vb2_state = VB2_BUF_STATE_ERROR;
vi5_capture_dequeue(chan, buf); vi5_capture_dequeue(chan, buf);
} }