Part Number: AM62A7-Q1
Tool/software:
Hi,
We are now using a deserializer (MAX96724) with two cameras attached to send csi2 data with two streams.
These two camera do work and show image with gstreamer.
However, the kernel may crash randomly. (sometimes the streams can last for more than 6 hours, sometimes it crashes at boot)
root@am62axx-evm:~# [ 2817.381902] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: ti_csi2rx_start_dma+0x104/0x10c [j721e_csi2rx] [ 2817.393903] CPU: 0 PID: 6184 Comm: sh Tainted: G O 6.6.44-ti-01478-g541c20281af7-dirty #1 [ 2817.403460] Hardware name: Texas Instruments AM62A7 SK (DT) [ 2817.409023] Call trace: [ 2817.411463] dump_backtrace+0x90/0xe8 [ 2817.415131] show_stack+0x18/0x24 [ 2817.418445] dump_stack_lvl+0x48/0x60 [ 2817.422110] dump_stack+0x18/0x24 [ 2817.425424] panic+0x324/0x380 [ 2817.428481] __ktime_get_real_seconds+0x0/0xc [ 2817.432838] ti_csi2rx_start_dma+0x104/0x10c [j721e_csi2rx] [ 2817.438417] ti_csi2rx_dma_submit_pending+0x7c/0xe8 [j721e_csi2rx] [ 2817.444602] ti_csi2rx_dma_callback+0x8c/0xd0 [j721e_csi2rx] [ 2817.450263] udma_vchan_complete+0x218/0x2bc [ 2817.454536] tasklet_action_common.isra.0+0xf8/0x11c [ 2817.459497] tasklet_action+0x24/0x30 [ 2817.463155] handle_softirqs+0x108/0x24c [ 2817.467076] __do_softirq+0x14/0x20 [ 2817.470560] ____do_softirq+0x10/0x1c [ 2817.474220] call_on_irq_stack+0x24/0x4c [ 2817.478139] do_softirq_own_stack+0x1c/0x2c [ 2817.482312] irq_exit_rcu+0xc0/0xdc [ 2817.485790] el1_interrupt+0x38/0x68 [ 2817.489359] el1h_64_irq_handler+0x18/0x24 [ 2817.493446] el1h_64_irq+0x64/0x68 [ 2817.496839] account_kernel_stack.isra.0+0x40/0x60 [ 2817.501619] exit_task_stack_account+0x20/0x58 [ 2817.506053] do_exit+0x55c/0x8c4 [ 2817.509276] do_group_exit+0x34/0x90 [ 2817.512842] __wake_up_parent+0x0/0x30 [ 2817.516582] invoke_syscall+0x48/0x114 [ 2817.520330] el0_svc_common.constprop.0+0xc0/0xe0 [ 2817.525031] do_el0_svc+0x1c/0x28 [ 2817.528345] el0_svc+0x2c/0x84 [ 2817.531397] el0t_64_sync_handler+0x120/0x12c [ 2817.535751] el0t_64_sync+0x190/0x194 [ 2817.539407] SMP: stopping secondary CPUs [ 2818.610932] SMP: failed to stop secondary CPUs 0,3 [ 2818.615716] Kernel Offset: 0x80000 from 0xffff800080000000 [ 2818.621186] PHYS_OFFSET: 0x80000000 [ 2818.624662] CPU features: 0x0,00000008,00020000,1000420b [ 2818.629961] Memory Limit: none [ 2818.633010] ---[ end Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: ti_csi2rx_start_dma+0x104/0x10c [j721e_csi2rx] ]---
In order to meet our requirements, we modified the default format and routes in j721e-csi2rx.c and cdns-csi2rx.c:
static int _ti_csi2rx_sd_set_routing(struct v4l2_subdev *sd,
struct v4l2_subdev_state *state,
struct v4l2_subdev_krouting *routing)
{
int ret;
//20250806 Ray Edited: Default resolution, format
const struct v4l2_mbus_framefmt format = {
.width = 1920,
.height = 1280,
.code = MEDIA_BUS_FMT_UYVY8_1X16,
.field = V4L2_FIELD_NONE,
.colorspace = V4L2_COLORSPACE_SRGB,
.ycbcr_enc = V4L2_YCBCR_ENC_601,
.quantization = V4L2_QUANTIZATION_LIM_RANGE,
.xfer_func = V4L2_XFER_FUNC_SRGB,
};
ret = v4l2_subdev_routing_validate(sd, routing,
V4L2_SUBDEV_ROUTING_ONLY_1_TO_1 |
V4L2_SUBDEV_ROUTING_NO_SOURCE_MULTIPLEXING);
if (ret)
return ret;
ret = v4l2_subdev_set_routing_with_fmt(sd, state, routing, &format);
return ret;
}
static int ti_csi2rx_sd_set_routing(struct v4l2_subdev *sd,
struct v4l2_subdev_state *state,
enum v4l2_subdev_format_whence which,
struct v4l2_subdev_krouting *routing)
{
return _ti_csi2rx_sd_set_routing(sd, state, routing);
}
static int ti_csi2rx_sd_init_cfg(struct v4l2_subdev *sd,
struct v4l2_subdev_state *state)
{
struct v4l2_subdev_route routes[] = {
{
.sink_pad = 0,
.sink_stream = 0,
.source_pad = TI_CSI2RX_PAD_FIRST_SOURCE+1,
.source_stream = 0,
.flags = V4L2_SUBDEV_ROUTE_FL_ACTIVE,
},
//20250806 Ray Edited: Default routing
{
.sink_pad = 0,
.sink_stream = 1,
.source_pad = TI_CSI2RX_PAD_FIRST_SOURCE+2,
.source_stream = 0,
.flags = V4L2_SUBDEV_ROUTE_FL_ACTIVE,
},
};
struct v4l2_subdev_krouting routing = {
.num_routes = 2,
.routes = routes,
};
/* Initialize routing to single route to the fist source pad */
return _ti_csi2rx_sd_set_routing(sd, state, &routing);
}
the media-ctl -p looks like:
root@am62axx-evm:~# media-ctl -p
Media controller API version 6.6.44
Media device information
------------------------
driver j721e-csi2rx
model TI-CSI2RX
serial
bus info platform:30102000.ticsi2rx
hw revision 0x1
driver version 6.6.44
Device topology
- entity 1: 30102000.ticsi2rx (7 pads, 7 links, 2 routes)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev0
routes:
0/0 -> 2/0 [ACTIVE]
0/1 -> 3/0 [ACTIVE]
pad0: Sink
[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
[stream:1 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
<- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
pad1: Source
-> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
pad2: Source
[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
-> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
pad3: Source
[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
-> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
pad4: Source
-> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
pad5: Source
-> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
pad6: Source
-> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]
- entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 2 routes)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev1
routes:
0/0 -> 1/0 [ACTIVE]
0/1 -> 1/1 [ACTIVE]
pad0: Sink
[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
[stream:1 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
<- "max96724 4-0027":4 [ENABLED,IMMUTABLE]
pad1: Source
[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
[stream:1 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
-> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
pad2: Source
pad3: Source
pad4: Source
- entity 15: max96724 4-0027 (6 pads, 3 links, 4 routes)
type V4L2 subdev subtype Unknown flags 0
device node name /dev/v4l-subdev2
routes:
0/0 -> 4/0 [ACTIVE]
1/0 -> 4/1 [ACTIVE]
2/0 -> 5/2 [ACTIVE]
3/0 -> 5/3 [ACTIVE]
pad0: Sink
[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]
<- "auo_cms_gmsl 5-0040":0 [ENABLED,IMMUTABLE]
pad1: Sink
[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]
<- "auo_cms_gmsl 6-0040":0 [ENABLED,IMMUTABLE]
pad2: Sink
[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]
pad3: Sink
[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]
pad4: Source
[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]
[stream:1 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]
-> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
pad5: Source
[stream:2 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]
[stream:3 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb]
- entity 24: auo_cms_gmsl 5-0040 (1 pad, 1 link, 0 routes)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev3
pad0: Source
[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb
crop:(0,0)/1920x1280]
-> "max96724 4-0027":0 [ENABLED,IMMUTABLE]
- entity 28: auo_cms_gmsl 6-0040 (1 pad, 1 link, 0 routes)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev4
pad0: Source
[stream:0 fmt:UYVY8_1X16/1920x1280 field:none colorspace:srgb
crop:(0,0)/1920x1280]
-> "max96724 4-0027":1 [ENABLED,IMMUTABLE]
- entity 34: 30102000.ticsi2rx context 0 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video3
pad0: Sink
<- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
- entity 40: 30102000.ticsi2rx context 1 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video4
pad0: Sink
<- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
- entity 46: 30102000.ticsi2rx context 2 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video5
pad0: Sink
<- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
- entity 52: 30102000.ticsi2rx context 3 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video6
pad0: Sink
<- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
- entity 58: 30102000.ticsi2rx context 4 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video7
pad0: Sink
<- "30102000.ticsi2rx":5 [ENABLED,IMMUTABLE]
- entity 64: 30102000.ticsi2rx context 5 (1 pad, 1 link)
type Node subtype V4L flags 0
device node name /dev/video8
pad0: Sink
<- "30102000.ticsi2rx":6 [ENABLED,IMMUTABLE]
We've skipped the context 0 (seen someone reported issues with this context), but nothing changed.
The SDK we are using is 10_01_00 with FALCON mode
Is there anything I can do?