* [PATCH] riscv: Fix setting no-map in reserved memory nodes
@ 2021-09-12 16:05 Samuel Holland
2021-09-12 23:10 ` Bin Meng
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Samuel Holland @ 2021-09-12 16:05 UTC (permalink / raw)
To: Rick Chen, Leo
Cc: u-boot, Samuel Holland, Atish Patra, Bin Meng, Etienne Carriere,
Sean Anderson, Simon Glass
The no-map property is wrongly skipped if a no-map reserved memory
node follows one without that property. Fix this by not remembering
the absence of a no-map property across loop iterations.
Fixes: d4ea649f179a ("riscv: Provide a mechanism to fix DT for reserved memory")
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
arch/riscv/lib/fdt_fixup.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c
index f636b284497..61cf8935269 100644
--- a/arch/riscv/lib/fdt_fixup.c
+++ b/arch/riscv/lib/fdt_fixup.c
@@ -31,7 +31,6 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst)
fdt_addr_t addr;
fdt_size_t size;
int offset, node, err, rmem_offset;
- bool nomap = true;
char basename[32] = {0};
int bname_len;
int max_len = sizeof(basename);
@@ -81,9 +80,7 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst)
log_err("failed to add reserved memory: %d\n", err);
return err;
}
- if (!fdt_getprop(src, node, "no-map", NULL))
- nomap = false;
- if (nomap) {
+ if (fdt_getprop(src, node, "no-map", NULL)) {
rmem_offset = fdt_node_offset_by_phandle(dst, phandle);
fdt_setprop_empty(dst, rmem_offset, "no-map");
}
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] riscv: Fix setting no-map in reserved memory nodes
2021-09-12 16:05 [PATCH] riscv: Fix setting no-map in reserved memory nodes Samuel Holland
@ 2021-09-12 23:10 ` Bin Meng
[not found] ` <HK0PR03MB299425ED21B46DDEC6B65EEDC1DD9@HK0PR03MB2994.apcprd03.prod.outlook.com>
2021-09-17 19:07 ` Atish Patra
2 siblings, 0 replies; 4+ messages in thread
From: Bin Meng @ 2021-09-12 23:10 UTC (permalink / raw)
To: Samuel Holland
Cc: Rick Chen, Leo, U-Boot Mailing List, Atish Patra,
Etienne Carriere, Sean Anderson, Simon Glass
On Mon, Sep 13, 2021 at 12:05 AM Samuel Holland <samuel@sholland.org> wrote:
>
> The no-map property is wrongly skipped if a no-map reserved memory
> node follows one without that property. Fix this by not remembering
> the absence of a no-map property across loop iterations.
>
> Fixes: d4ea649f179a ("riscv: Provide a mechanism to fix DT for reserved memory")
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
>
> arch/riscv/lib/fdt_fixup.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] riscv: Fix setting no-map in reserved memory nodes
[not found] ` <HK0PR03MB299425ED21B46DDEC6B65EEDC1DD9@HK0PR03MB2994.apcprd03.prod.outlook.com>
@ 2021-09-17 6:47 ` Rick Chen
0 siblings, 0 replies; 4+ messages in thread
From: Rick Chen @ 2021-09-17 6:47 UTC (permalink / raw)
To: samuel
Cc: U-Boot Mailing List, Leo Liang, Atish Patra, Bin Meng,
etienne.carriere, Sean Anderson, Simon Glass
> From: Samuel Holland <samuel@sholland.org>
> Sent: Monday, September 13, 2021 12:06 AM
> To: Rick Jian-Zhi Chen(陳建志) <rick@andestech.com>; Leo Yu-Chi Liang(梁育齊) <ycliang@andestech.com>
> Cc: u-boot@lists.denx.de; Samuel Holland <samuel@sholland.org>; Atish Patra <atish.patra@wdc.com>; Bin Meng <bmeng.cn@gmail.com>; Etienne Carriere <etienne.carriere@st.com>; Sean Anderson <seanga2@gmail.com>; Simon Glass <sjg@chromium.org>
> Subject: [PATCH] riscv: Fix setting no-map in reserved memory nodes
>
> The no-map property is wrongly skipped if a no-map reserved memory node follows one without that property. Fix this by not remembering the absence of a no-map property across loop iterations.
>
> Fixes: d4ea649f179a ("riscv: Provide a mechanism to fix DT for reserved memory")
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
>
> arch/riscv/lib/fdt_fixup.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
Reviewed-by: Rick Chen <rick@andestech.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] riscv: Fix setting no-map in reserved memory nodes
2021-09-12 16:05 [PATCH] riscv: Fix setting no-map in reserved memory nodes Samuel Holland
2021-09-12 23:10 ` Bin Meng
[not found] ` <HK0PR03MB299425ED21B46DDEC6B65EEDC1DD9@HK0PR03MB2994.apcprd03.prod.outlook.com>
@ 2021-09-17 19:07 ` Atish Patra
2 siblings, 0 replies; 4+ messages in thread
From: Atish Patra @ 2021-09-17 19:07 UTC (permalink / raw)
To: Samuel Holland
Cc: Rick Chen, Leo, U-Boot Mailing List, Atish Patra, Bin Meng,
Etienne Carriere, Sean Anderson, Simon Glass
On Sun, Sep 12, 2021 at 9:05 AM Samuel Holland <samuel@sholland.org> wrote:
>
> The no-map property is wrongly skipped if a no-map reserved memory
> node follows one without that property. Fix this by not remembering
> the absence of a no-map property across loop iterations.
>
> Fixes: d4ea649f179a ("riscv: Provide a mechanism to fix DT for reserved memory")
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
>
> arch/riscv/lib/fdt_fixup.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/arch/riscv/lib/fdt_fixup.c b/arch/riscv/lib/fdt_fixup.c
> index f636b284497..61cf8935269 100644
> --- a/arch/riscv/lib/fdt_fixup.c
> +++ b/arch/riscv/lib/fdt_fixup.c
> @@ -31,7 +31,6 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst)
> fdt_addr_t addr;
> fdt_size_t size;
> int offset, node, err, rmem_offset;
> - bool nomap = true;
> char basename[32] = {0};
> int bname_len;
> int max_len = sizeof(basename);
> @@ -81,9 +80,7 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst)
> log_err("failed to add reserved memory: %d\n", err);
> return err;
> }
> - if (!fdt_getprop(src, node, "no-map", NULL))
> - nomap = false;
> - if (nomap) {
> + if (fdt_getprop(src, node, "no-map", NULL)) {
> rmem_offset = fdt_node_offset_by_phandle(dst, phandle);
> fdt_setprop_empty(dst, rmem_offset, "no-map");
> }
> --
> 2.31.1
>
Thanks for catching it.
Reviewed-by: Atish Patra <atish.patra@wdc.com>
--
Regards,
Atish
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-09-17 19:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-12 16:05 [PATCH] riscv: Fix setting no-map in reserved memory nodes Samuel Holland
2021-09-12 23:10 ` Bin Meng
[not found] ` <HK0PR03MB299425ED21B46DDEC6B65EEDC1DD9@HK0PR03MB2994.apcprd03.prod.outlook.com>
2021-09-17 6:47 ` Rick Chen
2021-09-17 19:07 ` Atish Patra
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.