TDA4VM: Kernel panic in j721e-csi2rx driver during continuous camera streaming

Part Number: TDA4VM

Hello,

I am developiung ADAS sw using TDA4VM SK board. I am facing kernal panic issue and need your help in resolving.

Board: TDA4VM / J721E SK EVM
Kernel: 6.12.17-ti-00773-gcdcaeac783e3-dirty (SRCREV cdcaeac783e31f18edb6cb44b526228f44023b45, tag 11.00.10)
Camera: e-con NeduCAM57 (OX05B1S sensor), on /dev/video19, CSI receiver 4510000.ticsi2rx
 
Summary :
 
During continuous camera capture, the board crashes with a kernel panic. It happens anywhere from ~16 seconds to ~29 minutes after streaming starts. We are capturing video with OpenCV (cv::VideoCapture, CAP_V4L2 backend), format pinned to 1920x1080 UYVY.
 
Crash log (from serial console):
 
[ 3637.786959] j721e-csi2rx 4510000.ticsi2rx: Failed to queue the next buffer for DMA
[ 3637.868214] j721e-csi2rx 4510000.ticsi2rx: Failed to queue the next buffer for DMA
[ 3637.911614] WARNING: CPU: 0 PID: 0 at drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c:820 ti_csi2rx_dma_callback+0xe0/0xe8 [j721e_csi2rx]
[ 3638.198417] WARNING: CPU: 0 PID: 0 at drivers/media/common/videobuf2/videobuf2-core.c:1187 vb2_buffer_done+0x1f8/0x240 [videobuf2_common]
...lr : ti_csi2rx_dma_callback+0x68/0xe8 [j721e_csi2rx]
[ 3638.498655] WARNING: CPU: 0 PID: 0 at drivers/media/common/videobuf2/videobuf2-core.c:1187 vb2_buffer_done+0x1f8/0x240 [videobuf2_common]
...lr : ti_csi2rx_dma_submit_pending+0xac/0xf8 [j721e_csi2rx]
[ 3639.044188] Unable to handle kernel paging request at virtual address dead000000000122
[ 3639.070064]   FSC = 0x04: level 0 translation fault
[ 3639.083260]   ISV = 0, ISS = 0x00000044 ... WnR = 1
[ 3639.100702] Internal error: Oops: 0000000096000044 [#1] PREEMPT SMP
[ 3639.203204] pc : ti_csi2rx_dma_submit_pending+0x50/0xf8 [j721e_csi2rx]
Call trace:
 ti_csi2rx_dma_submit_pending+0x50/0xf8 [j721e_csi2rx]
 ti_csi2rx_dma_callback+0x8c/0xe8 [j721e_csi2rx]
 udma_vchan_complete+0x20c/0x258
 tasklet_action_common+0xf8/0x11c
[ 3639.353151] Kernel panic - not syncing: Oops: Fatal exception in interrupt
 
Why we think this is a buffer-handling bug
 
The address dead000000000122 is Linux’s own marker for a list entry that was already removed (list_del()). The crash happens when the driver writes to that marker, inside the DMA completion path (ti_csi2rx_dma_callback → ti_csi2rx_dma_submit_pending, called from udma_vchan_complete). This suggests a video buffer is being completed or re-queued for DMA more than once, or after it has already been removed from the driver’s buffer list.
 
What we checked and ruled out before posting:
 
Not thermal — added active cooling, crash timing did not change, all zones stayed well below the critical limit
Not power — the one PMIC undervoltage event we saw is on the SD-card rail (vdd_sd_dv), a one-time boot event, confirmed unrelated
Not memory exhaustion — tracked CMA/cache closely; a separate cache-growth trend (from video recording) is reclaimable and plateaus safely on its own
Not our application code — same crash happens whether we are recording to disk or not, and the fault is entirely inside the kernel’s V4L2/DMA interrupt path
 
Driver info:
j721e_csi2rx
intree:  Y
author:  Jai Luthra <j-luthra@ti.com>
 
Question: Has this been seen before? Is there a known fix for the buffer-completion handling in ti_csi2rx_dma_callback/ti_csi2rx_dma_submit_pending?
We can share the full serial log if useful.
  • Hello,

    I am developing ADAS software on a TDA4VM SK board and need help resolving a kernel panic during continuous camera capture.
    Board: TDA4VM / J721E SK EVM
    Kernel: 6.12.17-ti-00773-gcdcaeac783e3-dirty (SRCREV cdcaeac783e31f18edb6cb44b526228f44023b45, tag 11.00.10)
    Camera: e-con NeduCAM57 (OX05B1S sensor), /dev/video19, CSI receiver 4510000.ticsi2rx
    Original issue — kernel panic, now fixed on our side
    During continuous capture (OpenCV, CAP_V4L2, 1920x1080 UYVY), the board panicked 16 seconds to 29 minutes after streaming started:
    [ 3637.786959] j721e-csi2rx 4510000.ticsi2rx: Failed to queue the next buffer for DMA
    [ 3637.911614] WARNING: ... ti_csi2rx_dma_callback+0xe0/0xe8 [j721e_csi2rx]
    [ 3639.044188] Unable to handle kernel paging request at virtual address dead000000000122
    [ 3639.353151] Kernel panic - not syncing: Oops: Fatal exception in interrupt
    dead000000000122 is Linux’s list-poison marker. We applied list_del(&buf->list) before vb2_buffer_done(..., VB2_BUF_STATE_ERROR) in ti_csi2rx_dma_submit_pending() (matches upstream commit ae42c6fe5314). No panic since.
    Remaining issue — underlying DMA failure, now narrowed to a specific allocator call
    The panic is fixed, but the DMA failure that used to trigger it still happens. We added temporary diagnostic logging and traced it down through three rounds:
    First: ti_csi2rx_start_dma()/ti_csi2rx_drain_dma() both show dmaengine_prep_slave_single() returning NULL (not a submit error), on both the main frame buffer and the drain buffer, ~2 seconds apart, after 1500+ good frames.
    Confirmed the channel is TR mode (pkt_mode=0, per PSIL_CSI2RX’s endpoint config), so the real allocator is udma_alloc_tr_desc().
    Instrumented that function directly (in k3-udma-common.c, built into the kernel — CONFIG_TI_K3_UDMA=y) and isolated the exact failure:
    [ 227.157838] ti-udma 31150000.dma-controller: UDMA TR HW alloc failed: chan=4 bytes=192 pool=0 tr_size=32 count=1
    [ 227.168006] ti-udma 31150000.dma-controller: UDMA prep failed: chan=4 pkt_mode=0 dir=2 sglen=1
    pool=0 means this went through dma_alloc_coherent(), not dma_pool_zalloc(). The failing allocation is only 192 bytes — the CPPI5 descriptor itself, not the frame data.
    Ruled out:
    Thermal (active cooling, no change in timing)
    Power (one PMIC undervoltage trap, confirmed on the SD-card rail, unrelated one-time boot event)
    Memory/CMA exhaustion (CmaFree 96%+ free, MemAvailable ~1.87GB at time of failure)
    IOMMU: confirmed 31150000.dma-controller has no iommu_group link — not SMMU-managed
    Our application code (same failure with or without local recording; fault is entirely inside the kernel DMA/interrupt path)
    Kernel also preallocates a 512 KiB atomic coherent-allocation pool per zone at boot (DMA: preallocated 512 KiB ... pool for atomic allocations), confirmed via /sys/kernel/debug/dma_pools/pool_size_*, but we have no live usage counter to confirm whether this specific pool is exhausted/fragmented at the failure instant — that’s as far as we could narrow it from the application/driver side.
    Questions:
    For this device/controller, does dma_alloc_coherent() for a 192-byte GFP_NOWAIT request go through the atomic pool, a per-device reserved memory region, or plain page allocation? Is there a known failure mode here after sustained use?
    Is there a safe recovery/reset path for a UDMA channel stuck in this state, callable from driver context?
    Happy to share full serial logs and our diagnostic patches if useful.
    Thanks,
    Neha Gupta
  • This is what im seeing as failure. How to fix this?