From: dmukhin@ford.com
To: Simon Glass <sjg@chromium.org>
Cc: dmukhin@ford.com, u-boot@lists.denx.de,
neil.armstrong@linaro.org, trini@konsulko.com
Subject: Re: [PATCH v2 4/6] cmd: Add flush support for all blk devices
Date: Thu, 4 Jun 2026 20:55:35 -0700 [thread overview]
Message-ID: <aiJIt29p5fFDySZD@kraken> (raw)
In-Reply-To: <CAFLszTgO6Gbg+TrpSwyTffPVjd5Pv8Pw79eq7RG_gj0W-E2uqg@mail.gmail.com>
On Fri, May 29, 2026 at 04:57:48AM -0500, Simon Glass wrote:
> Hi Denis,
>
> On 2026-05-29T03:44:35, None <dmukhin@ford.com> 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 <dmukhin@ford.com>
> >
> > cmd/blk_common.c | 14 ++++++++++++++
> > 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 +
> > 8 files changed, 21 insertions(+)
>
> > diff --git a/cmd/blk_common.c b/cmd/blk_common.c
> > @@ -37,6 +37,20 @@ int blk_common_cmd(int argc, char *const argv[], enum uclass_id uclass_id,
> > + } else if (strncmp(argv[1], 'flush', 5) == 0) {
> > + struct blk_desc *desc;
> > + int ret;
> > +
> > + ret = blk_get_desc(uclass_id, *cur_devnump, &desc);
> > + if (ret)
> > + return CMD_RET_FAILURE;
> > +
> > + if (blk_dflush(desc)) {
> > + printf("\nfailed to flush device %s\n", if_name);
> > + return CMD_RET_FAILURE;
> > + }
> > +
> > + return CMD_RET_SUCCESS;
> > + }
>
> Please print the return value from blk_dflush() and the device number
> in the failure message - otherwise a user can't tell -ENOSYS from a
> genuine I/O error. Compare with the erase arm just below which reports
> the block count. You can use %dE to get an error string if the board
> enables it.
>
> Do you want to print something on success?
>
> It is a bit misleading to suggest that all the commands support
> 'flush'. But I suppose we can worry about that later.
>
> > diff --git a/cmd/blk_common.c b/cmd/blk_common.c
> > @@ -37,6 +37,20 @@ int blk_common_cmd(int argc, char *const argv[], enum uclass_id uclass_id,
> > + } else if (strncmp(argv[1], 'flush', 5) == 0) {
>
> cmd/blkmap.c also routes through blk_common_cmd(), but dispatches via
> U_BOOT_SUBCMD_MKENT() so flush never reaches this function unless you
> add a matching subcmd entry. Either add it for consistency or call out
> in the commit message that blkmap is intentionally excluded.
Thanks for the feedback!
Will update the patch.
>
> Regards,
> Simon
next prev parent reply other threads:[~2026-06-05 3:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 3:44 [PATCH v2 0/6] nvme: few fixups dmukhin
2026-05-29 3:44 ` [PATCH v2 1/6] drivers: nvme: Log I/O timeouts dmukhin
2026-05-29 9:56 ` Simon Glass
2026-05-29 3:44 ` [PATCH v2 2/6] drivers: block: Introduce blk_flush()/blk_dflush() dmukhin
2026-05-29 9:57 ` Simon Glass
2026-07-16 22:28 ` dmukhin
2026-05-29 3:44 ` [PATCH v2 3/6] drivers: nvme: Implement flush command dmukhin
2026-05-29 9:57 ` Simon Glass
2026-05-29 3:44 ` [PATCH v2 4/6] cmd: Add flush support for all blk devices dmukhin
2026-05-29 9:57 ` Simon Glass
2026-06-05 3:55 ` dmukhin [this message]
2026-06-03 17:43 ` Sean Anderson
2026-06-04 17:01 ` Simon Glass
2026-06-05 3:53 ` dmukhin
2026-05-29 3:44 ` [PATCH v2 5/6] drivers: nvme: Export nvme_shutdown() dmukhin
2026-05-29 9:57 ` Simon Glass
2026-05-29 3:44 ` [PATCH v2 6/6] docs: nvme: Update QEMU command for testing dmukhin
2026-05-29 9:58 ` Simon Glass
2026-05-29 9:58 ` [v2,0/6] nvme: few fixups Simon Glass
2026-06-03 16:22 ` (subset) [PATCH v2 0/6] " Neil Armstrong
2026-06-04 6:32 ` neil.armstrong
2026-06-05 3:59 ` dmukhin
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=aiJIt29p5fFDySZD@kraken \
--to=dmukhin@ford.com \
--cc=neil.armstrong@linaro.org \
--cc=sjg@chromium.org \
--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