Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-11 Thread Peter Robinson
> > > > > > 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 
> > -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
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-11 Thread Dave Stevenson
Hi Peter

On Fri, 11 Jan 2019 at 06:10, Peter Robinson  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 
> -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
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-10 Thread Peter Robinson
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
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-10 Thread Stefan Wahren
Hi Peter,

> Peter Robinson  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
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-09 Thread Peter Robinson
> > 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
C4.20.1-200.fc29.armv7hl #1
[  138.943729] Hardware name: BCM2835
[  138.947196] [] (unwind_backtrace) from []
(show_stack+0x18/0x1c)
[  138.955058] [] (show_stack) from []
(dump_stack+0x80/0xa0)
[  138.962390] [] (dump_stack) from [] (__warn+0xdc/0xf8)
[  138.969366] [] (__warn) from []
(warn_slowpath_null+0x40/0x4c)
[  138.977070] [] (warn_slowpath_null) from []
(vb2_start_streaming+0xb4/0x12c [videobuf2_common])
[  138.987713] [] (vb2_start_streaming [videobuf2_common])
from [] (vb2_core_streamon+0x110/0x138 [videobuf2_common])
[  139.54] [] (vb2_core_streamon [videobuf2_common])
from [] (__video_do_ioctl+0x35c/0x494 [videodev])
[  139.011453] [] (__video_do_ioctl [videodev]) from
[] (video_usercopy+0x508/0x5d4 [videodev])
[  139.021827] [] (video_usercopy [videodev]) from
[] (vfs_ioctl+0x28/0x3c)
[  139.030391] [] (vfs_ioctl) from []
(do_vfs_ioctl+0x8c/0x838)
[  139.037896] [] (do_vfs_ioctl) from []
(ksys_ioctl+0x58/0x74)
[  139.045398] [] (ksys_ioctl) from []
(ret_fast_syscall+0x0/0x54)
[  139.053160] Exception stack(0xd0b2ffa8 to 0xd0b2fff0)
[  139.058281] ffa0:    aa812138 001e
40045612 01658708 b590cd10
[  139.066577] ffc0:  aa812138 ab8af99c 0036 0020
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 

Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-09 Thread Peter Robinson
> > 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
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-09 Thread Stefan Wahren


> Peter Robinson  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.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-09 Thread Peter Robinson
 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 -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
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-09 Thread Peter Robinson
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] [] (unwind_backtrace) from []
(show_stack+0x18/0x1c)
[  118.659156] [] (show_stack) from []
(dump_stack+0x80/0xa0)
[  118.666488] [] (dump_stack) from [] (__warn+0xdc/0xf8)
[  118.673466] [] (__warn) from []
(warn_slowpath_null+0x40/0x4c)
[  118.681168] [] (warn_slowpath_null) from []
(vb2_start_streaming+0xb4/0x12c [videobuf2_common])
[  118.691810] [] (vb2_start_streaming [videobuf2_common])
from [] (vb2_core_streamon+0x110/0x138 [videobuf2_common])
[  118.704152] [] (vb2_core_streamon [videobuf2_common])
from [] (__video_do_ioctl+0x35c/0x494 [videodev])
[  118.715546] [] (__video_do_ioctl [videodev]) from
[] (video_usercopy+0x508/0x5d4 [videodev])
[  118.725923] [] (video_usercopy [videodev]) from
[] (vfs_ioctl+0x28/0x3c)
[  118.734487] [] (vfs_ioctl) from []
(do_vfs_ioctl+0x8c/0x838)
[  118.741990] [] (do_vfs_ioctl) from []
(ksys_ioctl+0x58/0x74)
[  118.749495] [] (ksys_ioctl) from []
(ret_fast_syscall+0x0/0x54)
[  118.757259] Exception stack(0xd940dfa8 to 0xd940dff0)
[  118.762382] dfa0:   d47c8700 b5f1e000 000c
40045612 befb42a0 0001
[  118.770678] dfc0: d47c8700 b5f1e000 40045612 0036 b5e81e40
000c b6f41508 
[  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 

Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-09 Thread Nicolas Saenz Julienne
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


signature.asc
Description: This is a digitally signed message part
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-09 Thread Stefan Wahren
Hi,

[add Arnd]

> Dave Stevenson  hat am 8. Januar 2019 um 18:10
> geschrieben:
> 
> 
> Hi Peter
> 
> On Tue, 8 Jan 2019 at 07:21, Peter Robinson  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] [] (unwind_backtrace) from []
(show_stack+0x10/0x14)
[  238.330373] [] (show_stack) from []
(dump_stack+0x8c/0xa0)
[  238.330388] [] (dump_stack) from [] (__warn+0xe0/0xf8)
[  238.330401] [] (__warn) from []
(warn_slowpath_null+0x40/0x48)
[  238.330421] [] (warn_slowpath_null) from []
(__vb2_queue_cancel+0x1d8/0x24c [videobuf2_common])
[  238.330466] [] (__vb2_queue_cancel [videobuf2_common]) from
[] (vb2_core_queue_release+0x18/0x38 [videobuf2_common])
[  238.330490] [] (vb2_core_queue_release [videobuf2_common]) from
[] (_vb2_fop_release+0x74/0x84 [videobuf2_v4l2])
[  238.330533] [] (_vb2_fop_release [videobuf2_v4l2]) from
[] (v4l2_release+0x94/0xd8 [videodev])
[  238.330571] [] (v4l2_release [videodev]) from []
(__fput+0x84/0x1c8)
[  238.330588] [] (__fput) from [] (task_work_run+0xa8/0xcc)
[  238.330604] [] (task_work_run) from []
(do_exit+0x3a4/0xa90)
[  238.330618] [] (do_exit) from []
(do_group_exit+0x3c/0xd0)
[  238.330634] [] (do_group_exit) from []
(get_signal+0x24c/0x6d8)
[  238.330647] [] (get_signal) from []
(do_work_pending+0x150/0x5a8)
[  238.330659] [] (do_work_pending) from []
(slow_work_pending+0xc/0x20)
[  238.330665] Exception stack(0xe589ffb0 to 0xe589fff8)
[  238.330674] ffa0: ab203ea0 0002
 
