cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
8,089 Views
Registered: ‎05-26-2015

Kernel Crash Using V4L2 with VDMA

Jump to solution

I'm trying to use master branch from linux-xlnx with an image sensor capture application on PL side but I get kernel crash during xvip dma initialization. I attached my boot log at the end of message.

 

I configure vdma in my dt like:

 

axi_vdma_0: dma@43000000 {
            #dma-cells = <1>;
            compatible = "xlnx,axi-vdma-1.00.a";
            interrupt-parent = <&intc>;
            reg = <0x43000000 0x10000>;
            xlnx,flush-fsync = <0x3>;
            xlnx,num-fstores = <0x1>;
            dma-channel@43000030 {
                compatible = "xlnx,axi-vdma-s2mm-channel";
                interrupts = <0 29 4>;
                xlnx,datawidth = <0x10>;
            };
        };

 

and V4L2 part is configured with:

 

axi_video_cap0 {
            compatible = "xlnx,video";
            dmas = <&axi_vdma_0 0>;
            dma-names = "port0";
            ports {
                #address-cells = <1>;
                    #size-cells = <0>;
                
                port@0 {
                    reg = <0>;
                    direction = "input";
                    vcap0_in: endpoint {
                        remote-endpoint = <&tpg0_out>;
                    };
                };
            };
        };

 

Same PL bitstream is working with 3.14 derivative kernel with a similar DT configuration.

 

Thanks,

Caglar

 


 

 

U-Boot 2014.01-00005-gc29bed9-dirty (Apr 13 2015 - 01:49:22)

