For nomap case, the memory block will be removed by memblock_remove()
in early_init_dt_alloc_reserved_memory_arch(). So it's meaningless to
call memblock_free() on error path.
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/of/of_reserved_mem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Since commit 86588296acbf ("fdt: Properly handle "no-map" field in the memory region"),
nomap memory is changed to call memblock_mark_nomap() instead of
memblock_remove(). But it only changed the reserved memory with fixed
addr and size case in early_init_dt_reserve_memory_arch(), not
including the dynamical allocation by size case in
early_init_dt_alloc_reserved_memory_arch().
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/of/of_reserved_mem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Rob Herring <robh+dt@kernel.org> Date: 2021-06-11 17:10:53
On Fri, Jun 11, 2021 at 7:13 AM Dong Aisheng [off-list ref] wrote:
Since commit 86588296acbf ("fdt: Properly handle "no-map" field in the memory region"),
nomap memory is changed to call memblock_mark_nomap() instead of
memblock_remove(). But it only changed the reserved memory with fixed
addr and size case in early_init_dt_reserve_memory_arch(), not
including the dynamical allocation by size case in
early_init_dt_alloc_reserved_memory_arch().
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Good practice is to Cc the people involved in referenced commits.
Adding them now. This code is a minefield so I'd like other eyes on
it.
From: Rob Herring <robh+dt@kernel.org>
Sent: Saturday, June 12, 2021 1:11 AM
On Fri, Jun 11, 2021 at 7:13 AM Dong Aisheng [off-list ref]
wrote:
quoted
Since commit 86588296acbf ("fdt: Properly handle "no-map" field in the
memory region"), nomap memory is changed to call
memblock_mark_nomap()
quoted
instead of memblock_remove(). But it only changed the reserved memory
with fixed addr and size case in early_init_dt_reserve_memory_arch(),
not including the dynamical allocation by size case in
early_init_dt_alloc_reserved_memory_arch().
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Good practice is to Cc the people involved in referenced commits.
Adding them now. This code is a minefield so I'd like other eyes on it.
Yes, you're right. Thanks for the good suggestion.
Let's wait for their comments.
Regards
Aisheng
On Friday 11 Jun 2021 at 11:10:36 (-0600), Rob Herring wrote:
On Fri, Jun 11, 2021 at 7:13 AM Dong Aisheng [off-list ref] wrote:
quoted
Since commit 86588296acbf ("fdt: Properly handle "no-map" field in the memory region"),
nomap memory is changed to call memblock_mark_nomap() instead of
memblock_remove(). But it only changed the reserved memory with fixed
addr and size case in early_init_dt_reserve_memory_arch(), not
including the dynamical allocation by size case in
early_init_dt_alloc_reserved_memory_arch().
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Good practice is to Cc the people involved in referenced commits.
Adding them now. This code is a minefield so I'd like other eyes on
it.
Apologies for the delayed reply -- was away last week.
I've been starring at this for 15 minutes, and still can't see how it
could go wrong, so FWIW:
Reviewed-by: Quentin Perret <redacted>
Thanks,
Quentin
From: Rob Herring <robh@kernel.org> Date: 2021-06-24 19:06:07
On Fri, 11 Jun 2021 21:11:52 +0800, Dong Aisheng wrote:
For nomap case, the memory block will be removed by memblock_remove()
in early_init_dt_alloc_reserved_memory_arch(). So it's meaningless to
call memblock_free() on error path.
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/of/of_reserved_mem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Rob Herring <robh@kernel.org> Date: 2021-06-24 19:07:19
On Fri, 11 Jun 2021 21:11:53 +0800, Dong Aisheng wrote:
Since commit 86588296acbf ("fdt: Properly handle "no-map" field in the memory region"),
nomap memory is changed to call memblock_mark_nomap() instead of
memblock_remove(). But it only changed the reserved memory with fixed
addr and size case in early_init_dt_reserve_memory_arch(), not
including the dynamical allocation by size case in
early_init_dt_alloc_reserved_memory_arch().
Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/of/of_reserved_mem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)