* [PATCH] arm: mvebu: turris_omnia: Fix MTD partitions order for Linux
@ 2021-10-21 15:55 Pali Rohár
2021-10-22 6:48 ` Stefan Roese
2021-10-28 10:49 ` Stefan Roese
0 siblings, 2 replies; 3+ messages in thread
From: Pali Rohár @ 2021-10-21 15:55 UTC (permalink / raw)
To: Stefan Roese; +Cc: Marek Behún, u-boot
Linux enumerates MTD partitions in DTB order, while the fdt_add_subnode()
function puts a new subnode at the beginning.
To fix this, put MTD partitions into DTB in reverse order.
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 <marek.behun@nic.cz>
---
board/CZ.NIC/turris_omnia/turris_omnia.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
index a48e1f5c305d..d2f510993449 100644
--- a/board/CZ.NIC/turris_omnia/turris_omnia.c
+++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
@@ -601,7 +601,7 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)
mtd_probe_devices();
- list_for_each_entry(slave, &mtd->partitions, node) {
+ list_for_each_entry_reverse(slave, &mtd->partitions, node) {
char name[32];
int part;
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] arm: mvebu: turris_omnia: Fix MTD partitions order for Linux
2021-10-21 15:55 [PATCH] arm: mvebu: turris_omnia: Fix MTD partitions order for Linux Pali Rohár
@ 2021-10-22 6:48 ` Stefan Roese
2021-10-28 10:49 ` Stefan Roese
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2021-10-22 6:48 UTC (permalink / raw)
To: Pali Rohár; +Cc: Marek Behún, u-boot
On 21.10.21 17:55, Pali Rohár wrote:
> Linux enumerates MTD partitions in DTB order, while the fdt_add_subnode()
> function puts a new subnode at the beginning.
>
> To fix this, put MTD partitions into DTB in reverse order.
>
> 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 <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> ---
> board/CZ.NIC/turris_omnia/turris_omnia.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
> index a48e1f5c305d..d2f510993449 100644
> --- a/board/CZ.NIC/turris_omnia/turris_omnia.c
> +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
> @@ -601,7 +601,7 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)
>
> mtd_probe_devices();
>
> - list_for_each_entry(slave, &mtd->partitions, node) {
> + list_for_each_entry_reverse(slave, &mtd->partitions, node) {
> char name[32];
> int part;
>
>
Viele Grüße,
Stefan
--
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] 3+ messages in thread
* Re: [PATCH] arm: mvebu: turris_omnia: Fix MTD partitions order for Linux
2021-10-21 15:55 [PATCH] arm: mvebu: turris_omnia: Fix MTD partitions order for Linux Pali Rohár
2021-10-22 6:48 ` Stefan Roese
@ 2021-10-28 10:49 ` Stefan Roese
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Roese @ 2021-10-28 10:49 UTC (permalink / raw)
To: Pali Rohár; +Cc: Marek Behún, u-boot
On 21.10.21 17:55, Pali Rohár wrote:
> Linux enumerates MTD partitions in DTB order, while the fdt_add_subnode()
> function puts a new subnode at the beginning.
>
> To fix this, put MTD partitions into DTB in reverse order.
>
> 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 <marek.behun@nic.cz>
Applied to u-boot-marvell/master
Thanks,
Stefan
> ---
> board/CZ.NIC/turris_omnia/turris_omnia.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
> index a48e1f5c305d..d2f510993449 100644
> --- a/board/CZ.NIC/turris_omnia/turris_omnia.c
> +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
> @@ -601,7 +601,7 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd)
>
> mtd_probe_devices();
>
> - list_for_each_entry(slave, &mtd->partitions, node) {
> + list_for_each_entry_reverse(slave, &mtd->partitions, node) {
> char name[32];
> int part;
>
>
Viele Grüße,
Stefan
--
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] 3+ messages in thread
end of thread, other threads:[~2021-10-28 10:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 15:55 [PATCH] arm: mvebu: turris_omnia: Fix MTD partitions order for Linux Pali Rohár
2021-10-22 6:48 ` Stefan Roese
2021-10-28 10:49 ` Stefan Roese
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.