From: Denis Mukhin via U-Boot <u-boot@lists.u-boot-project.org>
To: Neil Armstrong <neil.armstrong@linaro.org>
Cc: dmukhin@ford.com, u-boot@lists.denx.de, seanga2@gmail.com,
sjg@chromium.org, trini@konsulko.com
Subject: Re: [PATCH v3 5/7] drivers: nvme: Export nvme_shutdown()
Date: Wed, 22 Jul 2026 20:13:10 -0700 [thread overview]
Message-ID: <amGGxi0gkGSgd4EX@kraken> (raw)
In-Reply-To: <9c8fa6c1-3d03-44e1-be58-8cef38979073@linaro.org>
On Mon, Jul 20, 2026 at 11:42:31AM +0200, neil.armstrong@linaro.org wrote:
> On 7/17/26 00:33, dmukhin@ford.com wrote:
> > From: Denis Mukhin <dmukhin@ford.com>
> >
> > Make nvme_shutdown() public so that it can be re-used in
> > board-specific board_quiesce_devices() before OS hand-off.
> >
> > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> > ---
> > Changes since v2:
> > - fixup for apple device
> >
> > Changes since v1:
> > - n/a
> > ---
> > drivers/nvme/nvme.h | 7 -------
> > drivers/nvme/nvme_apple.c | 1 +
> > include/nvme.h | 11 +++++++++++
> > 3 files changed, 12 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/nvme/nvme.h b/drivers/nvme/nvme.h
> > index a938da728506..cc1477717391 100644
> > --- a/drivers/nvme/nvme.h
> > +++ b/drivers/nvme/nvme.h
> > @@ -703,11 +703,4 @@ struct nvme_ops {
> > */
> > int nvme_init(struct udevice *udev);
> > -/**
> > - * nvme_shutdown() - Shutdown NVM Express device
> > - * @udev: The NVM Express device
> > - * Return: 0 if OK, -ve on error
> > - */
> > -int nvme_shutdown(struct udevice *udev);
> > -
> > #endif /* __DRIVER_NVME_H__ */
> > diff --git a/drivers/nvme/nvme_apple.c b/drivers/nvme/nvme_apple.c
> > index 7e7538553e3f..a36f15a3ff4e 100644
> > --- a/drivers/nvme/nvme_apple.c
> > +++ b/drivers/nvme/nvme_apple.c
> > @@ -6,6 +6,7 @@
> > #include <dm.h>
> > #include <mailbox.h>
> > #include <mapmem.h>
> > +#include <nvme.h>
> > #include "nvme.h"
> > #include <reset.h>
> > diff --git a/include/nvme.h b/include/nvme.h
> > index 2cdf8ce320c1..c7b301300097 100644
> > --- a/include/nvme.h
> > +++ b/include/nvme.h
> > @@ -90,4 +90,15 @@ int nvme_print_info(struct udevice *udev);
> > */
> > int nvme_get_namespace_id(struct udevice *udev, u32 *ns_id, u8 *eui64);
> > +/**
> > + * nvme_shutdown() - Shutdown NVM Express device
> > + *
> > + * Must be called before booting an OS to ensure cache is flushed
> > + * and the controller is in a clean state for OS to re-initialize.
> > + *
> > + * @udev: The NVM Express device
> > + * Return: 0 if OK, -ve on error
> > + */
> > +int nvme_shutdown(struct udevice *udev);
> > +
> > #endif /* __NVME_H__ */
>
> Could you instead add the DM_FLAG_ACTIVE_DMA flag to the PCI NVMe driver and
> then call nvme_shutdown() from a new nvem_remove in nvem_pci.c
Thanks for suggestion!
Will check that path.
>
> This will automatically shutdown the NVMe devices when booting an OS and you could
> trigger this manually by calling:
>
> dm_remove_devices_flags(DM_REMOVE_ACTIVE_DMA)
>
> Neil
next prev parent reply other threads:[~2026-07-23 3:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 22:33 [PATCH v3 0/7] few fixes for NVMe and block devices dmukhin
2026-07-16 22:33 ` [PATCH v3 1/7] drivers: nvme: Enable Force Unit Access (FUA) dmukhin
2026-07-28 11:17 ` Simon Glass
2026-07-16 22:33 ` [PATCH v3 2/7] drivers: block: Introduce blk_flush()/blk_dflush() dmukhin
2026-07-28 11:17 ` Simon Glass
2026-07-16 22:33 ` [PATCH v3 3/7] drivers: nvme: Implement flush command dmukhin
2026-07-16 22:33 ` [PATCH v3 4/7] cmd: Add flush support for all blk devices dmukhin
2026-07-28 11:37 ` Simon Glass
2026-07-16 22:33 ` [PATCH v3 5/7] drivers: nvme: Export nvme_shutdown() dmukhin
2026-07-20 9:42 ` neil.armstrong
2026-07-23 3:13 ` Denis Mukhin via U-Boot [this message]
2026-07-16 22:34 ` [PATCH v3 6/7] docs: nvme: Update QEMU command for testing dmukhin
2026-07-28 11:37 ` Simon Glass
2026-07-16 22:34 ` [PATCH v3 7/7] tests: add blk_dflush() coverage dmukhin
2026-07-28 11:17 ` Simon Glass
2026-07-20 9:33 ` [PATCH v3 0/7] few fixes for NVMe and block devices neil.armstrong
2026-07-23 3:12 ` Denis Mukhin via U-Boot
2026-07-28 11:28 ` [v3,0/7] " Simon Glass
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=amGGxi0gkGSgd4EX@kraken \
--to=u-boot@lists.u-boot-project.org \
--cc=dmukhin@ford.com \
--cc=neil.armstrong@linaro.org \
--cc=seanga2@gmail.com \
--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 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.