I’m trying to enable the Test Pattern Generator to debug some issues i’m having with a camera driver on our custom TX2 carrier board with L4T 32.4.3.
I believe I have disabled all our custom camera device-tree settings, so I guess I have a vanilla device-tree regarding the cameras.
I get a NULL pointer dereference kernel panic as soon as I start a stream using v4l2-ctl.
root@squeaky-lemur-protoa:~# modprobe nvhost-vi-tpg
[ 167.714635] nvcsi 150c0000.nvcsi: tpg_probe_t18x
[ 167.736963] tegra-vi4 15700000.vi: creating tpg-0:0 -> 15700000.vi-tpg-0:0 link
[ 167.744366] tegra_camera_device_register
[ 167.748310] driver not enabled, cannot register any devices
[ 167.766893] tegra-vi4 15700000.vi: created tpg-0:0 -> vi-output, tpg-0:0 link
[ 167.782670] tegra-vi4 15700000.vi: creating tpg-1:0 -> 15700000.vi-tpg-1:0 link
[ 167.790088] tegra_camera_device_register
[ 167.794023] driver not enabled, cannot register any devices
[ 167.812623] tegra-vi4 15700000.vi: created tpg-1:0 -> vi-output, tpg-1:0 link
[ 167.828378] tegra-vi4 15700000.vi: creating tpg-2:0 -> 15700000.vi-tpg-2:0 link
[ 167.835861] tegra_camera_device_register
[ 167.839800] driver not enabled, cannot register any devices
[ 167.858351] tegra-vi4 15700000.vi: created tpg-2:0 -> vi-output, tpg-2:0 link
[ 167.874236] tegra-vi4 15700000.vi: creating tpg-3:0 -> 15700000.vi-tpg-3:0 link
[ 167.881720] tegra_camera_device_register
[ 167.885649] driver not enabled, cannot register any devices
[ 167.904359] tegra-vi4 15700000.vi: created tpg-3:0 -> vi-output, tpg-3:0 link
[ 167.920114] tegra-vi4 15700000.vi: creating tpg-4:0 -> 15700000.vi-tpg-4:0 link
[ 167.927472] tegra_camera_device_register
[ 167.931402] driver not enabled, cannot register any devices
[ 167.950033] tegra-vi4 15700000.vi: created tpg-4:0 -> vi-output, tpg-4:0 link
[ 167.965943] tegra-vi4 15700000.vi: creating tpg-5:0 -> 15700000.vi-tpg-5:0 link
[ 167.973416] tegra_camera_device_register
[ 167.977348] driver not enabled, cannot register any devices
[ 167.996045] tegra-vi4 15700000.vi: created tpg-5:0 -> vi-output, tpg-5:0 link
root@squeaky-lemur-protoa:~# ls -l /dev/video*
crw-rw---- 1 root video 81, 0 Jan 3 22:26 /dev/video0
crw-rw---- 1 root video 81, 1 Jan 3 22:26 /dev/video1
crw-rw---- 1 root video 81, 2 Jan 3 22:26 /dev/video2
crw-rw---- 1 root video 81, 3 Jan 3 22:26 /dev/video3
crw-rw---- 1 root video 81, 4 Jan 3 22:26 /dev/video4
crw-rw---- 1 root video 81, 5 Jan 3 22:26 /dev/video5
root@squeaky-lemur-protoa:~# v4l2-ctl --list-formats-ext -d /dev/video1
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'RG10' (10-bit Bayer RGRG/GBGB)
Size: Discrete 1280x720
Interval: Discrete 0.008s (120.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.017s (60.000 fps)
Size: Discrete 3840x2160
Interval: Discrete 0.050s (20.000 fps)
root@squeaky-lemur-protoa:~# v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat="RG10" --device=/dev/video1 --stream-count=10 --stream-mmap --stream-to=tpg.raw
[ 188.581501] Unable to handle kernel NULL pointer dereference at virtual address 000000a0
[ 188.589635] Mem abort info:
[ 188.592465] ESR = 0x96000006
[ 188.595541] Exception class = DABT (current EL), IL = 32 bits
[ 188.601469] SET = 0, FnV = 0
[ 188.604540] EA = 0, S1PTW = 0
[ 188.607698] Data abort info:
[ 188.610591] ISV = 0, ISS = 0x00000006
[ 188.614476] CM = 0, WnR = 0
[ 188.617442] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc1ea4d4000
[ 188.624015] [00000000000000a0] *pgd=0000000265855003, *pud=0000000265855003, *pmd=0000000000000000
[ 188.633022] Internal error: Oops: 96000006 [#1] PREEMPT SMP
[ 188.638587] Modules linked in: nvhost_vi_tpg mtdblock mtd_blkdevs m25p80
[ 188.645421] CPU: 0 PID: 748 Comm: vi-output, tpg- Not tainted 4.9.140 #1
[ 188.652144] Hardware name: quill (DT)
[ 188.655833] task: ffffffc1e5226200 task.stack: ffffffc1e759c000
[ 188.661790] PC is at tegra_camera_update_clknbw+0x28/0x2a8
[ 188.667305] LR is at tegra_channel_set_stream+0x1d4/0x4f0
[ 188.672727] pc : [<ffffff8008475d70>] lr : [<ffffff8008892344>] pstate: 60000045
[ 188.680141] sp : ffffffc1e759fcb0
[ 188.683473] x29: ffffffc1e759fcb0 x28: ffffffc1ea45f018
[ 188.688845] x27: ffffffc1e7426608 x26: ffffff8009523000
[ 188.694217] x25: 0000000000000002 x24: 0000000000000001
[ 188.699584] x23: ffffffc1ea45f018 x22: 0000000000000000
[ 188.704948] x21: ffffff80096e5870 x20: 0000000000000000
[ 188.710313] x19: ffffffc1ea45f018 x18: 000000000028dee3
[ 188.715678] x17: 0000007f9f8593e0 x16: 00000000002eeb69
[ 188.721042] x15: 00000000017751f1 x14: 00000000017751f1
[ 188.726409] x13: 000000000000017e x12: 071c71c71c71c71c
[ 188.731774] x11: 000000000000000b x10: 0000000000000880
[ 188.737137] x9 : ffffffc1e759fd70 x8 : ffffffc1e5226ae0
[ 188.742501] x7 : fefefeff646c606d x6 : 0000000030314752
[ 188.747864] x5 : 00000000000100f4 x4 : 00000000000100f8
[ 188.753225] x3 : ffffff800cb100f0 x2 : 0000000000010100
[ 188.758587] x1 : 0000000000000001 x0 : 0000000000000000
[ 188.763948]
[ 188.765463] Process vi-output, tpg- (pid: 748, stack limit = 0xffffffc1e759c000)
[ 188.772876] Call trace:
[ 188.775357] [<ffffff8008475d70>] tegra_camera_update_clknbw+0x28/0x2a8
[ 188.781912] [<ffffff8008892344>] tegra_channel_set_stream+0x1d4/0x4f0
[ 188.788384] [<ffffff8008898aec>] tegra_channel_kthread_capture_start+0x4fc/0x568
[ 188.795807] [<ffffff80080cc384>] kthread+0xec/0xf0
[ 188.800628] [<ffffff80080834d0>] ret_from_fork+0x10/0x40
[ 188.805965] ---[ end trace 587d3193f14d79df ]---