Functional testing of mainline vchiq driver

Stefan Wahren stefan.wahren at i2se.com
Tue Oct 25 14:20:03 PDT 2016


Hi Michael,

> Michael Zoran <mzoran at crowfest.net> hat am 25. Oktober 2016 um 16:45
> geschrieben:
> 
> 
> On Mon, 2016-10-24 at 18:09 +0200, Stefan Wahren wrote:
> > Hi,
> > 
> ...
> Hi,
> 
> Just to add some additional information...
> 
> 1) The source to vchiq_test is at:
> 	https://github.com/raspberrypi/userland
> 
>    That way it's possible to recompile it to add debugging
> information/symbols or to recompile it for a different architecture
> such as arm64.  It's also good if you don't/can't use Raspbian for some
> reason.
> 
> 2) I think vchiq_test requires the broadcom vc character device which
> isn't in mainline yet.  But I could be wrong.  So testing directly out
> of the mainline tree is somewhat difficult.

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
....


> 
> 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.



More information about the linux-rpi-kernel mailing list