Functional testing of mainline vchiq driver

Michael Zoran mzoran at crowfest.net
Tue Oct 25 14:45:11 PDT 2016


On Tue, 2016-10-25 at 23:20 +0200, Stefan Wahren wrote:
> 
> thanks, here are my steps to get the driver working:
> 
> * checkout Greg's staging-testing tree
> * applied "staging: vc04_services: Remove dmac_map_area"
> * remove BROKEN in drivers/staging/vc04_services/Kconfig
> * add the following node to arch/arm/boot/dts/bcm283x.dtsi
> 
>                vchiq: vchiq at 7e00b840 {
>                        compatible = "brcm,bcm2835-vchiq";
>                        reg = <0x7e00b840 0xf>;
>                        interrupts = <0 2>;
>                        cache-line-size = <32>;
>                        firmware = <&firmware>;
>                };
> 
> * build kernel and dtb for Raspberry Pi B
> 
> After these steps the vchiq driver was probed and /dev/vchiq is
> available.
> 
> Unfortunately the vchiq_test behave strange and mostly hangs. Here
> some outputs:
> 
> $ vchiq_test -f 10
> Functional test - iters:10
> ======== iteration 1 ========
> ======== iteration 2 ========
> ======== iteration 3 ========
> ======== iteration 4 ========
> <vchiq_test hangs>
> 
> $ vchiq_test -f 10
> Functional test - iters:10
> ======== iteration 1 ========
> ======== iteration 2 ========
> vchiq_test: 1504: expected userdata 1, got 2
> vchiq_test: pthread_mutex_lock.c:80: __pthread_mutex_lock: Assertion
> `mutex->__data.__owner == 0' failed.
> 
> $ vchiq_test -f 10
> Functional test - iters:10
> ======== iteration 1 ========
> ======== iteration 2 ========
> ======== iteration 3 ========
> ======== iteration 4 ========
> vchiq_test: 1504: expected userdata 1, got 2
> <vchiq_test hangs>
> 
> I've used strace on vchiq_test and it seems the application call
> three different
> ioctls in a endless loop:
> 
> ...
> ioctl(3, 0x400cc404, 0xbea36afc)        = 0
> ioctl(3, 0xc014c406, 0xbea36af4)        = 0
> ioctl(3, 0xc014c405, 0xbea36af4)        = 0
> ioctl(3, 0x400cc404, 0xbea36afc)        = 0
> ioctl(3, 0xc014c406, 0xbea36af4)        = 0
> ioctl(3, 0xc014c405, 0xbea36af4)        = 0
> ioctl(3, 0x400cc404, 0xbea36afc)        = 0
> ioctl(3, 0xc014c406, 0xbea36af4)        = 0
> ioctl(3, 0xc014c405, 0xbea36af4)        = 0
> ioctl(3, 0x400cc404, 0xbea36afc)        = 0
> ioctl(3, 0xc014c406, 0xbea36af4)        = 0
> ....
> 
> 

Very interesting because vchiq_test -f 10 works on my build.  I'm using
a RPI 3 running raspbian with my build of the kernel in arm32 mode.

If you give me some time, I will rebuild directly out of the branch and
  run the test again.

Please note, some changes seem to have happened recently to
get_user_pages which is breaking compiling in some branches.


> > 
> > The downstream kernel has been ported to 4.9 so it should be very
> > close
> > to the same source tree as mainline though.
> > 
> 
> I don't think that's a step forward. The tests should be done in
> mainline.


I agree that's best.  I thought the broadcom vc charater device was
required.  Now that I know, I will test locally directly from the
staging tree.





More information about the linux-rpi-kernel mailing list