I2C:   ready
Memory: ECC disabled
DRAM:  512 MiB
MMC:   zynq_sdhci: 0
SF: Detected S25FL128S_64K with page size 256 Bytes, erase size 64 KiB, total 16 MiB
In:    serial
Out:   serial
Err:   serial
Net:   Gem.e000b000
Hit any key to stop autoboot:  0
Device: zynq_sdhci
Manufacturer ID: 2
OEM: 544d
Name: SA02G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: No
Capacity: 1.9 GiB
Bus Width: 4-bit
reading uEnv.txt
** Unable to read file uEnv.txt **
Copying Linux from SD to RAM...
reading uImage
3483712 bytes read in 315 ms (10.5 MiB/s)
reading devicetree.dtb
10208 bytes read in 18 ms (553.7 KiB/s)
## Booting kernel from Legacy Image at 03000000 ...
   Image Name:   Linux-3.19.0-xilinx-13823-g08c52
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3483648 Bytes = 3.3 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02a00000
   Booting using the fdt blob at 0x2a00000
   Loading Kernel Image ... OK
   Loading Device Tree to 0dffa000, end 0dfff7df ... OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 3.19.0-xilinx-13823-g08c528a (caglar@caglar-server) (gcc version 4.9.2 (GCC) ) #21 SMP PREEMPT Thu May 28 20:21:39 EEST 2015
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Zynq ZYBO Development Board
cma: Reserved 16 MiB at 0x1f000000
Memory policy: Data cache writealloc
PERCPU: Embedded 9 pages/cpu @5ebd3000 s8128 r8192 d20544 u36864
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootwait
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 496188K/524288K available (4691K kernel code, 251K rwdata, 1636K rodata, 220K init, 207K bss, 11716K reserved, 16384K cma-reserved, 0K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0x60800000 - 0xff000000   (2536 MB)
    lowmem  : 0x40000000 - 0x60000000   ( 512 MB)
    pkmap   : 0x3fe00000 - 0x40000000   (   2 MB)
    modules : 0x3f000000 - 0x3fe00000   (  14 MB)
      .text : 0x40008000 - 0x40636168   (6329 kB)
      .init : 0x40637000 - 0x4066e000   ( 220 kB)
      .data &colon; 0x4066e000 - 0x406acca0   ( 252 kB)
       .bss : 0x406acca0 - 0x406e0bb8   ( 208 kB)
Preemptible hierarchical RCU implementation.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
slcr mapped to 60804000
zynq_clock_init: clkc starts at 60804100
Zynq clock init
sched_clock: 64 bits at 325MHz, resolution 3ns, wraps every 3383112499200ns
timer #0 at 60806000, irq=17
Console: colour dummy device 80x30
Calibrating delay loop... 1292.69 BogoMIPS (lpj=6463488)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x4719f8 - 0x471a50
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (2591.94 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0x60880000
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
Advanced Linux Sound Architecture Driver Initialized.
Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
jffs2: version 2.2. (NAND) (SUMMARY)  �© 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac:        DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
xilinx-vdma 43000000.dma: Xilinx AXI VDMA Engine Driver Probed!!
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 142, base_baud = 3125000) is a xuartps
console [ttyPS0] enabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to 6086c000
[drm] Initialized drm 1.1.0 20060810
brd: module loaded
loop: module loaded
CAN device driver interface
e1000e: Intel(R) PRO/1000 Network Driver - 2.3.2-k
e1000e: Copyright(c) 1999 - 2014 Intel Corporation.
libphy: XEMACPS mii bus: probed
xemacps e000b000.ethernet: pdev->id -1, baseaddr 0xe000b000, irq 143
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
Unable to handle kernel NULL pointer dereference at virtual address 00000048
pgd = 40004000
[00000048] *pgd=00000000
Internal error: Oops - BUG: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.19.0-xilinx-13823-g08c528a #21
Hardware name: Xilinx Zynq Platform
task: 5e42c9c0 ti: 5e44a000 task.ti: 5e44a000
PC is at dma_get_slave_channel+0x10/0x3c
LR is at dma_get_slave_channel+0x10/0x3c
pc : [<40209b58>]    lr : [<40209b58>]    psr: 60000113
sp : 5e44bd78  ip : 00000000  fp : 40686850
r10: 40686868  r9 : 00000001  r8 : 5e44be1a
r7 : 5ebee318  r6 : ffffffed  r5 : 00000000  r4 : 00000028
r3 : 5e42c9c0  r2 : 00000000  r1 : 5ddb6280  r0 : 406867b4
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 18c5387d  Table: 0000404a  DAC: 00000015
Process swapper/0 (pid: 1, stack limit = 0x5e44a238)
Stack: (0x5e44bd78 to 0x5e44c000)
bd60:                                                       5e44bd90 4020ad6c
bd80: 5e44bd90 5e44be04 5e44be1e 4dffc2ec 5ebed4b0 00000001 00000000 de44be19
bda0: 405c2e59 401cff58 00000000 0000000a ffffffff ffffffff 5e669a88 00000004
bdc0: ff0a000f ffffffff 5dd93424 5e66a810 00000000 00000000 00000001 5e66a810
bde0: 00000000 00000000 00000001 00000001 00000000 5e66aadc 5e66a818 40209d0c
be00: 5dd93410 4034f160 405c2e0a 00000000 20000113 5e66ab24 6f70373c 00307472
be20: 00000001 400b4e8c 00000001 5dd93410 4dffc348 5ebee57c 5e66a810 5dd93480
be40: 5dd9373c 5dd93748 00000001 4034f974 5e51ae00 5ebee464 4dffc348 00000000
be60: 406accc0 ffffffed 5e51ae10 406a1e7c 406a1e7c 00000000 406accc0 40663664
be80: 00000000 40267134 5e51ae10 406d425c 406a1e7c 40265cf8 5e51ae10 5e51ae44
bea0: 406a1e7c 4068b8a0 406796e0 40265ee4 00000000 406a1e7c 40265e7c 40264624
bec0: 5e49ef5c 5e5159b4 406a1e7c 00000000 5e508f80 402655bc 405c3163 405c3164
bee0: 00000000 406a1e7c 40652390 00000000 406796e0 402663e8 00000000 5e5bb080
bf00: 40652390 400088e0 5e49ac00 40476c40 406b37f8 00000000 00000000 400fe660
bf20: 4058b8b1 5e49ae80 00000000 4067d2b8 000000aa 00000000 5efffe39 40035920
bf40: 000000ab 00000006 00000006 000000aa 4067d2a0 00000006 000000ab 00000006
bf60: 000000ab 4066365c 4066a40c 406accc0 406accc0 40637d3c 00000006 00000006
bf80: 406374fc 5e44a000 00000000 4046a1a8 00000000 00000000 00000000 00000000
bfa0: 00000000 4046a1b0 00000000 4000dd00 00000000 00000000 00000000 00000000
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 fffbf3fa fff6fffa
[<40209b58>] (dma_get_slave_channel) from [<4020ad6c>] (of_dma_request_slave_channel+0x12c/0x178)
[<4020ad6c>] (of_dma_request_slave_channel) from [<40209d0c>] (dma_request_slave_channel+0x8/0x14)
[<40209d0c>] (dma_request_slave_channel) from [<4034f160>] (xvip_dma_init+0x1d0/0x290)
[<4034f160>] (xvip_dma_init) from [<4034f974>] (xvip_composite_probe+0x1c8/0x34c)
[<4034f974>] (xvip_composite_probe) from [<40267134>] (platform_drv_probe+0x48/0x98)
[<40267134>] (platform_drv_probe) from [<40265cf8>] (driver_probe_device+0x8c/0x1cc)
[<40265cf8>] (driver_probe_device) from [<40265ee4>] (__driver_attach+0x68/0x8c)
[<40265ee4>] (__driver_attach) from [<40264624>] (bus_for_each_dev+0x6c/0x90)
[<40264624>] (bus_for_each_dev) from [<402655bc>] (bus_add_driver+0xdc/0x1c4)
[<402655bc>] (bus_add_driver) from [<402663e8>] (driver_register+0x8c/0xd0)
[<402663e8>] (driver_register) from [<400088e0>] (do_one_initcall+0x100/0x180)
[<400088e0>] (do_one_initcall) from [<40637d3c>] (kernel_init_freeable+0x110/0x1d4)
[<40637d3c>] (kernel_init_freeable) from [<4046a1b0>] (kernel_init+0x8/0xe4)
[<4046a1b0>] (kernel_init) from [<4000dd00>] (ret_from_fork+0x14/0x34)
Code: e92d4010 e1a04000 e59f0028 eb099804 (e5943020)
---[ end trace 823432e71d472b92 ]---

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Visitor
Visitor
14,735 Views
Registered: ‎05-26-2015

Re: Kernel Crash Using V4L2 with VDMA

Jump to solution

I guess devicetree entry in my config for v4l2 device should be changed to:

 

dmas = <&axi_vdma_0 1>;

 

After this change, kernel doesn't panic. But VDMA is not firing interrupts in this case...

 

Kernel documentation mentions that channel id is '0' for write channel:

 

  "... where Channel ID is '0' for write/tx and '1' for read/rx ..."

 

However in VDMA notation write channel refers to s2mm transfers. Maybe kernel documentation may be updated to reflect this.

 

Caglar

View solution in original post

0 Kudos
1 Reply
Highlighted
Visitor
Visitor
14,736 Views
Registered: ‎05-26-2015

Re: Kernel Crash Using V4L2 with VDMA

Jump to solution

I guess devicetree entry in my config for v4l2 device should be changed to:

 

dmas = <&axi_vdma_0 1>;

 

After this change, kernel doesn't panic. But VDMA is not firing interrupts in this case...

 

Kernel documentation mentions that channel id is '0' for write channel:

 

  "... where Channel ID is '0' for write/tx and '1' for read/rx ..."

 

However in VDMA notation write channel refers to s2mm transfers. Maybe kernel documentation may be updated to reflect this.

 

Caglar

View solution in original post

0 Kudos