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/+/3463848
Tested-by: Jerry Chang <jerchang@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Jerry Chang <jerchang@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
This commit is contained in:
Ankur Pawar
2025-10-02 16:26:12 +00:00
committed by mobile promotions
parent 76bdc9f5b6
commit 9ee2b01686

View File

@@ -617,10 +617,14 @@ static void vi5_capture_dequeue(struct tegra_channel *chan,
uncorr_err:
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;
spin_unlock_irqrestore(&chan->capture_state_lock, flags);
buf->vb2_state = VB2_BUF_STATE_ERROR;
}
spin_unlock_irqrestore(&chan->capture_state_lock, flags);
rel_buf:
vi5_release_buffer(chan, buf);
@@ -683,6 +687,9 @@ static int vi5_channel_error_recover(struct tegra_channel *chan,
buf = dequeue_dequeue_buffer(chan);
if (!buf)
break;
if (chan->capture_state == CAPTURE_TIMEOUT)
buf->vb2_state = VB2_BUF_STATE_QUEUED;
else
buf->vb2_state = VB2_BUF_STATE_ERROR;
vi5_capture_dequeue(chan, buf);
}