cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
990 Views
Registered: ‎08-01-2018

Linux kernel hangs after allocatting DMA contiguous pool on Zynq 7000

Jump to solution

Hello,

 

    I am trying to allocate contiguous DMA memory in device tree as I need to store 5MP camera frames and the dma_alloc_coherent would complain otherwise. Unfortunately after the DMA pool is allocated the kernel hangs

 

Uncompressing Linux... done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.6.0-xilinx (mivascu@ubuntu) (gcc version 5.3.0 (GCC) ) #1 SMP PREEMPT Mon Aug 13 03:51:10 PDT 2018
[ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: Hurricane Telescope main board (7z035)
[ 0.000000] Ignoring memory range 0x0 - 0x10000000
[ 0.000000] bootconsole [earlycon0] enabled
[ 0.000000] Reserved memory: created CMA memory pool at 0x10000000, size 64 MiB
[ 0.000000] Reserved memory: initialized node buffer@0, compatible id shared-dma-pool
[ 0.000000] Memory policy: Data cache writealloc

 

   I would appreciate any suggestion related to what could be the problem or how to debug it

 

Thanks,

      Mihaita

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
1,023 Views
Registered: ‎12-02-2014

Re: Linux kernel hangs after allocatting DMA contiguous pool on Zynq 7000

Jump to solution

Try adding the following bootarg:

 

cma=256M

 

If that helps, you can try to find a value that gives you enough memory without eating up too much of your RAM.

 

View solution in original post

0 Kudos
3 Replies
Highlighted
Explorer
Explorer
1,024 Views
Registered: ‎12-02-2014

Re: Linux kernel hangs after allocatting DMA contiguous pool on Zynq 7000

Jump to solution

Try adding the following bootarg:

 

cma=256M

 

If that helps, you can try to find a value that gives you enough memory without eating up too much of your RAM.

 

View solution in original post

0 Kudos
Highlighted
Explorer
Explorer
968 Views
Registered: ‎12-02-2014

Re: Linux kernel hangs after allocatting DMA contiguous pool on Zynq 7000

Jump to solution

If cma=256M doesn't help at all, here's some tips you can use to hopefully get some more info:

 

  • Make sure you have the correct target machine set in the kernel
  • Make sure your kernel bootargs and/or the device tree specify the correct debug UART port
  • Make sure you have the following kernel bootargs set
    • earlyprintk
    • earlycon
    • debug
  • If those are enabled and you still have no output (or not enough output), you can check the kernel log ring buffer directly from uboot:
    • Allow kernel to boot and hang
    • Perform a soft reset on the board
    • use uboot's md command to display the ring buffer memory location (__log_buf)
      • This memory location can be determined from the kernel's System.map file

If you want a longer log buffer, I believe you can add the following command line argument:

 

‘log_buf_len=[value ending in K,M, or G]’

 

So for 1MB:

log_buf_len=1M

0 Kudos
Highlighted
Adventurer
Adventurer
918 Views
Registered: ‎08-01-2018

Re: Linux kernel hangs after allocatting DMA contiguous pool on Zynq 7000

Jump to solution

Hello,

 

    Thank you. That worked and helped me move forward.

 

Best regards,

         Mihaita

0 Kudos