From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: Ivan Pang <ipman@amazon.com>, Lukasz Majewski <lukma@denx.de>,
Mattijs Korpershoek <mkorpershoek@kernel.org>
Cc: Ivan Pang <ipman@amazon.com>,
Casey Connolly <casey.connolly@linaro.org>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
Tom Rini <trini@konsulko.com>,
u-boot@lists.denx.de
Subject: Re: [PATCH v1] dfu: fix dev_part_str for file operations
Date: Fri, 13 Jun 2025 11:57:14 +0200 [thread overview]
Message-ID: <877c1g0xs5.fsf@kernel.org> (raw)
In-Reply-To: <20250611050127.38011-1-ipman@amazon.com>
Hi Ivan,
Thank you for the patch, nice catch!
On Wed, Jun 11, 2025 at 05:00, Ivan Pang <ipman@amazon.com> wrote:
> 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 <ipman@amazon.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
>
> 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);
> --
> 2.47.1
next prev parent reply other threads:[~2025-06-13 9:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 5:00 [PATCH v1] dfu: fix dev_part_str for file operations Ivan Pang
2025-06-11 7:14 ` Lukasz Majewski
2025-06-13 9:57 ` Mattijs Korpershoek [this message]
2025-06-16 7:00 ` Mattijs Korpershoek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877c1g0xs5.fsf@kernel.org \
--to=mkorpershoek@kernel.org \
--cc=casey.connolly@linaro.org \
--cc=ipman@amazon.com \
--cc=lukma@denx.de \
--cc=marek.vasut+renesas@mailbox.org \
--cc=rasmus.villemoes@prevas.dk \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.