[  238.330685] ffc0: 0008 0002 ab203ea0 0150  009bfd80
 
[  238.330695] ffe0: ab1fe54c ab1fe558  b6155d68 8010 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
___
devel mailing list
de...@linuxdriverproject.org

Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-08 Thread Dave Stevenson
Hi Peter

On Tue, 8 Jan 2019 at 07:21, Peter Robinson  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] [] (unwind_backtrace) from []
> (show_stack+0x18/0x1c)
> [  231.268013] [] (show_stack) from []
> (dump_stack+0x80/0xa0)
> [  231.275357] [] (dump_stack) from [] (__warn+0xdc/0xf8)
> [  231.282349] [] (__warn) from []
> (warn_slowpath_null+0x40/0x4c)
> [  231.290067] [] (warn_slowpath_null) from []
> (vb2_start_streaming+0xb4/0x12c [videobuf2_common])
> [  231.300747] [] (vb2_start_streaming [videobuf2_common])
> from [] (vb2_core_streamon+0x110/0x138 [videobuf2_common])
> [  231.313166] [] (vb2_core_streamon [videobuf2_common])
> from [] (__video_do_ioctl+0x35c/0x494 [videodev])
> [  231.324681] [] (__video_do_ioctl [videodev]) from
> [] (video_usercopy+0x508/0x5d4 [videodev])
> [  231.335120] [] (video_usercopy [videodev]) from
> [] (vfs_ioctl+0x28/0x3c)
> [  231.343697] [] (vfs_ioctl) from []
> (do_vfs_ioctl+0x8c/0x838)
> [  231.351212] [] (do_vfs_ioctl) from []
> (ksys_ioctl+0x58/0x74)
> [  231.358726] [] (ksys_ioctl) from []
> (ret_fast_syscall+0x0/0x54)
> [  231.366493] Exception stack(0xd7d53fa8 to 0xd7d53ff0)
> [  231.371623] 3fa0:   4a1bf700 b5edd000 000c
> 40045612 be905378 0001
> [  231.379930] 3fc0: 4a1bf700 b5edd000 40045612 0036 b5e40e40
> 000c b6f00508 
> [  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
> 

Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-08 Thread Stefan Wahren
Hi Peter,

> Peter Robinson  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-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-08 Thread Peter Robinson
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
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-08 Thread Stefan Wahren
Hi Peter,

> Peter Robinson  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
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2019-01-07 Thread Peter Robinson
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] [] (unwind_backtrace) from []
(show_stack+0x18/0x1c)
[  231.268013] [] (show_stack) from []
(dump_stack+0x80/0xa0)
[  231.275357] [] (dump_stack) from [] (__warn+0xdc/0xf8)
[  231.282349] [] (__warn) from []
(warn_slowpath_null+0x40/0x4c)
[  231.290067] [] (warn_slowpath_null) from []
(vb2_start_streaming+0xb4/0x12c [videobuf2_common])
[  231.300747] [] (vb2_start_streaming [videobuf2_common])
from [] (vb2_core_streamon+0x110/0x138 [videobuf2_common])
[  231.313166] [] (vb2_core_streamon [videobuf2_common])
from [] (__video_do_ioctl+0x35c/0x494 [videodev])
[  231.324681] [] (__video_do_ioctl [videodev]) from
[] (video_usercopy+0x508/0x5d4 [videodev])
[  231.335120] [] (video_usercopy [videodev]) from
[] (vfs_ioctl+0x28/0x3c)
[  231.343697] [] (vfs_ioctl) from []
(do_vfs_ioctl+0x8c/0x838)
[  231.351212] [] (do_vfs_ioctl) from []
(ksys_ioctl+0x58/0x74)
[  231.358726] [] (ksys_ioctl) from []
(ret_fast_syscall+0x0/0x54)
[  231.366493] Exception stack(0xd7d53fa8 to 0xd7d53ff0)
[  231.371623] 3fa0:   4a1bf700 b5edd000 000c
40045612 be905378 0001
[  231.379930] 3fc0: 4a1bf700 b5edd000 40045612 0036 b5e40e40
000c b6f00508 
[  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
[  

Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2018-10-28 Thread Stefan Wahren
Hi Nicolas,

> Nicolas Saenz Julienne  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 

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
[] really_probe+0x228/0x2d0
[<489d6b89>] driver_probe_device+0x60/0x164
[] __driver_attach+0xd0/0xd4
[<042acada>] bus_for_each_dev+0x74/0xb4
[] bus_add_driver+0x18c/0x210
[] driver_register+0x7c/0x114
[] 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>] 0x

> 
> Regards,
> Nicolas
> ___
> linux-arm-kernel mailing list
> linux-arm-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2018-10-26 Thread Nicolas Saenz Julienne
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 

Regards,
Nicolas


signature.asc
Description: This is a digitally signed message part
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RFC 00/11] staging: vc04_services: Improve driver load/unload

2018-10-25 Thread Stefan Wahren
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(-)

-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel