Hi Denis,
On 2026-07-16T22:33:54, None <[email protected]> wrote:
> cmd: Add flush support for all blk devices
>
> Introduce `flush` subcommand for all blk devices to allow committing
> dirty data explicitly to the given block device.
>
> Signed-off-by: Denis Mukhin <[email protected]>
>
> cmd/blk_common.c | 17 +++++++++++++++++
> cmd/blkmap.c | 2 ++
> cmd/ide.c | 1 +
> cmd/nvme.c | 1 +
> cmd/pvblock.c | 1 +
> cmd/sata.c | 1 +
> cmd/scsi.c | 1 +
> cmd/usb.c | 1 +
> cmd/virtio.c | 1 +
> 9 files changed, 26 insertions(+)
> Introduce `flush` subcommand for all blk devices to allow committing
> dirty data explicitly to the given block device.
Since you are adding a new subcommand you may need a test for it, e.g. a
console test using run_command() and ut_assert_nextline() in test/dm/blk.c
or similar. Patch 7 covers blk_dflush() but nothing exercises the command
path in blk_common_cmd().
> diff --git a/cmd/blk_common.c b/cmd/blk_common.c
> @@ -37,6 +37,23 @@ int blk_common_cmd(int argc, char *const argv[], enum
> uclass_id uclass_id,
> + ret = blk_dflush(desc);
> + if (ret) {
> + printf("\nfailed to flush device %d (%s): %d\n",
> + *cur_devnump, if_name, ret);
> + return CMD_RET_FAILURE;
> + }
> + printf("\nsuccess!\n");
Please can you drop the 'success!' message, or at least match the other
subcommands (the read/write handlers print '... OK')? U-Boot commands are
generally quiet on success and the return code is already available. Also
the continuation line mixes tabs and spaces rather than aligning with the
open parenthesis.
With those:
Reviewed-by: Simon Glass <[email protected]>
Regards,
Simon