Long-time camera preview using the gst-launch-1.0 tool may trigger system crashes when abnormal video frames appear from the camera

BSP Version: 36.4.4
Problem Description:If the system runs camera preview for an extended period without a physical camera hardware connected, abnormal display frames will trigger a kernel panic. When a valid camera module is plugged in and preview shows normal images, the system runs stably. We need to identify the root cause of this issue. Kernel crash logs are attached for reference.
log.txt (157.6 KB)

We have applied the attached patch, which resolves the previous kernel panic problem. Nevertheless, running camera preview with the gst-launch-1.0 pipeline fails to render any image output currently.
0001-capture-ivc-fix-multi-cam-race-condition.zip (1.9 KB)

Below is the output after applying the patch.

nvidia@upai-pro02:~$
nvidia@upai-pro02:~$ [ 985.597977] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 1500 ms
[ 985.598002] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel,vc: 0
[ 985.599574] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel,vc:0
[ 987.165974] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 1500 ms
[ 987.165997] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel,vc: 0
[ 987.167428] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel,vc:0
[ 988.702138] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 1500 ms
[ 988.702159] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel,vc: 0
[ 988.703303] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel,vc:0
[ 990.237960] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 1500 ms
[ 990.237980] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel,vc: 0
[ 990.239419] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel,vc:0
[ 991.774138] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 1500 ms
[ 991.774159] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel,vc: 0
[ 991.776142] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel,vc:0
[ 993.310134] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 1500 ms
[ 993.310156] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel,vc: 0
[ 993.311436] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel,vc:0

The problem has been fixed. The patch takes effect normally. The root cause was that the patch was not properly applied locally.