From aa2efc584a4d3fe0fe88cd600f53464b26bcd848 Mon Sep 17 00:00:00 2001 From: Ivan Pang Date: Wed, 11 Jun 2025 05:00:38 +0000 Subject: [PATCH 1/2] dfu: fix dev_part_str for file operations The third_arg for a dfu alt is read as an integer and is overloaded for different supported backends. For ext4 and fat, this third_arg represents the partition and forms the dev part string, which should have its partition in hex. This commit fixes dfu ext4/fat usage for devices with ten or more partitions. Signed-off-by: Ivan Pang Reviewed-by: Mattijs Korpershoek Reviewed-by: Lukasz Majewski Link: https://lore.kernel.org/r/20250611050127.38011-1-ipman@amazon.com Signed-off-by: Mattijs Korpershoek --- drivers/dfu/dfu_mmc.c | 2 +- drivers/dfu/dfu_scsi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c index c19eb919388..a91671755e1 100644 --- a/drivers/dfu/dfu_mmc.c +++ b/drivers/dfu/dfu_mmc.c @@ -117,7 +117,7 @@ static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu, return -1; } - snprintf(dev_part_str, sizeof(dev_part_str), "%d:%d", + snprintf(dev_part_str, sizeof(dev_part_str), "%d:%x", dfu->data.mmc.dev, dfu->data.mmc.part); ret = fs_set_blk_dev("mmc", dev_part_str, fstype); diff --git a/drivers/dfu/dfu_scsi.c b/drivers/dfu/dfu_scsi.c index 9f95194784c..7ec34a8f7e3 100644 --- a/drivers/dfu/dfu_scsi.c +++ b/drivers/dfu/dfu_scsi.c @@ -96,7 +96,7 @@ static int scsi_file_op(enum dfu_op op, struct dfu_entity *dfu, u64 offset, void return -1; } - snprintf(dev_part_str, sizeof(dev_part_str), "%d:%d", dfu->data.scsi.dev, + snprintf(dev_part_str, sizeof(dev_part_str), "%d:%x", dfu->data.scsi.dev, dfu->data.scsi.part); ret = fs_set_blk_dev("scsi", dev_part_str, fstype); From e6eca9ea6457e79acb4e2a426f1e078842c17b25 Mon Sep 17 00:00:00 2001 From: Kory Maincent Date: Wed, 11 Jun 2025 19:10:30 +0200 Subject: [PATCH 2/2] usb: gadget: musb: Fix duplicate ops assignment in ti_musb_peripheral Remove duplicate .ops assignment that was overriding the correct ti_musb_gadget_ops with musb_usb_ops (host ops) in the ti_musb_peripheral driver. This was causing U-Boot crashes when trying to call the handle_interrupts operation since the wrong ops structure was being used. Fixes: 7d98dbcc3dc ("usb: musb-new: Add support for DM_USB") Fixes: 281eaf1ed83a ("usb: gadget: musb: Convert interrupt handling to usb_gadget_generic_ops") Signed-off-by: Kory Maincent Reviewed-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20250611171031.840277-1-kory.maincent@bootlin.com Signed-off-by: Mattijs Korpershoek --- drivers/usb/musb-new/ti-musb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c index ec1baa9337d..967d0953875 100644 --- a/drivers/usb/musb-new/ti-musb.c +++ b/drivers/usb/musb-new/ti-musb.c @@ -282,7 +282,6 @@ U_BOOT_DRIVER(ti_musb_peripheral) = { .ops = &ti_musb_gadget_ops, .probe = ti_musb_peripheral_probe, .remove = ti_musb_peripheral_remove, - .ops = &musb_usb_ops, .plat_auto = sizeof(struct ti_musb_plat), .priv_auto = sizeof(struct ti_musb_peripheral), .flags = DM_FLAG_PRE_RELOC,