Message ID | 1540481375-15952-1-git-send-email-stefan.wahren@i2se.com (mailing list archive) |
---|---|
Headers | show |
Series | staging: vc04_services: Improve driver load/unload | expand |
Hi Stefan, On Thu, 2018-10-25 at 17:29 +0200, Stefan Wahren wrote: > This patch series improves the load/unload of bcm2835 camera and > audio > drivers. It has been tested with Raspberry Pi 3 B and a camera module > V1. > > This series based on current linux-next and Phil Elwell's series > ("Improve VCHIQ > cache line size handling"). After Nicolas' series ("staging: > vc04_services: > Some dead code removal") has been applied, i will rebase my series. > > Stefan Wahren (11): > staging: bcm2835-camera: Abort probe if there is no camera > staging: bcm2835-camera: fix module autoloading > staging: bcm2835-camera: Move module info to the end > staging: vchiq_arm: Fix platform device unregistration > staging: vchiq_arm: Fix camera device registration > staging: vchiq_arm: Register a platform device for audio > staging: bcm2835-audio: Enable compile test > staging: bcm2835-audio: use module_platform_driver() macro > staging: bcm2835-audio: Drop DT dependency > staging: bcm2835-camera: Provide more specific probe error messages > staging: bcm2835-camera: Add hint about possible faulty config > > .../staging/vc04_services/bcm2835-audio/Kconfig | 2 +- > .../staging/vc04_services/bcm2835-audio/bcm2835.c | 61 ++++++---- > ------- > .../vc04_services/bcm2835-camera/bcm2835-camera.c | 78 > +++++++++++++++------- > .../vc04_services/bcm2835-camera/mmal-vchiq.c | 5 +- > .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 27 ++++++-- > 5 files changed, 102 insertions(+), 71 deletions(-) > I prefer Dan's approach to error checking in vchiq_probe(). Apart from that seems good to me. Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Regards, Nicolas
Hi Nicolas, > Nicolas Saenz Julienne <nsaenzjulienne@suse.de> hat am 26. Oktober 2018 um 13:06 geschrieben: > > > Hi Stefan, > > On Thu, 2018-10-25 at 17:29 +0200, Stefan Wahren wrote: > > This patch series improves the load/unload of bcm2835 camera and > > audio > > drivers. It has been tested with Raspberry Pi 3 B and a camera module > > V1. > > > > This series based on current linux-next and Phil Elwell's series > > ("Improve VCHIQ > > cache line size handling"). After Nicolas' series ("staging: > > vc04_services: > > Some dead code removal") has been applied, i will rebase my series. > > > > Stefan Wahren (11): > > staging: bcm2835-camera: Abort probe if there is no camera > > staging: bcm2835-camera: fix module autoloading > > staging: bcm2835-camera: Move module info to the end > > staging: vchiq_arm: Fix platform device unregistration > > staging: vchiq_arm: Fix camera device registration > > staging: vchiq_arm: Register a platform device for audio > > staging: bcm2835-audio: Enable compile test > > staging: bcm2835-audio: use module_platform_driver() macro > > staging: bcm2835-audio: Drop DT dependency > > staging: bcm2835-camera: Provide more specific probe error messages > > staging: bcm2835-camera: Add hint about possible faulty config > > > > .../staging/vc04_services/bcm2835-audio/Kconfig | 2 +- > > .../staging/vc04_services/bcm2835-audio/bcm2835.c | 61 ++++++---- > > ------- > > .../vc04_services/bcm2835-camera/bcm2835-camera.c | 78 > > +++++++++++++++------- > > .../vc04_services/bcm2835-camera/mmal-vchiq.c | 5 +- > > .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 27 ++++++-- > > 5 files changed, 102 insertions(+), 71 deletions(-) > > > > I prefer Dan's approach to error checking in vchiq_probe(). Apart from > that seems good to me. > > Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> unfortunately there is a issue with this series, after enabling the memleak detector i'm getting this: unreferenced object 0xec9c9300 (size 64): comm "systemd-udevd", pid 182, jiffies 4294937996 (age 1376.140s) hex dump (first 32 bytes): ff ff ff ff 00 00 00 00 2f 70 6c 61 74 66 6f 72 ......../platfor 6d 2f 73 6f 63 2f 33 66 30 30 62 38 34 30 2e 6d m/soc/3f00b840.m backtrace: [<9d7676d1>] vchiq_register_child+0x58/0x74 [vchiq] [<6a2780cc>] vchiq_probe+0x1c0/0x264 [vchiq] [<278d830e>] platform_drv_probe+0x48/0x98 [<c9846b79>] really_probe+0x228/0x2d0 [<489d6b89>] driver_probe_device+0x60/0x164 [<ccf84a43>] __driver_attach+0xd0/0xd4 [<042acada>] bus_for_each_dev+0x74/0xb4 [<b04ae13a>] bus_add_driver+0x18c/0x210 [<a66d3fa5>] driver_register+0x7c/0x114 [<a7353eeb>] do_one_initcall+0x54/0x1fc [<9420261f>] do_init_module+0x64/0x1f4 [<571c859a>] load_module+0x1dfc/0x24bc [<06885682>] sys_finit_module+0xac/0xd8 [<85e18c3d>] __sys_trace_return+0x0/0x20 [<0051c54d>] 0xbecb0898 [<0a0ced8e>] 0xffffffff > > Regards, > Nicolas > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi Stefan, > This patch series improves the load/unload of bcm2835 camera and audio > drivers. It has been tested with Raspberry Pi 3 B and a camera module V1. > > This series based on current linux-next and Phil Elwell's series ("Improve VCHIQ > cache line size handling"). After Nicolas' series ("staging: vc04_services: > Some dead code removal") has been applied, i will rebase my series. I tried testing this series applied to 4.20 with the camera module. I tried with qv4l2 (from v4l-utils) and using cheese, which in turn uses gstreamer. I basically get the same crash for both options. Desktop is LXDE on 32 bit Fedora 29. I've not yet tried with 5.0-rc1 but it looks like it has this patch series and some other bits for the vchiq drivers in staging. Peter [ 231.121704] bcm2835-v4l2: Failed enabling camera, ret -2 [ 231.127168] bcm2835-v4l2: Failed to enable camera [ 231.132030] ------------[ cut here ]------------ [ 231.136852] WARNING: CPU: 2 PID: 1473 at drivers/media/common/videobuf2/videobuf2-core.c:1468 vb2_start_streaming+0xb4/0x12c [videobuf2_common] [ 231.149967] Modules linked in: fuse ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat ip6table_nat nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat_ipv4 nf_nat iptable_mangle iptable_raw iptable_security nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip_set nfnetlink ebtable_filter ebtables ip6table_filter ip6_tables cmac bnep sunrpc vfat fat brcmfmac brcmutil vc4 cfg80211 snd_soc_core bcm2835_v4l2(C) ac97_bus snd_bcm2835(C) videobuf2_vmalloc snd_pcm_dmaengine videobuf2_memops snd_seq videobuf2_v4l2 videobuf2_common snd_seq_device v4l2_common snd_pcm videodev media snd_timer snd soundcore drm_kms_helper drm hci_uart btqca joydev btbcm btintel fb_sys_fops syscopyarea bluetooth sysfillrect gpio_raspberrypi_exp sysimgblt raspberrypi_hwmon bcm2835_thermal ecdh_generic vchiq(C) rfkill bcm2835_wdt bcm2835_rng leds_gpio cpufreq_dt lz4 lz4_compress zram hid_logitech_hidpp hid_logitech_dj smsc95xx usbnet mii mmc_block dwc2 sdhci_iproc crc32_arm_ce [ 231.150208] sdhci_pltfm udc_core sdhci bcm2835 pwm_bcm2835 i2c_bcm2835 bcm2835_dma phy_generic [ 231.248013] CPU: 2 PID: 1473 Comm: qv4l2 Tainted: G C 4.20.0-1.fc30.armv7hl #1 [ 231.256663] Hardware name: BCM2835 [ 231.260144] [<c03127a4>] (unwind_backtrace) from [<c030cbf0>] (show_stack+0x18/0x1c) [ 231.268013] [<c030cbf0>] (show_stack) from [<c0b14340>] (dump_stack+0x80/0xa0) [ 231.275357] [<c0b14340>] (dump_stack) from [<c03507b4>] (__warn+0xdc/0xf8) [ 231.282349] [<c03507b4>] (__warn) from [<c0350b28>] (warn_slowpath_null+0x40/0x4c) [ 231.290067] [<c0350b28>] (warn_slowpath_null) from [<bf4d82d4>] (vb2_start_streaming+0xb4/0x12c [videobuf2_common]) [ 231.300747] [<bf4d82d4>] (vb2_start_streaming [videobuf2_common]) from [<bf4d978c>] (vb2_core_streamon+0x110/0x138 [videobuf2_common]) [ 231.313166] [<bf4d978c>] (vb2_core_streamon [videobuf2_common]) from [<bf44ea34>] (__video_do_ioctl+0x35c/0x494 [videodev]) [ 231.324681] [<bf44ea34>] (__video_do_ioctl [videodev]) from [<bf44f19c>] (video_usercopy+0x508/0x5d4 [videodev]) [ 231.335120] [<bf44f19c>] (video_usercopy [videodev]) from [<c04ffae0>] (vfs_ioctl+0x28/0x3c) [ 231.343697] [<c04ffae0>] (vfs_ioctl) from [<c0500300>] (do_vfs_ioctl+0x8c/0x838) [ 231.351212] [<c0500300>] (do_vfs_ioctl) from [<c0500b04>] (ksys_ioctl+0x58/0x74) [ 231.358726] [<c0500b04>] (ksys_ioctl) from [<c0301000>] (ret_fast_syscall+0x0/0x54) [ 231.366493] Exception stack(0xd7d53fa8 to 0xd7d53ff0) [ 231.371623] 3fa0: 4a1bf700 b5edd000 0000000c 40045612 be905378 00000001 [ 231.379930] 3fc0: 4a1bf700 b5edd000 40045612 00000036 b5e40e40 0000000c b6f00508 00000000 [ 231.388230] 3fe0: be905378 be905368 b5ec6804 b5b9a1f0 [ 231.393434] ---[ end trace c5943cec7bb25669 ]--- [ 237.695591] list_add corruption. prev->next should be next (ea4493e0), but was efeb6638. (prev=e126fa78). [ 237.705362] ------------[ cut here ]------------ [ 237.710056] kernel BUG at lib/list_debug.c:28! [ 237.714569] Internal error: Oops - BUG: 0 [#1] SMP ARM [ 237.719785] Modules linked in: fuse ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat ip6table_nat nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat_ipv4 nf_nat iptable_mangle iptable_raw iptable_security nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip_set nfnetlink ebtable_filter ebtables ip6table_filter ip6_tables cmac bnep sunrpc vfat fat brcmfmac brcmutil vc4 cfg80211 snd_soc_core bcm2835_v4l2(C) ac97_bus snd_bcm2835(C) videobuf2_vmalloc snd_pcm_dmaengine videobuf2_memops snd_seq videobuf2_v4l2 videobuf2_common snd_seq_device v4l2_common snd_pcm videodev media snd_timer snd soundcore drm_kms_helper drm hci_uart btqca joydev btbcm btintel fb_sys_fops syscopyarea bluetooth sysfillrect gpio_raspberrypi_exp sysimgblt raspberrypi_hwmon bcm2835_thermal ecdh_generic vchiq(C) rfkill bcm2835_wdt bcm2835_rng leds_gpio cpufreq_dt lz4 lz4_compress zram hid_logitech_hidpp hid_logitech_dj smsc95xx usbnet mii mmc_block dwc2 sdhci_iproc crc32_arm_ce [ 237.720008] sdhci_pltfm udc_core sdhci bcm2835 pwm_bcm2835 i2c_bcm2835 bcm2835_dma phy_generic [ 237.817717] CPU: 1 PID: 1473 Comm: qv4l2 Tainted: G WC 4.20.0-1.fc30.armv7hl #1 [ 237.826365] Hardware name: BCM2835 [ 237.829831] PC is at __list_add_valid+0x44/0x84 [ 237.834426] LR is at __list_add_valid+0x44/0x84 [ 237.839020] pc : [<c069b958>] lr : [<c069b958>] psr: 600f0093 [ 237.845377] sp : d7d53da0 ip : 00000000 fp : 00000001 [ 237.850676] r10: 600f0013 r9 : ea4493e0 r8 : ea4493e8 [ 237.855979] r7 : eb773000 r6 : eb773278 r5 : e126fa78 r4 : ea449358 [ 237.862602] r3 : ef707cb0 r2 : 2e5c6000 r1 : ef704548 r0 : 0000005d [ 237.869226] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none [ 237.876555] Control: 10c5383d Table: 17d0406a DAC: 00000051 [ 237.882390] Process qv4l2 (pid: 1473, stack limit = 0xdf044251) [ 237.888394] Stack: (0xd7d53da0 to 0xd7d54000) [ 237.892823] 3da0: ea449358 bf55f20c ea31f800 eb773000 ea31fe24 bf44aa08 ea31fb80 d7d53e78 [ 237.901130] 3dc0: bf467200 bf55a22c eb773000 00000000 00000001 ea31fd28 eb773000 bf4d8278 [ 237.909435] 3de0: ea31fd28 00000000 ea31f858 bf44aa08 ea31fb80 bf4d978c 40045612 bf44ea34 [ 237.917738] 3e00: d7d53e2c c04babd4 ef8eb210 bf5601f4 ecf68f00 00000000 d7c51900 ecf68f00 [ 237.926042] 3e20: c124f850 00000004 d7d53e7c c04c0b88 d7d53e78 c031691c d7d53e78 00000000 [ 237.934345] 3e40: d7d53e78 00000000 bf44e6d8 40045612 00000000 00000004 00000000 bf44f19c [ 237.942648] 3e60: 0007ffff 00000000 00000000 be9052b0 d7c51900 00000001 00000001 00000001 [ 237.950949] 3e80: 00000000 00002003 00000000 00000000 00000000 00000000 00000000 00000000 [ 237.959251] 3ea0: 00000000 00000000 00000001 00240000 000c0000 00000000 00000000 00000000 [ 237.967560] 3ec0: 00002000 00000000 ac5f2000 ec4171e0 ed793cd8 ed793cd0 ac5f2000 c049bac8 [ 237.975863] 3ee0: 00000001 00000003 000c0000 c0b29c74 00000000 c0b29c74 c2c46570 be9052b0 [ 237.984167] 3f00: c2c46570 d7c51900 40045612 be9052b0 0000000c 00000036 00000000 c04ffae0 [ 237.992470] 3f20: be9052b0 c0500300 00000001 00000056 00000012 d7d53f48 00000001 ef1fee10 [ 238.000775] 3f40: ee4e3660 d7d55612 d7d53f0b d7d53f3c 00400100 00000000 d7d53f58 c126aa48 [ 238.009079] 3f60: d7c51900 40045612 00000000 d7c51900 d7c51901 40045612 be9052b0 0000000c [ 238.017383] 3f80: 00000036 c0500b04 4a1bf700 b5edd000 40045612 00000036 c0301204 d7d52000 [ 238.025686] 3fa0: 00000036 c0301000 4a1bf700 b5edd000 0000000c 40045612 be9052b0 00000001 [ 238.033990] 3fc0: 4a1bf700 b5edd000 40045612 00000036 b5e40e40 0000000c b6f00508 00000000 [ 238.042293] 3fe0: be9052b0 be9052a0 b5ec6804 b5b9a1f0 400f0010 0000000c 00000000 00000000 [ 238.050651] [<c069b958>] (__list_add_valid) from [<bf55f20c>] (vchiq_mmal_submit_buffer+0x4c/0x74 [bcm2835_v4l2]) [ 238.061170] [<bf55f20c>] (vchiq_mmal_submit_buffer [bcm2835_v4l2]) from [<bf55a22c>] (buffer_queue+0x58/0x90 [bcm2835_v4l2]) [ 238.072618] [<bf55a22c>] (buffer_queue [bcm2835_v4l2]) from [<bf4d8278>] (vb2_start_streaming+0x58/0x12c [videobuf2_common]) [ 238.084053] [<bf4d8278>] (vb2_start_streaming [videobuf2_common]) from [<bf4d978c>] (vb2_core_streamon+0x110/0x138 [videobuf2_common]) [ 238.096479] [<bf4d978c>] (vb2_core_streamon [videobuf2_common]) from [<bf44ea34>] (__video_do_ioctl+0x35c/0x494 [videodev]) [ 238.107976] [<bf44ea34>] (__video_do_ioctl [videodev]) from [<bf44f19c>] (video_usercopy+0x508/0x5d4 [videodev]) [ 238.118414] [<bf44f19c>] (video_usercopy [videodev]) from [<c04ffae0>] (vfs_ioctl+0x28/0x3c) [ 238.126988] [<c04ffae0>] (vfs_ioctl) from [<c0500300>] (do_vfs_ioctl+0x8c/0x838) [ 238.134502] [<c0500300>] (do_vfs_ioctl) from [<c0500b04>] (ksys_ioctl+0x58/0x74) [ 238.142019] [<c0500b04>] (ksys_ioctl) from [<c0301000>] (ret_fast_syscall+0x0/0x54) [ 238.149787] Exception stack(0xd7d53fa8 to 0xd7d53ff0) [ 238.154915] 3fa0: 4a1bf700 b5edd000 0000000c 40045612 be9052b0 00000001 [ 238.163219] 3fc0: 4a1bf700 b5edd000 40045612 00000036 b5e40e40 0000000c b6f00508 00000000 [ 238.171519] 3fe0: be9052b0 be9052a0 b5ec6804 b5b9a1f0 [ 238.176657] Code: e59f0040 e1a02001 e1a0100c ebf44a37 (e7f001f2) [ 238.182843] ---[ end trace c5943cec7bb2566a ]---
Hi Peter, > Peter Robinson <pbrobinson@gmail.com> hat am 8. Januar 2019 um 08:21 geschrieben: > > > Hi Stefan, > > > This patch series improves the load/unload of bcm2835 camera and audio > > drivers. It has been tested with Raspberry Pi 3 B and a camera module V1. > > > > This series based on current linux-next and Phil Elwell's series ("Improve VCHIQ > > cache line size handling"). After Nicolas' series ("staging: vc04_services: > > Some dead code removal") has been applied, i will rebase my series. > > I tried testing this series applied to 4.20 with the camera module. first of all this crash should never happend. But why didn't you applied the series which was actually applied to mainline? Did you apply the rest of Phil's DT series as mentioned in the cover letter? > I > tried with qv4l2 (from v4l-utils) and using cheese, which in turn uses > gstreamer. Please provide the exact commandline and version. > I basically get the same crash for both options. Desktop is > LXDE on 32 bit Fedora 29. > > I've not yet tried with 5.0-rc1 but it looks like it has this patch > series and some other bits for the vchiq drivers in staging. Please try 5.0-rc1 which would be more helpful. Maybe this sounds like a lame excuse but the intension of this series wasn't to get the driver fully operational. I think this is more Dave's expertise. Stefan
Hi Stefan, > > > This patch series improves the load/unload of bcm2835 camera and audio > > > drivers. It has been tested with Raspberry Pi 3 B and a camera module V1. > > > > > > This series based on current linux-next and Phil Elwell's series ("Improve VCHIQ > > > cache line size handling"). After Nicolas' series ("staging: vc04_services: > > > Some dead code removal") has been applied, i will rebase my series. > > > > I tried testing this series applied to 4.20 with the camera module. > > first of all this crash should never happend. What do you mean by that? > But why didn't you applied the series which was actually applied to mainline? > Did you apply the rest of Phil's DT series as mentioned in the cover letter? I'm fairly certain I have Phil's "Improve VCHIQ cache line size handling" patch series applied if that's the one you mean, I will check (I'm currently dealing with 4 different kernels for maintenance so I'm sorry if my memory isn't exact). > > I > > tried with qv4l2 (from v4l-utils) and using cheese, which in turn uses > > gstreamer. > > Please provide the exact commandline and version. That was the command line, it pops up a GUI and then just taking a still. The version is the latest upstream which is 1.16.3. > > I basically get the same crash for both options. Desktop is > > LXDE on 32 bit Fedora 29. > > > > I've not yet tried with 5.0-rc1 but it looks like it has this patch > > series and some other bits for the vchiq drivers in staging. > > Please try 5.0-rc1 which would be more helpful. Yes, it's on my list. > Maybe this sounds like a lame excuse but the intension of this series wasn't to get the driver fully operational. I think this is more Dave's expertise. Well like so much stuff on the Raspberry Pi there's users that are testing it and want to use it so when people bother me I test it and provide feedback to the patches, if you don't want feedback I'll stop testing and just disable it and send people upstream for details so they don't bother me! Peter
Hi Peter, > Peter Robinson <pbrobinson@gmail.com> hat am 8. Januar 2019 um 09:56 geschrieben: > > > Hi Stefan, > > > > > This patch series improves the load/unload of bcm2835 camera and audio > > > > drivers. It has been tested with Raspberry Pi 3 B and a camera module V1. > > > > > > > > This series based on current linux-next and Phil Elwell's series ("Improve VCHIQ > > > > cache line size handling"). After Nicolas' series ("staging: vc04_services: > > > > Some dead code removal") has been applied, i will rebase my series. > > > > > > I tried testing this series applied to 4.20 with the camera module. > > > > first of all this crash should never happend. > > What do you mean by that? looks like you spotted an issue in the bail out code which is very likely not fixed yet. But i assume this wasn't your intention. You want to use the RPi camera with Linux 4.20. > > > But why didn't you applied the series which was actually applied to mainline? > > Did you apply the rest of Phil's DT series as mentioned in the cover letter? > > I'm fairly certain I have Phil's "Improve VCHIQ cache line size > handling" patch series applied if that's the one you mean, I will > check (I'm currently dealing with 4 different kernels for maintenance > so I'm sorry if my memory isn't exact). That's correct. Btw you will need a recent raspberrypi-firmware (iirc since 10/2018), too. > > > > I > > > tried with qv4l2 (from v4l-utils) and using cheese, which in turn uses > > > gstreamer. > > > > Please provide the exact commandline and version. > > That was the command line, it pops up a GUI and then just taking a > still. The version is the latest upstream which is 1.16.3. Thanks, i will try to reproduce it. > > > > I basically get the same crash for both options. Desktop is > > > LXDE on 32 bit Fedora 29. > > > > > > I've not yet tried with 5.0-rc1 but it looks like it has this patch > > > series and some other bits for the vchiq drivers in staging. > > > > Please try 5.0-rc1 which would be more helpful. > > Yes, it's on my list. > > > Maybe this sounds like a lame excuse but the intension of this series wasn't to get the driver fully operational. I think this is more Dave's expertise. > > Well like so much stuff on the Raspberry Pi there's users that are > testing it and want to use it so when people bother me I test it and > provide feedback to the patches, if you don't want feedback I'll stop > testing and just disable it and send people upstream for details so > they don't bother me! Please don't get me wrong. I'm very thankful to all this feedback. I know this isn't a very thankful job to offer a very close to mainline distribution and users expect the same behavior like on Raspbian. Without yours and others feedback we wont get much further. All i wanted to say was: please don't expect too much. It took nearly a year to fix this VCHIQ corruption. I think for the audio and camera stuff, we are just at the beginning ... So please keep up this good work. Stefan > > Peter > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi Peter On Tue, 8 Jan 2019 at 07:21, Peter Robinson <pbrobinson@gmail.com> wrote: > > Hi Stefan, > > > This patch series improves the load/unload of bcm2835 camera and audio > > drivers. It has been tested with Raspberry Pi 3 B and a camera module V1. > > > > This series based on current linux-next and Phil Elwell's series ("Improve VCHIQ > > cache line size handling"). After Nicolas' series ("staging: vc04_services: > > Some dead code removal") has been applied, i will rebase my series. > > I tried testing this series applied to 4.20 with the camera module. I > tried with qv4l2 (from v4l-utils) and using cheese, which in turn uses > gstreamer. I basically get the same crash for both options. Desktop is > LXDE on 32 bit Fedora 29. > > I've not yet tried with 5.0-rc1 but it looks like it has this patch > series and some other bits for the vchiq drivers in staging. I'm trying to sort the patches I have on our kernel tree and get them in a shape to get merged to staging. I've built for 5.0.0-rc1 and also see the same error using: v4l2-ctl -v width=640,height=480,pixelformat=YU12 v4l2-ctl --stream-mmap=3 --stream-to=/dev/null --stream-count=300 It's three independent things: - The firmware has failed the failed to enable the camera for reasons unknown. - The error path then hasn't returned all the buffers to videobuf2, hence the warning from videobuf2-core.c:1468 - The driver has then tried to pass some buffers to MMAL / VCHI which tries adding them to an invalid list. I'm investigating why the firmware is failing to enable the camera initially, and then look at cleaning up the error handling. Dave > Peter > > [ 231.121704] bcm2835-v4l2: Failed enabling camera, ret -2 > [ 231.127168] bcm2835-v4l2: Failed to enable camera > [ 231.132030] ------------[ cut here ]------------ > [ 231.136852] WARNING: CPU: 2 PID: 1473 at > drivers/media/common/videobuf2/videobuf2-core.c:1468 > vb2_start_streaming+0xb4/0x12c [videobuf2_common] > [ 231.149967] Modules linked in: fuse ip6t_rpfilter ip6t_REJECT > nf_reject_ipv6 xt_conntrack ebtable_nat ip6table_nat nf_nat_ipv6 > ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat_ipv4 > nf_nat iptable_mangle iptable_raw iptable_security nf_conntrack > nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip_set nfnetlink > ebtable_filter ebtables ip6table_filter ip6_tables cmac bnep sunrpc > vfat fat brcmfmac brcmutil vc4 cfg80211 snd_soc_core bcm2835_v4l2(C) > ac97_bus snd_bcm2835(C) videobuf2_vmalloc snd_pcm_dmaengine > videobuf2_memops snd_seq videobuf2_v4l2 videobuf2_common > snd_seq_device v4l2_common snd_pcm videodev media snd_timer snd > soundcore drm_kms_helper drm hci_uart btqca joydev btbcm btintel > fb_sys_fops syscopyarea bluetooth sysfillrect gpio_raspberrypi_exp > sysimgblt raspberrypi_hwmon bcm2835_thermal ecdh_generic vchiq(C) > rfkill bcm2835_wdt bcm2835_rng leds_gpio cpufreq_dt lz4 lz4_compress > zram hid_logitech_hidpp hid_logitech_dj smsc95xx usbnet mii mmc_block > dwc2 sdhci_iproc crc32_arm_ce > [ 231.150208] sdhci_pltfm udc_core sdhci bcm2835 pwm_bcm2835 > i2c_bcm2835 bcm2835_dma phy_generic > [ 231.248013] CPU: 2 PID: 1473 Comm: qv4l2 Tainted: G C > 4.20.0-1.fc30.armv7hl #1 > [ 231.256663] Hardware name: BCM2835 > [ 231.260144] [<c03127a4>] (unwind_backtrace) from [<c030cbf0>] > (show_stack+0x18/0x1c) > [ 231.268013] [<c030cbf0>] (show_stack) from [<c0b14340>] > (dump_stack+0x80/0xa0) > [ 231.275357] [<c0b14340>] (dump_stack) from [<c03507b4>] (__warn+0xdc/0xf8) > [ 231.282349] [<c03507b4>] (__warn) from [<c0350b28>] > (warn_slowpath_null+0x40/0x4c) > [ 231.290067] [<c0350b28>] (warn_slowpath_null) from [<bf4d82d4>] > (vb2_start_streaming+0xb4/0x12c [videobuf2_common]) > [ 231.300747] [<bf4d82d4>] (vb2_start_streaming [videobuf2_common]) > from [<bf4d978c>] (vb2_core_streamon+0x110/0x138 [videobuf2_common]) > [ 231.313166] [<bf4d978c>] (vb2_core_streamon [videobuf2_common]) > from [<bf44ea34>] (__video_do_ioctl+0x35c/0x494 [videodev]) > [ 231.324681] [<bf44ea34>] (__video_do_ioctl [videodev]) from > [<bf44f19c>] (video_usercopy+0x508/0x5d4 [videodev]) > [ 231.335120] [<bf44f19c>] (video_usercopy [videodev]) from > [<c04ffae0>] (vfs_ioctl+0x28/0x3c) > [ 231.343697] [<c04ffae0>] (vfs_ioctl) from [<c0500300>] > (do_vfs_ioctl+0x8c/0x838) > [ 231.351212] [<c0500300>] (do_vfs_ioctl) from [<c0500b04>] > (ksys_ioctl+0x58/0x74) > [ 231.358726] [<c0500b04>] (ksys_ioctl) from [<c0301000>] > (ret_fast_syscall+0x0/0x54) > [ 231.366493] Exception stack(0xd7d53fa8 to 0xd7d53ff0) > [ 231.371623] 3fa0: 4a1bf700 b5edd000 0000000c > 40045612 be905378 00000001 > [ 231.379930] 3fc0: 4a1bf700 b5edd000 40045612 00000036 b5e40e40 > 0000000c b6f00508 00000000 > [ 231.388230] 3fe0: be905378 be905368 b5ec6804 b5b9a1f0 > [ 231.393434] ---[ end trace c5943cec7bb25669 ]--- > [ 237.695591] list_add corruption. prev->next should be next > (ea4493e0), but was efeb6638. (prev=e126fa78). > [ 237.705362] ------------[ cut here ]------------ > [ 237.710056] kernel BUG at lib/list_debug.c:28! > [ 237.714569] Internal error: Oops - BUG: 0 [#1] SMP ARM > [ 237.719785] Modules linked in: fuse ip6t_rpfilter ip6t_REJECT > nf_reject_ipv6 xt_conntrack ebtable_nat ip6table_nat nf_nat_ipv6 > ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat_ipv4 > nf_nat iptable_mangle iptable_raw iptable_security nf_conntrack > nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip_set nfnetlink > ebtable_filter ebtables ip6table_filter ip6_tables cmac bnep sunrpc > vfat fat brcmfmac brcmutil vc4 cfg80211 snd_soc_core bcm2835_v4l2(C) > ac97_bus snd_bcm2835(C) videobuf2_vmalloc snd_pcm_dmaengine > videobuf2_memops snd_seq videobuf2_v4l2 videobuf2_common > snd_seq_device v4l2_common snd_pcm videodev media snd_timer snd > soundcore drm_kms_helper drm hci_uart btqca joydev btbcm btintel > fb_sys_fops syscopyarea bluetooth sysfillrect gpio_raspberrypi_exp > sysimgblt raspberrypi_hwmon bcm2835_thermal ecdh_generic vchiq(C) > rfkill bcm2835_wdt bcm2835_rng leds_gpio cpufreq_dt lz4 lz4_compress > zram hid_logitech_hidpp hid_logitech_dj smsc95xx usbnet mii mmc_block > dwc2 sdhci_iproc crc32_arm_ce > [ 237.720008] sdhci_pltfm udc_core sdhci bcm2835 pwm_bcm2835 > i2c_bcm2835 bcm2835_dma phy_generic > [ 237.817717] CPU: 1 PID: 1473 Comm: qv4l2 Tainted: G WC > 4.20.0-1.fc30.armv7hl #1 > [ 237.826365] Hardware name: BCM2835 > [ 237.829831] PC is at __list_add_valid+0x44/0x84 > [ 237.834426] LR is at __list_add_valid+0x44/0x84 > [ 237.839020] pc : [<c069b958>] lr : [<c069b958>] psr: 600f0093 > [ 237.845377] sp : d7d53da0 ip : 00000000 fp : 00000001 > [ 237.850676] r10: 600f0013 r9 : ea4493e0 r8 : ea4493e8 > [ 237.855979] r7 : eb773000 r6 : eb773278 r5 : e126fa78 r4 : ea449358 > [ 237.862602] r3 : ef707cb0 r2 : 2e5c6000 r1 : ef704548 r0 : 0000005d > [ 237.869226] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM > Segment none > [ 237.876555] Control: 10c5383d Table: 17d0406a DAC: 00000051 > [ 237.882390] Process qv4l2 (pid: 1473, stack limit = 0xdf044251) > [ 237.888394] Stack: (0xd7d53da0 to 0xd7d54000) > [ 237.892823] 3da0: ea449358 bf55f20c ea31f800 eb773000 ea31fe24 > bf44aa08 ea31fb80 d7d53e78 > [ 237.901130] 3dc0: bf467200 bf55a22c eb773000 00000000 00000001 > ea31fd28 eb773000 bf4d8278 > [ 237.909435] 3de0: ea31fd28 00000000 ea31f858 bf44aa08 ea31fb80 > bf4d978c 40045612 bf44ea34 > [ 237.917738] 3e00: d7d53e2c c04babd4 ef8eb210 bf5601f4 ecf68f00 > 00000000 d7c51900 ecf68f00 > [ 237.926042] 3e20: c124f850 00000004 d7d53e7c c04c0b88 d7d53e78 > c031691c d7d53e78 00000000 > [ 237.934345] 3e40: d7d53e78 00000000 bf44e6d8 40045612 00000000 > 00000004 00000000 bf44f19c > [ 237.942648] 3e60: 0007ffff 00000000 00000000 be9052b0 d7c51900 > 00000001 00000001 00000001 > [ 237.950949] 3e80: 00000000 00002003 00000000 00000000 00000000 > 00000000 00000000 00000000 > [ 237.959251] 3ea0: 00000000 00000000 00000001 00240000 000c0000 > 00000000 00000000 00000000 > [ 237.967560] 3ec0: 00002000 00000000 ac5f2000 ec4171e0 ed793cd8 > ed793cd0 ac5f2000 c049bac8 > [ 237.975863] 3ee0: 00000001 00000003 000c0000 c0b29c74 00000000 > c0b29c74 c2c46570 be9052b0 > [ 237.984167] 3f00: c2c46570 d7c51900 40045612 be9052b0 0000000c > 00000036 00000000 c04ffae0 > [ 237.992470] 3f20: be9052b0 c0500300 00000001 00000056 00000012 > d7d53f48 00000001 ef1fee10 > [ 238.000775] 3f40: ee4e3660 d7d55612 d7d53f0b d7d53f3c 00400100 > 00000000 d7d53f58 c126aa48 > [ 238.009079] 3f60: d7c51900 40045612 00000000 d7c51900 d7c51901 > 40045612 be9052b0 0000000c > [ 238.017383] 3f80: 00000036 c0500b04 4a1bf700 b5edd000 40045612 > 00000036 c0301204 d7d52000 > [ 238.025686] 3fa0: 00000036 c0301000 4a1bf700 b5edd000 0000000c > 40045612 be9052b0 00000001 > [ 238.033990] 3fc0: 4a1bf700 b5edd000 40045612 00000036 b5e40e40 > 0000000c b6f00508 00000000 > [ 238.042293] 3fe0: be9052b0 be9052a0 b5ec6804 b5b9a1f0 400f0010 > 0000000c 00000000 00000000 > [ 238.050651] [<c069b958>] (__list_add_valid) from [<bf55f20c>] > (vchiq_mmal_submit_buffer+0x4c/0x74 [bcm2835_v4l2]) > [ 238.061170] [<bf55f20c>] (vchiq_mmal_submit_buffer [bcm2835_v4l2]) > from [<bf55a22c>] (buffer_queue+0x58/0x90 [bcm2835_v4l2]) > [ 238.072618] [<bf55a22c>] (buffer_queue [bcm2835_v4l2]) from > [<bf4d8278>] (vb2_start_streaming+0x58/0x12c [videobuf2_common]) > [ 238.084053] [<bf4d8278>] (vb2_start_streaming [videobuf2_common]) > from [<bf4d978c>] (vb2_core_streamon+0x110/0x138 [videobuf2_common]) > [ 238.096479] [<bf4d978c>] (vb2_core_streamon [videobuf2_common]) > from [<bf44ea34>] (__video_do_ioctl+0x35c/0x494 [videodev]) > [ 238.107976] [<bf44ea34>] (__video_do_ioctl [videodev]) from > [<bf44f19c>] (video_usercopy+0x508/0x5d4 [videodev]) > [ 238.118414] [<bf44f19c>] (video_usercopy [videodev]) from > [<c04ffae0>] (vfs_ioctl+0x28/0x3c) > [ 238.126988] [<c04ffae0>] (vfs_ioctl) from [<c0500300>] > (do_vfs_ioctl+0x8c/0x838) > [ 238.134502] [<c0500300>] (do_vfs_ioctl) from [<c0500b04>] > (ksys_ioctl+0x58/0x74) > [ 238.142019] [<c0500b04>] (ksys_ioctl) from [<c0301000>] > (ret_fast_syscall+0x0/0x54) > [ 238.149787] Exception stack(0xd7d53fa8 to 0xd7d53ff0) > [ 238.154915] 3fa0: 4a1bf700 b5edd000 0000000c > 40045612 be9052b0 00000001 > [ 238.163219] 3fc0: 4a1bf700 b5edd000 40045612 00000036 b5e40e40 > 0000000c b6f00508 00000000 > [ 238.171519] 3fe0: be9052b0 be9052a0 b5ec6804 b5b9a1f0 > [ 238.176657] Code: e59f0040 e1a02001 e1a0100c ebf44a37 (e7f001f2) > [ 238.182843] ---[ end trace c5943cec7bb2566a ]---
Hi, [add Arnd] > Dave Stevenson <dave.stevenson@raspberrypi.org> hat am 8. Januar 2019 um 18:10 > geschrieben: > > > Hi Peter > > On Tue, 8 Jan 2019 at 07:21, Peter Robinson <pbrobinson@gmail.com> wrote: > > > > Hi Stefan, > > > > > This patch series improves the load/unload of bcm2835 camera and audio > > > drivers. It has been tested with Raspberry Pi 3 B and a camera module V1. > > > > > > This series based on current linux-next and Phil Elwell's series ("Improve > > > VCHIQ > > > cache line size handling"). After Nicolas' series ("staging: > > > vc04_services: > > > Some dead code removal") has been applied, i will rebase my series. > > > > I tried testing this series applied to 4.20 with the camera module. I > > tried with qv4l2 (from v4l-utils) and using cheese, which in turn uses > > gstreamer. I basically get the same crash for both options. Desktop is > > LXDE on 32 bit Fedora 29. > > > > I've not yet tried with 5.0-rc1 but it looks like it has this patch > > series and some other bits for the vchiq drivers in staging. > > I'm trying to sort the patches I have on our kernel tree and get them > in a shape to get merged to staging. > I've built for 5.0.0-rc1 and also see the same error using: > v4l2-ctl -v width=640,height=480,pixelformat=YU12 > v4l2-ctl --stream-mmap=3 --stream-to=/dev/null --stream-count=300 > i wasn't able to reproduce this issue yet (Raspberry Pi 3, Firmware: 2018-12-18 + 2018-11-12). qv4l2 and cheese from recent Raspbian shows an greenish image but works. I tried to capture a video with cheese but this seems to hang and after some time i terminated cheese and got this kernel output: [ 238.330187] bcm2835_v4l2: timed out waiting for sync completion [ 238.330202] bcm2835-v4l2: Failed disabling camera, ret -62 [ 238.330206] bcm2835-v4l2: Failed to disable camera [ 238.330211] ------------[ cut here ]------------ [ 238.330239] WARNING: CPU: 3 PID: 1259 at drivers/media/common/videobuf2/videobuf2-core.c:1852 __vb2_queue_cancel+0x1d8/0x24c [videobuf2_common] [ 238.330242] Modules linked in: cmac bcm2835_v4l2(C) v4l2_common videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev media snd_bcm2835(C) brcmfmac sha256_generic sha256_arm vc4 snd_soc_core ac97_bus snd_pcm_dmaengine snd_pcm snd_timer cfg80211 snd crc32_arm_ce raspberrypi_hwmon soundcore brcmutil hci_uart btbcm bluetooth bcm2835_thermal ecdh_generic vchiq(C) phy_generic microchip lan78xx [ 238.330328] CPU: 3 PID: 1259 Comm: v4l2src1:src Tainted: G C 5.0.0-rc1-g3bd6e94be #2 [ 238.330331] Hardware name: BCM2835 [ 238.330359] [<c031234c>] (unwind_backtrace) from [<c030cd64>] (show_stack+0x10/0x14) [ 238.330373] [<c030cd64>] (show_stack) from [<c0e33830>] (dump_stack+0x8c/0xa0) [ 238.330388] [<c0e33830>] (dump_stack) from [<c0345e00>] (__warn+0xe0/0xf8) [ 238.330401] [<c0345e00>] (__warn) from [<c0345f30>] (warn_slowpath_null+0x40/0x48) [ 238.330421] [<c0345f30>] (warn_slowpath_null) from [<bf4f60b0>] (__vb2_queue_cancel+0x1d8/0x24c [videobuf2_common]) [ 238.330466] [<bf4f60b0>] (__vb2_queue_cancel [videobuf2_common]) from [<bf4f7a0c>] (vb2_core_queue_release+0x18/0x38 [videobuf2_common]) [ 238.330490] [<bf4f7a0c>] (vb2_core_queue_release [videobuf2_common]) from [<bf5059e8>] (_vb2_fop_release+0x74/0x84 [videobuf2_v4l2]) [ 238.330533] [<bf5059e8>] (_vb2_fop_release [videobuf2_v4l2]) from [<bf4be428>] (v4l2_release+0x94/0xd8 [videodev]) [ 238.330571] [<bf4be428>] (v4l2_release [videodev]) from [<c0480054>] (__fput+0x84/0x1c8) [ 238.330588] [<c0480054>] (__fput) from [<c03640a0>] (task_work_run+0xa8/0xcc) [ 238.330604] [<c03640a0>] (task_work_run) from [<c0349984>] (do_exit+0x3a4/0xa90) [ 238.330618] [<c0349984>] (do_exit) from [<c034af30>] (do_group_exit+0x3c/0xd0) [ 238.330634] [<c034af30>] (do_group_exit) from [<c03563a0>] (get_signal+0x24c/0x6d8) [ 238.330647] [<c03563a0>] (get_signal) from [<c030c184>] (do_work_pending+0x150/0x5a8) [ 238.330659] [<c030c184>] (do_work_pending) from [<c030106c>] (slow_work_pending+0xc/0x20) [ 238.330665] Exception stack(0xe589ffb0 to 0xe589fff8) [ 238.330674] ffa0: ab203ea0 00000002 00000000 00000000 [ 238.330685] ffc0: 00000008 00000002 ab203ea0 00000150 00000000 009bfd80 ffffffff ffffffff [ 238.330695] ffe0: ab1fe54c ab1fe558 00000000 b6155d68 80000010 ab203ea0 [ 238.330701] ---[ end trace 38eb902c180397fe ]--- [ 238.330710] videobuf2_common: driver bug: stop_streaming operation is leaving buf a00b2206 in active state [ 238.330717] videobuf2_common: driver bug: stop_streaming operation is leaving buf c6a3f306 in active state [ 238.330723] videobuf2_common: driver bug: stop_streaming operation is leaving buf d3723ebf in active state [ 238.330728] videobuf2_common: driver bug: stop_streaming operation is leaving buf fd514935 in active state But i noticed a regression introduced in 5.0-rc1, which might be related. I tried to run "vchiq_test -f 1" and it never completes. After reverting commit 852b2876a8a8 ("staging: vchiq: rework remove_event handling") vchiq_test [1] works as expected again. Regards Stefan [1] - https://github.com/raspberrypi/userland/blob/master/interface/vchiq_arm/vchiq_test.c
Hi Stefan, On Wed, 2019-01-09 at 09:33 +0100, Stefan Wahren wrote: > > But i noticed a regression introduced in 5.0-rc1, which might be > related. I > tried to run "vchiq_test -f 1" and it never completes. After > reverting commit > 852b2876a8a8 ("staging: vchiq: rework remove_event handling") > vchiq_test [1] > works as expected again. I had a look at that one, it seems that it's due to the fact that vchiq relies on completions only sleeping whenever their internal count reaches 0 (it's incremented on every complete()). As opposed to wait_queues, which will wait until an event is triggered regardless of previous state. Regards, Nicolas
Hi Stefan, > > > But why didn't you applied the series which was actually applied to mainline? > > > Did you apply the rest of Phil's DT series as mentioned in the cover letter? > > > > I'm fairly certain I have Phil's "Improve VCHIQ cache line size > > handling" patch series applied if that's the one you mean, I will > > check (I'm currently dealing with 4 different kernels for maintenance > > so I'm sorry if my memory isn't exact). > > That's correct. Btw you will need a recent raspberrypi-firmware (iirc since 10/2018), too. For reference I was using 1ea8781 from 18/12/2018, I noticed there's a new one that fixes colour issues with the cameres. Given I couldn't work out exactly which random patch set I had for the test kernel I've now moved to a 4.20.1 with cacheline and this patch series. I still get the same series of crash there from just running qv4l2. I get a blank OpenGL window (could be something unrelated with the vc4 driver), and the same issue with cheese. [ 74.723451] bcm2835_audio bcm2835_audio: vchi message timeout, msg=5 [ 118.512917] bcm2835-v4l2: Failed enabling camera, ret -2 [ 118.518379] bcm2835-v4l2: Failed to enable camera [ 118.523228] ------------[ cut here ]------------ [ 118.528002] WARNING: CPU: 3 PID: 1470 at drivers/media/common/videobuf2/videobuf2-core.c:1471 vb2_start_streaming+0xb4/0x12c [videobuf2_common] [ 118.541098] Modules linked in: fuse ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat ip6table_nat nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat_ipv4 nf_nat iptable_mangle iptable_raw iptable_security nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip_set nfnetlink ebtable_filter ebtables cmac ip6table_filter ip6_tables bnep sunrpc vfat fat vc4 snd_soc_core ac97_bus bcm2835_v4l2(C) snd_pcm_dmaengine snd_bcm2835(C) videobuf2_vmalloc snd_seq videobuf2_memops videobuf2_v4l2 snd_seq_device videobuf2_common snd_pcm v4l2_common videodev snd_timer snd media brcmfmac soundcore drm_kms_helper brcmutil drm hci_uart cfg80211 fb_sys_fops btqca syscopyarea btbcm joydev sysfillrect btintel sysimgblt bluetooth raspberrypi_hwmon ecdh_generic rfkill bcm2835_thermal bcm2835_rng bcm2835_wdt vchiq(C) leds_gpio cpufreq_dt lz4 lz4_compress zram hid_logitech_hidpp hid_logitech_dj smsc95xx usbnet mii mmc_block dwc2 sdhci_iproc sdhci_pltfm udc_core [ 118.541261] gpio_raspberrypi_exp crc32_arm_ce sdhci pwm_bcm2835 bcm2835 i2c_bcm2835 bcm2835_dma phy_generic [ 118.639009] CPU: 3 PID: 1470 Comm: qv4l2 Tainted: G C 4.20.1-200.fc29.armv7hl #1 [ 118.647828] Hardware name: BCM2835 [ 118.651296] [<c03127a4>] (unwind_backtrace) from [<c030cbf0>] (show_stack+0x18/0x1c) [ 118.659156] [<c030cbf0>] (show_stack) from [<c0b14f80>] (dump_stack+0x80/0xa0) [ 118.666488] [<c0b14f80>] (dump_stack) from [<c03507b4>] (__warn+0xdc/0xf8) [ 118.673466] [<c03507b4>] (__warn) from [<c0350b28>] (warn_slowpath_null+0x40/0x4c) [ 118.681168] [<c0350b28>] (warn_slowpath_null) from [<bf70a2d4>] (vb2_start_streaming+0xb4/0x12c [videobuf2_common]) [ 118.691810] [<bf70a2d4>] (vb2_start_streaming [videobuf2_common]) from [<bf70b78c>] (vb2_core_streamon+0x110/0x138 [videobuf2_common]) [ 118.704152] [<bf70b78c>] (vb2_core_streamon [videobuf2_common]) from [<bf6aaa34>] (__video_do_ioctl+0x35c/0x494 [videodev]) [ 118.715546] [<bf6aaa34>] (__video_do_ioctl [videodev]) from [<bf6ab19c>] (video_usercopy+0x508/0x5d4 [videodev]) [ 118.725923] [<bf6ab19c>] (video_usercopy [videodev]) from [<c04ffae8>] (vfs_ioctl+0x28/0x3c) [ 118.734487] [<c04ffae8>] (vfs_ioctl) from [<c0500308>] (do_vfs_ioctl+0x8c/0x838) [ 118.741990] [<c0500308>] (do_vfs_ioctl) from [<c0500b0c>] (ksys_ioctl+0x58/0x74) [ 118.749495] [<c0500b0c>] (ksys_ioctl) from [<c0301000>] (ret_fast_syscall+0x0/0x54) [ 118.757259] Exception stack(0xd940dfa8 to 0xd940dff0) [ 118.762382] dfa0: d47c8700 b5f1e000 0000000c 40045612 befb42a0 00000001 [ 118.770678] dfc0: d47c8700 b5f1e000 40045612 00000036 b5e81e40 0000000c b6f41508 00000000 [ 118.778970] dfe0: befb42a0 befb4290 b5f07804 b5bdb1f0 [ 118.784155] ---[ end trace 4c04f89544a1aee9 ]--- [ 132.329586] bcm2835-v4l2: Failed enabling camera, ret -2 [ 132.335008] bcm2835-v4l2: Failed to enable camera [ 132.339826] ------------[ cut here ]------------ [ 132.344555] WARNING: CPU: 3 PID: 1470 at drivers/media/common/videobuf2/videobuf2-core.c:1471 vb2_start_streaming+0xb4/0x12c [videobuf2_common] [ 132.357629] Modules linked in: fuse ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat ip6table_nat nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat_ipv4 nf_nat iptable_mangle iptable_raw iptable_security nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip_set nfnetlink ebtable_filter ebtables cmac ip6table_filter ip6_tables bnep sunrpc vfat fat vc4 snd_soc_core ac97_bus bcm2835_v4l2(C) snd_pcm_dmaengine snd_bcm2835(C) videobuf2_vmalloc snd_seq videobuf2_memops videobuf2_v4l2 snd_seq_device videobuf2_common snd_pcm v4l2_common videodev snd_timer snd media brcmfmac soundcore drm_kms_helper brcmutil drm hci_uart cfg80211 fb_sys_fops btqca syscopyarea btbcm joydev sysfillrect btintel sysimgblt bluetooth raspberrypi_hwmon ecdh_generic rfkill bcm2835_thermal bcm2835_rng bcm2835_wdt vchiq(C) leds_gpio cpufreq_dt lz4 lz4_compress zram hid_logitech_hidpp hid_logitech_dj smsc95xx usbnet mii mmc_block dwc2 sdhci_iproc sdhci_pltfm udc_core [ 132.357792] gpio_raspberrypi_exp crc32_arm_ce sdhci pwm_bcm2835 bcm2835 i2c_bcm2835 bcm2835_dma phy_generic [ 132.455510] CPU: 3 PID: 1470 Comm: qv4l2 Tainted: G WC 4.20.1-200.fc29.armv7hl #1 [ 132.464329] Hardware name: BCM2835 [ 132.467798] [<c03127a4>] (unwind_backtrace) from [<c030cbf0>] (show_stack+0x18/0x1c) [ 132.475658] [<c030cbf0>] (show_stack) from [<c0b14f80>] (dump_stack+0x80/0xa0) [ 132.482986] [<c0b14f80>] (dump_stack) from [<c03507b4>] (__warn+0xdc/0xf8) [ 132.489962] [<c03507b4>] (__warn) from [<c0350b28>] (warn_slowpath_null+0x40/0x4c) [ 132.497663] [<c0350b28>] (warn_slowpath_null) from [<bf70a2d4>] (vb2_start_streaming+0xb4/0x12c [videobuf2_common]) [ 132.508273] [<bf70a2d4>] (vb2_start_streaming [videobuf2_common]) from [<bf70b78c>] (vb2_core_streamon+0x110/0x138 [videobuf2_common]) [ 132.520619] [<bf70b78c>] (vb2_core_streamon [videobuf2_common]) from [<bf6aaa34>] (__video_do_ioctl+0x35c/0x494 [videodev]) [ 132.532012] [<bf6aaa34>] (__video_do_ioctl [videodev]) from [<bf6ab19c>] (video_usercopy+0x508/0x5d4 [videodev]) [ 132.542387] [<bf6ab19c>] (video_usercopy [videodev]) from [<c04ffae8>] (vfs_ioctl+0x28/0x3c) [ 132.550949] [<c04ffae8>] (vfs_ioctl) from [<c0500308>] (do_vfs_ioctl+0x8c/0x838) [ 132.558452] [<c0500308>] (do_vfs_ioctl) from [<c0500b0c>] (ksys_ioctl+0x58/0x74) [ 132.565956] [<c0500b0c>] (ksys_ioctl) from [<c0301000>] (ret_fast_syscall+0x0/0x54) [ 132.573718] Exception stack(0xd940dfa8 to 0xd940dff0) [ 132.578838] dfa0: d47c8700 b5f1e000 0000000c 40045612 befb4368 00000001 [ 132.587132] dfc0: d47c8700 b5f1e000 40045612 00000036 b5e81e40 0000000c b6f41508 00000000 [ 132.595424] dfe0: befb4368 befb4358 b5f07804 b5bdb1f0 [ 132.600568] ---[ end trace 4c04f89544a1aeea ]--- [ 155.048886] list_add corruption. prev->next should be next (ea7793e0), but was 00000000. (prev=d97cde78). [ 155.058671] ------------[ cut here ]------------ [ 155.063361] kernel BUG at lib/list_debug.c:28! [ 155.067864] Internal error: Oops - BUG: 0 [#1] SMP ARM [ 155.073071] Modules linked in: fuse ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat ip6table_nat nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat_ipv4 nf_nat iptable_mangle iptable_raw iptable_security nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip_set nfnetlink ebtable_filter ebtables cmac ip6table_filter ip6_tables bnep sunrpc vfat fat vc4 snd_soc_core ac97_bus bcm2835_v4l2(C) snd_pcm_dmaengine snd_bcm2835(C) videobuf2_vmalloc snd_seq videobuf2_memops videobuf2_v4l2 snd_seq_device videobuf2_common snd_pcm v4l2_common videodev snd_timer snd media brcmfmac soundcore drm_kms_helper brcmutil drm hci_uart cfg80211 fb_sys_fops btqca syscopyarea btbcm joydev sysfillrect btintel sysimgblt bluetooth raspberrypi_hwmon ecdh_generic rfkill bcm2835_thermal bcm2835_rng bcm2835_wdt vchiq(C) leds_gpio cpufreq_dt lz4 lz4_compress zram hid_logitech_hidpp hid_logitech_dj smsc95xx usbnet mii mmc_block dwc2 sdhci_iproc sdhci_pltfm udc_core [ 155.073205] gpio_raspberrypi_exp crc32_arm_ce sdhci pwm_bcm2835 bcm2835 i2c_bcm2835 bcm2835_dma phy_generic [ 155.170889] CPU: 1 PID: 1470 Comm: qv4l2 Tainted: G WC 4.20.1-200.fc29.armv7hl #1 [ 155.179708] Hardware name: BCM2835 [ 155.183162] PC is at __list_add_valid+0x44/0x84 [ 155.187754] LR is at __list_add_valid+0x44/0x84 [ 155.192344] pc : [<c069bec0>] lr : [<c069bec0>] psr: 600f0093 [ 155.198694] sp : d940dda0 ip : 00000000 fp : 00000001 [ 155.203988] r10: 600f0013 r9 : ea7793e0 r8 : ea7793e8 [ 155.209282] r7 : d9534c00 r6 : d9534e78 r5 : d97cde78 r4 : ea779358 [ 155.215898] r3 : ef74fcb0 r2 : 2e60e000 r1 : ef74c548 r0 : 0000005d [ 155.222516] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none [ 155.229837] Control: 10c5383d Table: 1944c06a DAC: 00000051 [ 155.235661] Process qv4l2 (pid: 1470, stack limit = 0x56c02967) [ 155.241661] Stack: (0xd940dda0 to 0xd940e000) [ 155.246079] dda0: ea779358 bf7ab20c ede0a800 d9534c00 ede0ae24 bf6a6a08 ede0ab80 d940de78 [ 155.254373] ddc0: bf6c3200 bf7a622c d9534c00 00000000 00000001 ede0ad28 d9534c00 bf70a278 [ 155.262667] dde0: ede0ad28 00000000 ede0a858 bf6a6a08 ede0ab80 bf70b78c 40045612 bf6aaa34 [ 155.270961] de00: d940de2c c04babdc ef8cfd24 bf7ac1f4 df58fc00 00000000 e9587240 df58fc00 [ 155.279256] de20: c124f850 00000004 d940de7c c04c0b90 d940de78 c031691c d940de78 00000000 [ 155.287549] de40: d940de78 00000000 bf6aa6d8 40045612 00000000 00000004 00000000 bf6ab19c [ 155.295843] de60: 0007ffff 00000000 00000000 befb4368 e9587240 00000001 00000001 00000001 [ 155.304136] de80: 00000000 00002003 00000000 00000000 00000000 00000000 00000000 00000000 [ 155.312429] dea0: 00000000 00000000 00000001 00240000 000c0000 00000000 00000000 00000000 [ 155.320723] dec0: 00002000 00000000 ac2ef000 e535ae40 e95c6198 e95c6190 ac2ef000 c049bad0 [ 155.329019] dee0: 00000001 00000003 000c0000 c0b2a8b4 00000000 c0b2a8b4 c2ee6570 befb4368 [ 155.337315] df00: c2ee6570 e9587240 40045612 befb4368 0000000c 00000036 00000000 c04ffae8 [ 155.345612] df20: befb4368 c0500308 00000001 00000056 00000012 d940df48 00000001 ef2ac910 [ 155.353908] df40: c29c4660 d9405612 d940df0b d940df3c 00400100 00000000 d940df58 c126ab28 [ 155.362204] df60: e9587240 40045612 00000000 e9587240 e9587241 40045612 befb4368 0000000c [ 155.370500] df80: 00000036 c0500b0c d47c8700 b5f1e000 40045612 00000036 c0301204 d940c000 [ 155.378797] dfa0: 00000036 c0301000 d47c8700 b5f1e000 0000000c 40045612 befb4368 00000001 [ 155.387093] dfc0: d47c8700 b5f1e000 40045612 00000036 b5e81e40 0000000c b6f41508 00000000 [ 155.395386] dfe0: befb4368 befb4358 b5f07804 b5bdb1f0 400f0010 0000000c 00000000 00000000 [ 155.403716] [<c069bec0>] (__list_add_valid) from [<bf7ab20c>] (vchiq_mmal_submit_buffer+0x4c/0x74 [bcm2835_v4l2]) [ 155.414189] [<bf7ab20c>] (vchiq_mmal_submit_buffer [bcm2835_v4l2]) from [<bf7a622c>] (buffer_queue+0x58/0x90 [bcm2835_v4l2]) [ 155.425602] [<bf7a622c>] (buffer_queue [bcm2835_v4l2]) from [<bf70a278>] (vb2_start_streaming+0x58/0x12c [videobuf2_common]) [ 155.437005] [<bf70a278>] (vb2_start_streaming [videobuf2_common]) from [<bf70b78c>] (vb2_core_streamon+0x110/0x138 [videobuf2_common]) [ 155.449348] [<bf70b78c>] (vb2_core_streamon [videobuf2_common]) from [<bf6aaa34>] (__video_do_ioctl+0x35c/0x494 [videodev]) [ 155.460740] [<bf6aaa34>] (__video_do_ioctl [videodev]) from [<bf6ab19c>] (video_usercopy+0x508/0x5d4 [videodev]) [ 155.471115] [<bf6ab19c>] (video_usercopy [videodev]) from [<c04ffae8>] (vfs_ioctl+0x28/0x3c) [ 155.479680] [<c04ffae8>] (vfs_ioctl) from [<c0500308>] (do_vfs_ioctl+0x8c/0x838) [ 155.487184] [<c0500308>] (do_vfs_ioctl) from [<c0500b0c>] (ksys_ioctl+0x58/0x74) [ 155.494689] [<c0500b0c>] (ksys_ioctl) from [<c0301000>] (ret_fast_syscall+0x0/0x54) [ 155.502451] Exception stack(0xd940dfa8 to 0xd940dff0) [ 155.507573] dfa0: d47c8700 b5f1e000 0000000c 40045612 befb4368 00000001 [ 155.515866] dfc0: d47c8700 b5f1e000 40045612 00000036 b5e81e40 0000000c b6f41508 00000000 [ 155.524160] dfe0: befb4368 befb4358 b5f07804 b5bdb1f0 [ 155.529283] Code: e59f0040 e1a02001 e1a0100c ebf448dd (e7f001f2) [ 155.535464] ---[ end trace 4c04f89544a1aeeb ]--- > > > > I basically get the same crash for both options. Desktop is > > > > LXDE on 32 bit Fedora 29. > > > > > > > > I've not yet tried with 5.0-rc1 but it looks like it has this patch > > > > series and some other bits for the vchiq drivers in staging. > > > > > > Please try 5.0-rc1 which would be more helpful. > > > > Yes, it's on my list. I get difference results with 5.0-rc1 but neither of the above apps work either, will follow up based on the rest of the thread there.
Hi Dave, > > > This patch series improves the load/unload of bcm2835 camera and audio > > > drivers. It has been tested with Raspberry Pi 3 B and a camera module V1. > > > > > > This series based on current linux-next and Phil Elwell's series ("Improve VCHIQ > > > cache line size handling"). After Nicolas' series ("staging: vc04_services: > > > Some dead code removal") has been applied, i will rebase my series. > > > > I tried testing this series applied to 4.20 with the camera module. I > > tried with qv4l2 (from v4l-utils) and using cheese, which in turn uses > > gstreamer. I basically get the same crash for both options. Desktop is > > LXDE on 32 bit Fedora 29. > > > > I've not yet tried with 5.0-rc1 but it looks like it has this patch > > series and some other bits for the vchiq drivers in staging. > > I'm trying to sort the patches I have on our kernel tree and get them > in a shape to get merged to staging. > I've built for 5.0.0-rc1 and also see the same error using: > v4l2-ctl -v width=640,height=480,pixelformat=YU12 > v4l2-ctl --stream-mmap=3 --stream-to=/dev/null --stream-count=300 > > It's three independent things: > - The firmware has failed the failed to enable the camera for reasons unknown. OK, with the extended firmware enabled I get the following boot messages before trying to access the camera: [ 27.541690] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned. [ 28.203301] bcm2835-v4l2: scene mode selected 0, was 0 [ 28.203882] bcm2835-v4l2: V4L2 device registered as video0 - stills mode > 1280x720 [ 28.219128] bcm2835-v4l2: Broadcom 2835 MMAL video capture ver 0.0.2 loaded. Any idea what I should be seeing besides this if it enables it properly, I get different errors if I don't have extended firmware or not enough memory. With Stefan's upstream commit 4cc357c500d (staging: bcm2835-camera: Add hint about possible faulty config) he reports "Not enough GPU mem?" but I wonder if it's more accurate to report that the wrong firmware is loaded, I've managed to get that error if I have enough memory and aren't don't have "start_x=1" (or have start_x=10). BTW what is enough memory? It seems 32Mb should be enough, tried with the same results with 64Mb too but I've not found anything explicit about features vs gpu_mem, until I've started looking at the camera we've set it to 16Mb due to using the open vc4 driver, but as other things start to come along like the camera, and presumably accelerated video decoding, this seems to affect those. As a side note it would be a useful debug feature from a support PoV if the following line could also note which firmware is loaded: [ 8.087691] raspberrypi-firmware soc:firmware: Attached to firmware from 2019-01-09 20:07 Something like "attached to extended/reduced/whatecer firmware from XXXX-XX-XX" > - The error path then hasn't returned all the buffers to videobuf2, > hence the warning from videobuf2-core.c:1468 > - The driver has then tried to pass some buffers to MMAL / VCHI which > tries adding them to an invalid list. > > I'm investigating why the firmware is failing to enable the camera > initially, and then look at cleaning up the error handling. OK, let me know when you've got something you want me to test. Peter
> Peter Robinson <pbrobinson@gmail.com> hat am 10. Januar 2019 um 06:09 geschrieben: > > > Hi Stefan, > ... > > I get difference results with 5.0-rc1 but neither of the above apps > work either, will follow up based on the rest of the thread there. > My first step with Raspbian is to enable the Camera interface which results into an appending of the following lines to config.txt: start_x=1 gpu_mem=128 AFAIK a smaller value for gpu_mem wont work. Please provide your settings which results in this crash.
> > Hi Stefan, > > > ... > > > > I get difference results with 5.0-rc1 but neither of the above apps > > work either, will follow up based on the rest of the thread there. > > > > My first step with Raspbian is to enable the Camera interface which results into an appending of the following lines to config.txt: > > start_x=1 > gpu_mem=128 > > AFAIK a smaller value for gpu_mem wont work. Please provide your settings which results in this crash. start_x=1 gpu_mem=64
> > I get difference results with 5.0-rc1 but neither of the above apps > > work either, will follow up based on the rest of the thread there. > > > > My first step with Raspbian is to enable the Camera interface which results into an appending of the following lines to config.txt: > > start_x=1 > gpu_mem=128 > > AFAIK a smaller value for gpu_mem wont work. Please provide your settings which results in this crash. OK with that, plus my 4.20.1 kernel (and the 09/01/19 firmware) I'm starting to get somewhere. I can get a picture with the qv4l2 app ;-) If I try with cheese I get the following two crashes, I then tried with qv4l2 again (no reboot) and got the final crash, basically once cheese/gstreamer pokes it tht's it and it doesn't come back. The "Comm: v4l2src0:src" are the cheese/gstreamer crash. [ 26.013706] vchiq: module is from the staging directory, the quality is unknown, you have been warned. [ 26.040943] vchiq: vchiq_init_state: slot_zero = 415842fa, is_master = 0 [ 26.937936] media: Linux media interface: v0.10 [ 27.052339] videodev: Linux video capture interface: v2.00 [ 27.351732] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned. [ 27.385975] bcm2835_audio bcm2835_audio: card created with 8 channels [ 27.406702] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned. [ 28.059932] bcm2835-v4l2: scene mode selected 0, was 0 [ 28.061098] bcm2835-v4l2: V4L2 device registered as video0 - stills mode > 1280x720 [ 28.074773] bcm2835-v4l2: Broadcom 2835 MMAL video capture ver 0.0.2 loaded. [ 78.307961] bcm2835_audio bcm2835_audio: vchi message timeout, msg=5 [ 138.790296] bcm2835-v4l2: Failed to enable capture port - error -1. Disabling camera port again [ 138.818456] ------------[ cut here ]------------ [ 138.823246] WARNING: CPU: 2 PID: 1464 at drivers/media/common/videobuf2/videobuf2-core.c:1471 vb2_start_streaming+0xb4/0x12c [videobuf2_common] [ 138.836377] Modules linked in: fuse ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat ip6table_nat nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat_ipv4 nf_nat iptable_mangle iptable_raw iptable_security nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip_set nfnetlink ebtable_filter ebtables ip6table_filter ip6_tables cmac bnep sunrpc vfat fat vc4 snd_soc_core bcm2835_v4l2(C) snd_bcm2835(C) videobuf2_vmalloc ac97_bus snd_pcm_dmaengine videobuf2_memops videobuf2_v4l2 snd_seq videobuf2_common snd_seq_device snd_pcm v4l2_common videodev brcmfmac media snd_timer snd brcmutil soundcore drm_kms_helper cfg80211 drm hci_uart fb_sys_fops syscopyarea btqca sysfillrect btbcm joydev sysimgblt btintel bluetooth raspberrypi_hwmon ecdh_generic rfkill vchiq(C) bcm2835_thermal bcm2835_rng bcm2835_wdt leds_gpio cpufreq_dt lz4 lz4_compress zram hid_logitech_hidpp hid_logitech_dj smsc95xx usbnet mii mmc_block sdhci_iproc dwc2 crc32_arm_ce sdhci_pltfm [ 138.836522] gpio_raspberrypi_exp udc_core sdhci pwm_bcm2835 i2c_bcm2835 bcm2835 bcm2835_dma phy_generic [ 138.934289] CPU: 2 PID: 1464 Comm: v4l2src0:src Tainted: G C 4.20.1-200.fc29.armv7hl #1 [ 138.943729] Hardware name: BCM2835 [ 138.947196] [<c03127a4>] (unwind_backtrace) from [<c030cbf0>] (show_stack+0x18/0x1c) [ 138.955058] [<c030cbf0>] (show_stack) from [<c0b14f80>] (dump_stack+0x80/0xa0) [ 138.962390] [<c0b14f80>] (dump_stack) from [<c03507b4>] (__warn+0xdc/0xf8) [ 138.969366] [<c03507b4>] (__warn) from [<c0350b28>] (warn_slowpath_null+0x40/0x4c) [ 138.977070] [<c0350b28>] (warn_slowpath_null) from [<bf70b2d4>] (vb2_start_streaming+0xb4/0x12c [videobuf2_common]) [ 138.987713] [<bf70b2d4>] (vb2_start_streaming [videobuf2_common]) from [<bf70c78c>] (vb2_core_streamon+0x110/0x138 [videobuf2_common]) [ 139.000054] [<bf70c78c>] (vb2_core_streamon [videobuf2_common]) from [<bf681a34>] (__video_do_ioctl+0x35c/0x494 [videodev]) [ 139.011453] [<bf681a34>] (__video_do_ioctl [videodev]) from [<bf68219c>] (video_usercopy+0x508/0x5d4 [videodev]) [ 139.021827] [<bf68219c>] (video_usercopy [videodev]) from [<c04ffae8>] (vfs_ioctl+0x28/0x3c) [ 139.030391] [<c04ffae8>] (vfs_ioctl) from [<c0500308>] (do_vfs_ioctl+0x8c/0x838) [ 139.037896] [<c0500308>] (do_vfs_ioctl) from [<c0500b0c>] (ksys_ioctl+0x58/0x74) [ 139.045398] [<c0500b0c>] (ksys_ioctl) from [<c0301000>] (ret_fast_syscall+0x0/0x54) [ 139.053160] Exception stack(0xd0b2ffa8 to 0xd0b2fff0) [ 139.058281] ffa0: 00000000 aa812138 0000001e 40045612 01658708 b590cd10 [ 139.066577] ffc0: 00000000 aa812138 ab8af99c 00000036 00000020 b6f388f8 01658700 aa80cc90 [ 139.074869] ffe0: b5b4dcec a69fa974 ab8786f4 b590cd1c [ 139.080031] ---[ end trace eed7fb71749a2e2c ]--- [ 139.211923] bcm2835-v4l2: vidioc_s_fmt_vid_cap device busy [ 177.331656] bcm2835-v4l2: Failed to enable capture port - error -1. Disabling camera port again [ 177.362943] ------------[ cut here ]------------ [ 177.367736] WARNING: CPU: 1 PID: 1531 at drivers/media/common/videobuf2/videobuf2-core.c:1471 vb2_start_streaming+0xb4/0x12c [videobuf2_common] [ 177.380847] Modules linked in: fuse ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat ip6table_nat nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat_ipv4 nf_nat iptable_mangle iptable_raw iptable_security nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip_set nfnetlink ebtable_filter ebtables ip6table_filter ip6_tables cmac bnep sunrpc vfat fat vc4 snd_soc_core bcm2835_v4l2(C) snd_bcm2835(C) videobuf2_vmalloc ac97_bus snd_pcm_dmaengine videobuf2_memops videobuf2_v4l2 snd_seq videobuf2_common snd_seq_device snd_pcm v4l2_common videodev brcmfmac media snd_timer snd brcmutil soundcore drm_kms_helper cfg80211 drm hci_uart fb_sys_fops syscopyarea btqca sysfillrect btbcm joydev sysimgblt btintel bluetooth raspberrypi_hwmon ecdh_generic rfkill vchiq(C) bcm2835_thermal bcm2835_rng bcm2835_wdt leds_gpio cpufreq_dt lz4 lz4_compress zram hid_logitech_hidpp hid_logitech_dj smsc95xx usbnet mii mmc_block sdhci_iproc dwc2 crc32_arm_ce sdhci_pltfm [ 177.381107] gpio_raspberrypi_exp udc_core sdhci pwm_bcm2835 i2c_bcm2835 bcm2835 bcm2835_dma phy_generic [ 177.479003] CPU: 1 PID: 1531 Comm: v4l2src0:src Tainted: G WC 4.20.1-200.fc29.armv7hl #1 [ 177.488452] Hardware name: BCM2835 [ 177.491936] [<c03127a4>] (unwind_backtrace) from [<c030cbf0>] (show_stack+0x18/0x1c) [ 177.499807] [<c030cbf0>] (show_stack) from [<c0b14f80>] (dump_stack+0x80/0xa0) [ 177.507148] [<c0b14f80>] (dump_stack) from [<c03507b4>] (__warn+0xdc/0xf8) [ 177.514137] [<c03507b4>] (__warn) from [<c0350b28>] (warn_slowpath_null+0x40/0x4c) [ 177.521863] [<c0350b28>] (warn_slowpath_null) from [<bf70b2d4>] (vb2_start_streaming+0xb4/0x12c [videobuf2_common]) [ 177.532507] [<bf70b2d4>] (vb2_start_streaming [videobuf2_common]) from [<bf70c78c>] (vb2_core_streamon+0x110/0x138 [videobuf2_common]) [ 177.544926] [<bf70c78c>] (vb2_core_streamon [videobuf2_common]) from [<bf681a34>] (__video_do_ioctl+0x35c/0x494 [videodev]) [ 177.556424] [<bf681a34>] (__video_do_ioctl [videodev]) from [<bf68219c>] (video_usercopy+0x508/0x5d4 [videodev]) [ 177.566859] [<bf68219c>] (video_usercopy [videodev]) from [<c04ffae8>] (vfs_ioctl+0x28/0x3c) [ 177.575434] [<c04ffae8>] (vfs_ioctl) from [<c0500308>] (do_vfs_ioctl+0x8c/0x838) [ 177.582949] [<c0500308>] (do_vfs_ioctl) from [<c0500b0c>] (ksys_ioctl+0x58/0x74) [ 177.590465] [<c0500b0c>] (ksys_ioctl) from [<c0301000>] (ret_fast_syscall+0x0/0x54) [ 177.598233] Exception stack(0xc9e49fa8 to 0xc9e49ff0) [ 177.603363] 9fa0: 00000000 aa9100e8 0000001f 40045612 011a78a0 b59aed10 [ 177.611666] 9fc0: 00000000 aa9100e8 ab9c899c 00000036 00000020 b6fda8f8 011a7898 aa907720 [ 177.619967] 9fe0: b5befcec a6afa974 ab9916f4 b59aed1c [ 177.625167] ---[ end trace eed7fb71749a2e2d ]--- [ 177.761663] bcm2835-v4l2: vidioc_s_fmt_vid_cap device busy [ 218.865174] Unable to handle kernel NULL pointer dereference at virtual address 00000001 [ 218.873455] pgd = 4a1eb2da [ 218.876252] [00000001] *pgd=00000000 [ 218.879920] Internal error: Oops: 5 [#1] SMP ARM [ 218.884610] Modules linked in: fuse ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ebtable_nat ip6table_nat nf_nat_ipv6 ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat_ipv4 nf_nat iptable_mangle iptable_raw iptable_security nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c ip_set nfnetlink ebtable_filter ebtables ip6table_filter ip6_tables cmac bnep sunrpc vfat fat vc4 snd_soc_core bcm2835_v4l2(C) snd_bcm2835(C) videobuf2_vmalloc ac97_bus snd_pcm_dmaengine videobuf2_memops videobuf2_v4l2 snd_seq videobuf2_common snd_seq_device snd_pcm v4l2_common videodev brcmfmac media snd_timer snd brcmutil soundcore drm_kms_helper cfg80211 drm hci_uart fb_sys_fops syscopyarea btqca sysfillrect btbcm joydev sysimgblt btintel bluetooth raspberrypi_hwmon ecdh_generic rfkill vchiq(C) bcm2835_thermal bcm2835_rng bcm2835_wdt leds_gpio cpufreq_dt lz4 lz4_compress zram hid_logitech_hidpp hid_logitech_dj smsc95xx usbnet mii mmc_block sdhci_iproc dwc2 crc32_arm_ce sdhci_pltfm [ 218.884870] gpio_raspberrypi_exp udc_core sdhci pwm_bcm2835 i2c_bcm2835 bcm2835 bcm2835_dma phy_generic [ 218.982626] CPU: 3 PID: 1552 Comm: qv4l2 Tainted: G WC 4.20.1-200.fc29.armv7hl #1 [ 218.991458] Hardware name: BCM2835 [ 218.994955] PC is at vchiq_mmal_port_enable+0x90/0x138 [bcm2835_v4l2] [ 219.001501] LR is at _cond_resched+0x48/0x50 [ 219.005831] pc : [<bf793ec0>] lr : [<c0b2a8b4>] psr: 00070013 [ 219.012209] sp : c6727d90 ip : 002dc121 fp : 00000001 [ 219.017518] r10: bf69a200 r9 : df278004 r8 : dffe6380 [ 219.022821] r7 : df278000 r6 : bf79a880 r5 : bf78f600 r4 : df278490 [ 219.029443] r3 : 00000001 r2 : df278518 r1 : 00000001 r0 : 00000000 [ 219.036069] Flags: nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 219.043309] Control: 10c5383d Table: 1276806a DAC: 00000051 [ 219.049145] Process qv4l2 (pid: 1552, stack limit = 0x266508dd) [ 219.055151] Stack: (0xc6727d90 to 0xc6728000) [ 219.059578] 7d80: df278000 df278490 bf78f600 dffe6000 [ 219.067885] 7da0: dffe6660 bf79a880 bf67da08 dffe6380 c6727e78 bf69a200 00000001 bf78fa54 [ 219.076189] 7dc0: c6727dcc 00000004 d090ee78 00000008 dffe6528 dffe64dc dffe6624 bf70b28c [ 219.084493] 7de0: dffe6528 00000000 dffe6058 bf67da08 dffe6380 bf70c78c 40045612 bf681a34 [ 219.092800] 7e00: c6727e2c c04babdc e39a99bc bf7951f4 c328d200 00000000 d6be1b40 c328d200 [ 219.101103] 7e20: c124f850 00000004 c6727e7c c04c0b90 c6727e78 c031691c c6727e78 00000000 [ 219.109407] 7e40: c6727e78 00000000 bf6816d8 40045612 00000000 00000004 00000000 bf68219c [ 219.117710] 7e60: 0007ffff 00000000 00000000 bedf8368 d6be1b40 00000001 00000001 00000001 [ 219.126015] 7e80: 00000000 00002003 00000000 00000000 00000000 00000000 00000000 00000000 [ 219.134318] 7ea0: 00000000 00000000 00000001 05cf1000 01efb000 00000000 00000000 00000000 [ 219.142623] 7ec0: 00002000 00000000 a1743000 e27e93c0 c3a1d738 c3a1d730 a1743000 c049bad0 [ 219.150926] 7ee0: 00000001 00000003 01efb000 c0b2a8b4 00000000 c0b2a8b4 df801c30 bedf8368 [ 219.159230] 7f00: df801c30 d6be1b40 40045612 bedf8368 0000000c 00000036 00000000 c04ffae8 [ 219.167532] 7f20: bedf8368 c0500308 00000001 00000056 00000012 c6727f48 00000001 e31dd210 [ 219.175837] 7f40: c3400bb0 c6725612 c6727f0b c6727f3c 2262e000 00000000 c6727f58 c126ab28 [ 219.184141] 7f60: d6be1b40 40045612 00000000 d6be1b40 d6be1b41 40045612 bedf8368 0000000c [ 219.192445] 7f80: 00000036 c0500b0c 47d64200 b5f11000 40045612 00000036 c0301204 c6726000 [ 219.200750] 7fa0: 00000036 c0301000 47d64200 b5f11000 0000000c 40045612 bedf8368 00000001 [ 219.209053] 7fc0: 47d64200 b5f11000 40045612 00000036 b5e74e40 0000000c b6f34508 00000000 [ 219.217357] 7fe0: bedf8368 bedf8358 b5efa804 b5bce1f0 400f0010 0000000c 00000000 00000000 [ 219.225785] [<bf793ec0>] (vchiq_mmal_port_enable [bcm2835_v4l2]) from [<bf78fa54>] (start_streaming+0x124/0x1f0 [bcm2835_v4l2]) [ 219.237498] [<bf78fa54>] (start_streaming [bcm2835_v4l2]) from [<bf70b28c>] (vb2_start_streaming+0x6c/0x12c [videobuf2_common]) [ 219.249221] [<bf70b28c>] (vb2_start_streaming [videobuf2_common]) from [<bf70c78c>] (vb2_core_streamon+0x110/0x138 [videobuf2_common]) [ 219.261644] [<bf70c78c>] (vb2_core_streamon [videobuf2_common]) from [<bf681a34>] (__video_do_ioctl+0x35c/0x494 [videodev]) [ 219.273142] [<bf681a34>] (__video_do_ioctl [videodev]) from [<bf68219c>] (video_usercopy+0x508/0x5d4 [videodev]) [ 219.283585] [<bf68219c>] (video_usercopy [videodev]) from [<c04ffae8>] (vfs_ioctl+0x28/0x3c) [ 219.292163] [<c04ffae8>] (vfs_ioctl) from [<c0500308>] (do_vfs_ioctl+0x8c/0x838) [ 219.299678] [<c0500308>] (do_vfs_ioctl) from [<c0500b0c>] (ksys_ioctl+0x58/0x74) [ 219.307193] [<c0500b0c>] (ksys_ioctl) from [<c0301000>] (ret_fast_syscall+0x0/0x54) [ 219.314966] Exception stack(0xc6727fa8 to 0xc6727ff0) [ 219.320095] 7fa0: 47d64200 b5f11000 0000000c 40045612 bedf8368 00000001 [ 219.328400] 7fc0: 47d64200 b5f11000 40045612 00000036 b5e74e40 0000000c b6f34508 00000000 [ 219.336699] 7fe0: bedf8368 bedf8358 b5efa804 b5bce1f0 [ 219.341831] Code: e1a00007 ebfffbd4 e1a01000 ea000007 (e5911000) [ 219.348216] ---[ end trace eed7fb71749a2e2e ]---
Hi Peter, > Peter Robinson <pbrobinson@gmail.com> hat am 10. Januar 2019 um 07:34 geschrieben: > > > > > Hi Stefan, > > > > > ... > > > > > > I get difference results with 5.0-rc1 but neither of the above apps > > > work either, will follow up based on the rest of the thread there. > > > > > > > My first step with Raspbian is to enable the Camera interface which results into an appending of the following lines to config.txt: > > > > start_x=1 > > gpu_mem=128 > > > > AFAIK a smaller value for gpu_mem wont work. Please provide your settings which results in this crash. > > start_x=1 > gpu_mem=64 even with those settings i'm getting a picture in qv4l2 (v1.12.3) and no crash. According to dmesg i also have 64M reserved for CMA. How many do you have? Does your qc4l2 make use of OpenGL (not in my case)? Stefan
Hi Stefan, > > > > I get difference results with 5.0-rc1 but neither of the above apps > > > > work either, will follow up based on the rest of the thread there. > > > > > > > > > > My first step with Raspbian is to enable the Camera interface which results into an appending of the following lines to config.txt: > > > > > > start_x=1 > > > gpu_mem=128 > > > > > > AFAIK a smaller value for gpu_mem wont work. Please provide your settings which results in this crash. > > > > start_x=1 > > gpu_mem=64 > > even with those settings i'm getting a picture in qv4l2 (v1.12.3) and no crash. > > According to dmesg i also have 64M reserved for CMA. How many do you have? I have 192Mb of CMA with LXDE, the vc4 driver uses CMA rather than the gpu_mem via the firmware so that's what we set it to (and to 256Mb for GNOME) > Does your qc4l2 make use of OpenGL (not in my case)? Yes, mine does. The crash with qv4l2 was only when I tried Cheese first, if I reboot and just use qv4l2 it works fine when configured with 128Mb without any crash. Which display driver are you using? Are you using vc4 or the proprietary closed one? With vc4 using cma rather than gpu_mem I wonder if we can reduce the amount needed there, but in the interim I've at least now got picture output when using purely qv4l2 and a reserve of 128Mb I'm not sure quite what gstreamer1/cheese is doing to cause that crash. Peter
Hi Peter On Fri, 11 Jan 2019 at 06:10, Peter Robinson <pbrobinson@gmail.com> wrote: > > Hi Stefan, > > > > > > I get difference results with 5.0-rc1 but neither of the above apps > > > > > work either, will follow up based on the rest of the thread there. > > > > > > > > > > > > > My first step with Raspbian is to enable the Camera interface which results into an appending of the following lines to config.txt: > > > > > > > > start_x=1 > > > > gpu_mem=128 > > > > > > > > AFAIK a smaller value for gpu_mem wont work. Please provide your settings which results in this crash. > > > > > > start_x=1 > > > gpu_mem=64 > > > > even with those settings i'm getting a picture in qv4l2 (v1.12.3) and no crash. > > > > According to dmesg i also have 64M reserved for CMA. How many do you have? > > I have 192Mb of CMA with LXDE, the vc4 driver uses CMA rather than the > gpu_mem via the firmware so that's what we set it to (and to 256Mb for > GNOME) As Stefan says, with Raspbian the default gpu_mem to use the camera is 128MB. The memory required depends on your use case as it includes the buffers for the output images. Checking on a running system, a V2 camera streaming 1080P YU12 with 3 V4L2 buffers is using 58MB of gpu_mem for the camera stack. H264 encode isntead of YU12 and it's around 63MB. With the vc4 driver loaded there's only a small number of other allocations left from the gpu_mem heap, so it's around the 70MB mark that will be the minimum to get the camera running. > > Does your qc4l2 make use of OpenGL (not in my case)? > > Yes, mine does. The crash with qv4l2 was only when I tried Cheese > first, if I reboot and just use qv4l2 it works fine when configured > with 128Mb without any crash. Which display driver are you using? Are > you using vc4 or the proprietary closed one? With vc4 using cma rather > than gpu_mem I wonder if we can reduce the amount needed there, but in > the interim I've at least now got picture output when using purely > qv4l2 and a reserve of 128Mb > > I'm not sure quite what gstreamer1/cheese is doing to cause that crash. Can you confirm what resolution and format they are using in your failure case? "v4l2-ctl -V" after they've been run will tell you. Your earlier request: > As a side note it would be a useful debug feature from a support PoV > if the following line could also note which firmware is loaded: > > [ 8.087691] raspberrypi-firmware soc:firmware: Attached to firmware > from 2019-01-09 20:07 > > Something like "attached to extended/reduced/whatecer firmware from XXXX-XX-XX" A very valid suggestion. I've made the firmware changes to advertise the build variant and firmware hash via the mailbox service, and that should be in the next firmware release. Pull request https://github.com/raspberrypi/linux/pull/2806 has added the Linux kernel changes to our kernel rpi-4.19.y branch. With the updated firmware, "vcgencmd version" will also report the build variant for you. Dave
> > > > > > I get difference results with 5.0-rc1 but neither of the above apps > > > > > > work either, will follow up based on the rest of the thread there. > > > > > > > > > > > > > > > > My first step with Raspbian is to enable the Camera interface which results into an appending of the following lines to config.txt: > > > > > > > > > > start_x=1 > > > > > gpu_mem=128 > > > > > > > > > > AFAIK a smaller value for gpu_mem wont work. Please provide your settings which results in this crash. > > > > > > > > start_x=1 > > > > gpu_mem=64 > > > > > > even with those settings i'm getting a picture in qv4l2 (v1.12.3) and no crash. > > > > > > According to dmesg i also have 64M reserved for CMA. How many do you have? > > > > I have 192Mb of CMA with LXDE, the vc4 driver uses CMA rather than the > > gpu_mem via the firmware so that's what we set it to (and to 256Mb for > > GNOME) > > As Stefan says, with Raspbian the default gpu_mem to use the camera is 128MB. > The memory required depends on your use case as it includes the > buffers for the output images. > Checking on a running system, a V2 camera streaming 1080P YU12 with 3 > V4L2 buffers is using 58MB of gpu_mem for the camera stack. H264 > encode isntead of YU12 and it's around 63MB. > With the vc4 driver loaded there's only a small number of other > allocations left from the gpu_mem heap, so it's around the 70MB mark > that will be the minimum to get the camera running. > > > > Does your qc4l2 make use of OpenGL (not in my case)? > > > > Yes, mine does. The crash with qv4l2 was only when I tried Cheese > > first, if I reboot and just use qv4l2 it works fine when configured > > with 128Mb without any crash. Which display driver are you using? Are > > you using vc4 or the proprietary closed one? With vc4 using cma rather > > than gpu_mem I wonder if we can reduce the amount needed there, but in > > the interim I've at least now got picture output when using purely > > qv4l2 and a reserve of 128Mb > > > > I'm not sure quite what gstreamer1/cheese is doing to cause that crash. > > Can you confirm what resolution and format they are using in your > failure case? "v4l2-ctl -V" after they've been run will tell you. Format Video Capture: Width/Height : 3280/2464 Pixel Format : 'BGR4' (32-bit BGRA/X 8-8-8-8) Field : None Bytes per Line : 13184 Size Image : 32485376 Colorspace : SMPTE 170M Transfer Function : Default (maps to Rec. 709) YCbCr/HSV Encoding: Default (maps to ITU-R 601) Quantization : Default (maps to Full Range) Flags : > Your earlier request: > > As a side note it would be a useful debug feature from a support PoV > > if the following line could also note which firmware is loaded: > > > > [ 8.087691] raspberrypi-firmware soc:firmware: Attached to firmware > > from 2019-01-09 20:07 > > > > Something like "attached to extended/reduced/whatecer firmware from XXXX-XX-XX" > > A very valid suggestion. > I've made the firmware changes to advertise the build variant and > firmware hash via the mailbox service, and that should be in the next > firmware release. > Pull request https://github.com/raspberrypi/linux/pull/2806 has added > the Linux kernel changes to our kernel rpi-4.19.y branch. > With the updated firmware, "vcgencmd version" will also report the > build variant for you. > > Dave