U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Ivan Pang <ipman@amazon.com>
Cc: Mattijs Korpershoek <mkorpershoek@kernel.org>,
	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: Wed, 11 Jun 2025 09:14:26 +0200	[thread overview]
Message-ID: <20250611091426.2976d2b3@wsk> (raw)
In-Reply-To: <20250611050127.38011-1-ipman@amazon.com>

[-- Attachment #1: Type: text/plain, Size: 1879 bytes --]

Hi Ivan,

> 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>
> ---
> 
>  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);

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2025-06-11  7:14 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 [this message]
2025-06-13  9:57 ` Mattijs Korpershoek
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=20250611091426.2976d2b3@wsk \
    --to=lukma@denx.de \
    --cc=casey.connolly@linaro.org \
    --cc=ipman@amazon.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=mkorpershoek@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox