diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2021-02-18 18:04:33 +0100 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2021-02-18 23:42:32 +0100 |
commit | f07e572f6447465d8938679533d604e402b0f066 (patch) | |
tree | cb333bd2a67e59e7c07659514850a0fd55fc825e /target/linux/bcm27xx/patches-5.4/950-0628-dma-contiguous-CMA-give-precedence-to-cmdline.patch | |
parent | 5d3a6fd970619dfc55f8259035c3027d7613a2a6 (diff) | |
download | upstream-f07e572f6447465d8938679533d604e402b0f066.tar.gz upstream-f07e572f6447465d8938679533d604e402b0f066.tar.bz2 upstream-f07e572f6447465d8938679533d604e402b0f066.zip |
bcm27xx: import latest patches from the RPi foundation
bcm2708: boot tested on RPi B+ v1.2
bcm2709: boot tested on RPi 3B v1.2 and RPi 4B v1.1 4G
bcm2710: boot tested on RPi 3B v1.2
bcm2711: boot tested on RPi 4B v1.1 4G
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.4/950-0628-dma-contiguous-CMA-give-precedence-to-cmdline.patch')
-rw-r--r-- | target/linux/bcm27xx/patches-5.4/950-0628-dma-contiguous-CMA-give-precedence-to-cmdline.patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.4/950-0628-dma-contiguous-CMA-give-precedence-to-cmdline.patch b/target/linux/bcm27xx/patches-5.4/950-0628-dma-contiguous-CMA-give-precedence-to-cmdline.patch new file mode 100644 index 0000000000..d3354bb9e1 --- /dev/null +++ b/target/linux/bcm27xx/patches-5.4/950-0628-dma-contiguous-CMA-give-precedence-to-cmdline.patch @@ -0,0 +1,49 @@ +From cf40e83d2b6fb6857b13df4c8d69cc4c45395ea2 Mon Sep 17 00:00:00 2001 +From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> +Date: Fri, 10 Jan 2020 18:19:33 +0100 +Subject: [PATCH] dma-contiguous: CMA: give precedence to cmdline + +commit 8c8c5a4994a306c217fd061cbfc5903399fd4c1c upstream. + +Although the device tree might contain a reserved-memory DT node +dedicated as the default CMA pool, users might want to change CMA's +parameters using the kernel command line for debugging purposes and +whatnot. Honor this by bypassing the reserved memory CMA setup, which +will ultimately end up freeing the memblock and allow the command line +CMA configuration routine to run. + +Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> +Reviewed-by: Phil Elwell <phil@raspberrypi.org> +Signed-off-by: Christoph Hellwig <hch@lst.de> +--- + kernel/dma/contiguous.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/kernel/dma/contiguous.c ++++ b/kernel/dma/contiguous.c +@@ -301,9 +301,16 @@ static int __init rmem_cma_setup(struct + phys_addr_t align = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order); + phys_addr_t mask = align - 1; + unsigned long node = rmem->fdt_node; ++ bool default_cma = of_get_flat_dt_prop(node, "linux,cma-default", NULL); + struct cma *cma; + int err; + ++ if (size_cmdline != -1 && default_cma) { ++ pr_info("Reserved memory: bypass %s node, using cmdline CMA params instead\n", ++ rmem->name); ++ return -EBUSY; ++ } ++ + if (!of_get_flat_dt_prop(node, "reusable", NULL) || + of_get_flat_dt_prop(node, "no-map", NULL)) + return -EINVAL; +@@ -321,7 +328,7 @@ static int __init rmem_cma_setup(struct + /* Architecture specific contiguous memory fixup. */ + dma_contiguous_early_fixup(rmem->base, rmem->size); + +- if (of_get_flat_dt_prop(node, "linux,cma-default", NULL)) ++ if (default_cma) + dma_contiguous_set_default(cma); + + rmem->ops = &rmem_cma_ops; |