Skip to content

CMA not working with Kernels 3.12.y #520

Closed
@msperl

Description

@msperl

Hi!

CMA settings are not working with kernels 3.12 and later - this is related to #503, but in a much broader context than just a fixed memory split, so a different ticket as it may or may not be related.
So here in summary again:
booting with the following config.txt:

gpu_mem_256=112
gpu_mem_512=368
cma_lwm=16
cma_hwm=32
cma_offline_start=16

and kernel parameters coherent_pool=6M smsc95xx.turbo_mode=N ...

works perfectly fine on a 3.11 kernel (8f768c5) but on a 3.12 (a93bfa0) and 3.13(6928683) kernel it does not work and some memory allocations fail making the Network fail to work.

Seems as if this is mostly related to a change in the early memory management of coherent dma memory regions...

Here the "offending" lines in the dmesg messages (which unfortunately do not make it into /var/log/messages, why is an open question and hinders debugging a bit...)

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.13.0+ (root@raspberrypi) (gcc version 4.6.3 (Deb$
[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), c$
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instru$
[    0.000000] Machine: BCM2708
[    0.000000] early_vc_cma_mem(0/0x14c00000@0xa000000)
[    0.000000]  -> initial 0, size 14c00000, base a000000<3>[    0.000000] vc_cma: dma_declare_contiguous(14c00000,a000000) failed
[    0.000000] Memory policy: Data cache writeback
[    0.000000] On node 0 totalpages: 121856
[    0.000000] free_area_init_node: node 0, pgdat c05f86b4, node_mem_map c06a60$
[    0.000000]   Normal zone: 984 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 121856 pages, LIFO batch:31
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0

So there are 2 issues:

First a cosmetic missing newline in the format string of "-> initial 0, size 14c00000, base a000000" (in 3.12 in file drivers/char/broadcom/vc_cma/vc_cma.c on line 178)

And secondly the failed dma_declare_contiguous(14c00000,a000000) call.
This is probably related to changes that have occurred in the upstream kernels with either commit f825c73 or a254738 and are probably related to configs having moved to different locations....

Martin

P.s: all kernels have been compiled with the default configs shipped with that specific kernel (make bcmrpi_defconfig)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions