* [PATCH master] of: partition: overwrite arm,arm-firmware-suite unless donttouch
@ 2025-05-20 12:41 Ahmad Fatoum
2025-05-21 7:36 ` Sascha Hauer
2025-05-21 7:45 ` Robert Schwebel
0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2025-05-20 12:41 UTC (permalink / raw)
To: barebox; +Cc: Robert Schwebel, Ahmad Fatoum
barebox doesn't support arm,arm-firmware-suite partitioning and if the
barebox device tree uses a fixed-partitions binding for a flash, it will
overwrite a kernel partitions node that uses arm,arm-firmware-suite with
the fixed partition binding.
This broke in the default case with the addition of
global.of_partition_binding=adaptive, because the check for a compatible
was successful, but the compatible was neither fixed-partitions or
barebox,fixed-partitions.
Fix this by explicitly checking the compatibles we expect.
This fixes a failed of_get_reproducible_name in of_state_fixup, which
broke barebox-state usage on Vexpress in DistroKit.
Fixes: f0d91d7ba6cb ("of: partition: add Linux CONFIG_OF_PARTITION-compatible adaptive fixup mode")
Reported-by: Robert Schwebel <rsc@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/of/partition.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/of/partition.c b/drivers/of/partition.c
index a0890bfcdef0..7f5a526ac88f 100644
--- a/drivers/of/partition.c
+++ b/drivers/of/partition.c
@@ -206,8 +206,8 @@ int of_fixup_partitions(struct device_node *np, struct cdev *cdev)
partnode = np;
break;
case MTD_OF_BINDING_ADAPTIVE:
- /* If there's already a compatible property, leave it as-is */
- if (of_property_present(partnode, "compatible"))
+ /* If there's already a fixed-partitions node, leave compatible as-is */
+ if (of_node_is_fixed_partitions(partnode))
break;
if (!cdev->mtd)
compat = "barebox,fixed-partitions";
--
2.39.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH master] of: partition: overwrite arm,arm-firmware-suite unless donttouch
2025-05-20 12:41 [PATCH master] of: partition: overwrite arm,arm-firmware-suite unless donttouch Ahmad Fatoum
@ 2025-05-21 7:36 ` Sascha Hauer
2025-05-21 7:45 ` Robert Schwebel
1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2025-05-21 7:36 UTC (permalink / raw)
To: barebox, Ahmad Fatoum; +Cc: Robert Schwebel
On Tue, 20 May 2025 14:41:18 +0200, Ahmad Fatoum wrote:
> barebox doesn't support arm,arm-firmware-suite partitioning and if the
> barebox device tree uses a fixed-partitions binding for a flash, it will
> overwrite a kernel partitions node that uses arm,arm-firmware-suite with
> the fixed partition binding.
>
> This broke in the default case with the addition of
> global.of_partition_binding=adaptive, because the check for a compatible
> was successful, but the compatible was neither fixed-partitions or
> barebox,fixed-partitions.
>
> [...]
Applied, thanks!
[1/1] of: partition: overwrite arm,arm-firmware-suite unless donttouch
https://git.pengutronix.de/cgit/barebox/commit/?id=1c9a72656f88 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH master] of: partition: overwrite arm,arm-firmware-suite unless donttouch
2025-05-20 12:41 [PATCH master] of: partition: overwrite arm,arm-firmware-suite unless donttouch Ahmad Fatoum
2025-05-21 7:36 ` Sascha Hauer
@ 2025-05-21 7:45 ` Robert Schwebel
1 sibling, 0 replies; 3+ messages in thread
From: Robert Schwebel @ 2025-05-21 7:45 UTC (permalink / raw)
To: Ahmad Fatoum; +Cc: barebox
On Tue, May 20, 2025 at 02:41:18PM +0200, Ahmad Fatoum wrote:
> barebox doesn't support arm,arm-firmware-suite partitioning and if the
> barebox device tree uses a fixed-partitions binding for a flash, it will
> overwrite a kernel partitions node that uses arm,arm-firmware-suite with
> the fixed partition binding.
>
> This broke in the default case with the addition of
> global.of_partition_binding=adaptive, because the check for a compatible
> was successful, but the compatible was neither fixed-partitions or
> barebox,fixed-partitions.
>
> Fix this by explicitly checking the compatibles we expect.
> This fixes a failed of_get_reproducible_name in of_state_fixup, which
> broke barebox-state usage on Vexpress in DistroKit.
>
> Fixes: f0d91d7ba6cb ("of: partition: add Linux CONFIG_OF_PARTITION-compatible adaptive fixup mode")
> Reported-by: Robert Schwebel <rsc@pengutronix.de>
Thanks, works for me.
rsc
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
--
Pengutronix e.K. | Dipl.-Ing. Robert Schwebel |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-21 7:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-20 12:41 [PATCH master] of: partition: overwrite arm,arm-firmware-suite unless donttouch Ahmad Fatoum
2025-05-21 7:36 ` Sascha Hauer
2025-05-21 7:45 ` Robert Schwebel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox