All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dfu: mtd: probe before get_mtd_device_nm()
@ 2026-09-01 15:34 Ralph Siemsen
  2026-09-02 12:29 ` Mattijs Korpershoek
  0 siblings, 1 reply; 2+ messages in thread
From: Ralph Siemsen @ 2026-09-01 15:34 UTC (permalink / raw)
  To: u-boot
  Cc: Lukasz Majewski, Marek Vasut, Mattijs Korpershoek, Tom Rini,
	Ralph Siemsen

Parsing dfu_alt_info depends on matching MTD device names, so it is
necessary for all MTD devices to be probed first. Move the existing
call to mtd_probe_devices() accordingly.

This fixes a failure of the "dfu usb" command that occurs when:
- dfu_alt_info contains SF devices listed as via MTD
- there is no persistent environment stored in SF
- "sf probe" has not been executed prior to "dfu usb"

Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
---
 drivers/dfu/dfu_mtd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c
index c36ac09189f..da19bc21492 100644
--- a/drivers/dfu/dfu_mtd.c
+++ b/drivers/dfu/dfu_mtd.c
@@ -289,6 +289,9 @@ int dfu_fill_entity_mtd(struct dfu_entity *dfu, char *devstr, char **argv, int a
 	struct mtd_info *mtd;
 	int part;
 
+	/* register partitions with MTDIDS/MTDPARTS or OF fallback */
+	mtd_probe_devices();
+
 	mtd = get_mtd_device_nm(devstr);
 	if (IS_ERR_OR_NULL(mtd))
 		return -ENODEV;
@@ -324,9 +327,6 @@ int dfu_fill_entity_mtd(struct dfu_entity *dfu, char *devstr, char **argv, int a
 		if (*s)
 			return -EINVAL;
 
-		/* register partitions with MTDIDS/MTDPARTS or OF fallback */
-		mtd_probe_devices();
-
 		partnum = 0;
 		list_for_each_entry(partition, &mtd->partitions, node) {
 			partnum++;

---
base-commit: 964ad5b5c91b7be56e443e899d7f873e6aa8c9fc
change-id: 20260901-rzn1-2026-10-mtd-856065fbc00c

Best regards,
--  
Ralph Siemsen <ralph.siemsen@linaro.org>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dfu: mtd: probe before get_mtd_device_nm()
  2026-09-01 15:34 [PATCH] dfu: mtd: probe before get_mtd_device_nm() Ralph Siemsen
@ 2026-09-02 12:29 ` Mattijs Korpershoek
  0 siblings, 0 replies; 2+ messages in thread
From: Mattijs Korpershoek @ 2026-09-02 12:29 UTC (permalink / raw)
  To: Ralph Siemsen, u-boot
  Cc: Lukasz Majewski, Marek Vasut, Tom Rini, Ralph Siemsen

Hi Ralph,

Thank you for the patch.

On Tue, Sep 01, 2026 at 11:34, Ralph Siemsen <ralph.siemsen@linaro.org> wrote:

> Parsing dfu_alt_info depends on matching MTD device names, so it is
> necessary for all MTD devices to be probed first. Move the existing
> call to mtd_probe_devices() accordingly.
>
> This fixes a failure of the "dfu usb" command that occurs when:
> - dfu_alt_info contains SF devices listed as via MTD
> - there is no persistent environment stored in SF
> - "sf probe" has not been executed prior to "dfu usb"
>
> Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>

> ---

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-02 12:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01 15:34 [PATCH] dfu: mtd: probe before get_mtd_device_nm() Ralph Siemsen
2026-09-02 12:29 ` Mattijs Korpershoek

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.