* [PATCH 1/2] arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist
@ 2022-08-01 10:02 Pali Rohár
2022-08-01 10:02 ` [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions Pali Rohár
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Pali Rohár @ 2022-08-01 10:02 UTC (permalink / raw)
To: Stefan Roese, Marek Behún; +Cc: u-boot
All partitions are created by fixup_mtd_partitions() function, so they do
not have to exist just for their removal need.
Fixes: 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")
Signed-off-by: Pali Rohár <pali@kernel.org>
---
board/CZ.NIC/turris_omnia/turris_omnia.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
index e262ea1aba51..d836ac94ec29 100644
--- a/board/CZ.NIC/turris_omnia/turris_omnia.c
+++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
@@ -974,11 +974,10 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)
int parts;
parts = fdt_subnode_offset(blob, offset, "partitions");
- if (parts < 0)
- return false;
-
- if (fdt_del_node(blob, parts) < 0)
- return false;
+ if (parts >= 0) {
+ if (fdt_del_node(blob, parts) < 0)
+ return false;
+ }
parts = fdt_add_subnode(blob, offset, "partitions");
if (parts < 0)
--
2.20.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions
2022-08-01 10:02 [PATCH 1/2] arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist Pali Rohár
@ 2022-08-01 10:02 ` Pali Rohár
2022-08-01 11:55 ` Stefan Roese
` (2 more replies)
2022-08-01 11:55 ` [PATCH 1/2] arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist Stefan Roese
` (2 subsequent siblings)
3 siblings, 3 replies; 8+ messages in thread
From: Pali Rohár @ 2022-08-01 10:02 UTC (permalink / raw)
To: Stefan Roese, Marek Behún; +Cc: u-boot
Sometimes fixup_mtd_partitions() prints during booting kernel error
"Failed fixing SPI NOR partitions!" because it does not have enough space
for creating all paritions nodes. So increase fdt size.
Fixes: 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")
Signed-off-by: Pali Rohár <pali@kernel.org>
---
board/CZ.NIC/turris_omnia/turris_omnia.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
index d836ac94ec29..108d160f486d 100644
--- a/board/CZ.NIC/turris_omnia/turris_omnia.c
+++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
@@ -979,6 +979,9 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)
return false;
}
+ if (fdt_increase_size(blob, 512) < 0)
+ return false;
+
parts = fdt_add_subnode(blob, offset, "partitions");
if (parts < 0)
return false;
--
2.20.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist
2022-08-01 10:02 [PATCH 1/2] arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist Pali Rohár
2022-08-01 10:02 ` [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions Pali Rohár
@ 2022-08-01 11:55 ` Stefan Roese
2022-08-01 15:54 ` Marek Behún
2022-08-09 11:32 ` Stefan Roese
3 siblings, 0 replies; 8+ messages in thread
From: Stefan Roese @ 2022-08-01 11:55 UTC (permalink / raw)
To: Pali Rohár, Marek Behún; +Cc: u-boot
On 01.08.22 12:02, Pali Rohár wrote:
> All partitions are created by fixup_mtd_partitions() function, so they do
> not have to exist just for their removal need.
>
> Fixes: 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")
> Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> ---
> board/CZ.NIC/turris_omnia/turris_omnia.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
> index e262ea1aba51..d836ac94ec29 100644
> --- a/board/CZ.NIC/turris_omnia/turris_omnia.c
> +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
> @@ -974,11 +974,10 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)
> int parts;
>
> parts = fdt_subnode_offset(blob, offset, "partitions");
> - if (parts < 0)
> - return false;
> -
> - if (fdt_del_node(blob, parts) < 0)
> - return false;
> + if (parts >= 0) {
> + if (fdt_del_node(blob, parts) < 0)
> + return false;
> + }
>
> parts = fdt_add_subnode(blob, offset, "partitions");
> if (parts < 0)
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions
2022-08-01 10:02 ` [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions Pali Rohár
@ 2022-08-01 11:55 ` Stefan Roese
2022-08-01 15:54 ` Marek Behún
2022-08-09 11:32 ` Stefan Roese
2 siblings, 0 replies; 8+ messages in thread
From: Stefan Roese @ 2022-08-01 11:55 UTC (permalink / raw)
To: Pali Rohár, Marek Behún; +Cc: u-boot
On 01.08.22 12:02, Pali Rohár wrote:
> Sometimes fixup_mtd_partitions() prints during booting kernel error
> "Failed fixing SPI NOR partitions!" because it does not have enough space
> for creating all paritions nodes. So increase fdt size.
>
> Fixes: 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")
> Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> ---
> board/CZ.NIC/turris_omnia/turris_omnia.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
> index d836ac94ec29..108d160f486d 100644
> --- a/board/CZ.NIC/turris_omnia/turris_omnia.c
> +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
> @@ -979,6 +979,9 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)
> return false;
> }
>
> + if (fdt_increase_size(blob, 512) < 0)
> + return false;
> +
> parts = fdt_add_subnode(blob, offset, "partitions");
> if (parts < 0)
> return false;
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist
2022-08-01 10:02 [PATCH 1/2] arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist Pali Rohár
2022-08-01 10:02 ` [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions Pali Rohár
2022-08-01 11:55 ` [PATCH 1/2] arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist Stefan Roese
@ 2022-08-01 15:54 ` Marek Behún
2022-08-09 11:32 ` Stefan Roese
3 siblings, 0 replies; 8+ messages in thread
From: Marek Behún @ 2022-08-01 15:54 UTC (permalink / raw)
To: Pali Rohár; +Cc: Stefan Roese, u-boot
On Mon, 1 Aug 2022 12:02:19 +0200
Pali Rohár <pali@kernel.org> wrote:
> All partitions are created by fixup_mtd_partitions() function, so they do
> not have to exist just for their removal need.
>
> Fixes: 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")
> Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions
2022-08-01 10:02 ` [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions Pali Rohár
2022-08-01 11:55 ` Stefan Roese
@ 2022-08-01 15:54 ` Marek Behún
2022-08-09 11:32 ` Stefan Roese
2 siblings, 0 replies; 8+ messages in thread
From: Marek Behún @ 2022-08-01 15:54 UTC (permalink / raw)
To: Pali Rohár; +Cc: Stefan Roese, u-boot
On Mon, 1 Aug 2022 12:02:20 +0200
Pali Rohár <pali@kernel.org> wrote:
> Sometimes fixup_mtd_partitions() prints during booting kernel error
> "Failed fixing SPI NOR partitions!" because it does not have enough space
> for creating all paritions nodes. So increase fdt size.
>
> Fixes: 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")
> Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist
2022-08-01 10:02 [PATCH 1/2] arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist Pali Rohár
` (2 preceding siblings ...)
2022-08-01 15:54 ` Marek Behún
@ 2022-08-09 11:32 ` Stefan Roese
3 siblings, 0 replies; 8+ messages in thread
From: Stefan Roese @ 2022-08-09 11:32 UTC (permalink / raw)
To: Pali Rohár, Marek Behún; +Cc: u-boot
On 01.08.22 12:02, Pali Rohár wrote:
> All partitions are created by fixup_mtd_partitions() function, so they do
> not have to exist just for their removal need.
>
> Fixes: 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")
> Signed-off-by: Pali Rohár <pali@kernel.org>
Applied to u-boot-marvell/master
Thanks,
Stefan
> ---
> board/CZ.NIC/turris_omnia/turris_omnia.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
> index e262ea1aba51..d836ac94ec29 100644
> --- a/board/CZ.NIC/turris_omnia/turris_omnia.c
> +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
> @@ -974,11 +974,10 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)
> int parts;
>
> parts = fdt_subnode_offset(blob, offset, "partitions");
> - if (parts < 0)
> - return false;
> -
> - if (fdt_del_node(blob, parts) < 0)
> - return false;
> + if (parts >= 0) {
> + if (fdt_del_node(blob, parts) < 0)
> + return false;
> + }
>
> parts = fdt_add_subnode(blob, offset, "partitions");
> if (parts < 0)
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions
2022-08-01 10:02 ` [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions Pali Rohár
2022-08-01 11:55 ` Stefan Roese
2022-08-01 15:54 ` Marek Behún
@ 2022-08-09 11:32 ` Stefan Roese
2 siblings, 0 replies; 8+ messages in thread
From: Stefan Roese @ 2022-08-09 11:32 UTC (permalink / raw)
To: Pali Rohár, Marek Behún; +Cc: u-boot
On 01.08.22 12:02, Pali Rohár wrote:
> Sometimes fixup_mtd_partitions() prints during booting kernel error
> "Failed fixing SPI NOR partitions!" because it does not have enough space
> for creating all paritions nodes. So increase fdt size.
>
> Fixes: 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")
> Signed-off-by: Pali Rohár <pali@kernel.org>
Applied to u-boot-marvell/master
Thanks,
Stefan
> ---
> board/CZ.NIC/turris_omnia/turris_omnia.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
> index d836ac94ec29..108d160f486d 100644
> --- a/board/CZ.NIC/turris_omnia/turris_omnia.c
> +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
> @@ -979,6 +979,9 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)
> return false;
> }
>
> + if (fdt_increase_size(blob, 512) < 0)
> + return false;
> +
> parts = fdt_add_subnode(blob, offset, "partitions");
> if (parts < 0)
> return false;
Viele Grüße,
Stefan Roese
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-08-09 11:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-01 10:02 [PATCH 1/2] arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist Pali Rohár
2022-08-01 10:02 ` [PATCH 2/2] arm: mvebu: turris_omnia: Increase fdt size in fixup_mtd_partitions Pali Rohár
2022-08-01 11:55 ` Stefan Roese
2022-08-01 15:54 ` Marek Behún
2022-08-09 11:32 ` Stefan Roese
2022-08-01 11:55 ` [PATCH 1/2] arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist Stefan Roese
2022-08-01 15:54 ` Marek Behún
2022-08-09 11:32 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).