linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Michael Kropaczek <Michael.Kropaczek@solidigm.com>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	Jens Axboe <axboe@fb.com>, Christoph Hellwig <hch@lst.de>,
	Sagi Grimberg <sagi@grimberg.me>
Subject: Re: [PATCH v1 0/1] nvme: Fix problem when booting from NVMe drive was leading to a hang.
Date: Thu, 22 Feb 2024 13:36:31 -0700	[thread overview]
Message-ID: <ZdewTyX522lO3pTP@kbusch-mbp> (raw)
In-Reply-To: <PH0PR10MB541949F6392DE75106A93A0192562@PH0PR10MB5419.namprd10.prod.outlook.com>

On Thu, Feb 22, 2024 at 08:02:52PM +0000, Michael Kropaczek wrote:
> The function nvme_dev_disable() changed here is called from the nvme_shutdown() subsequently through nvme_disable_prepare_reset() with the flag shutdown being set as true.
> 
> Considering the re-usability of the code, would it be correct to wrap up the change into if(shutdown) statement?
> 
> The reason for asking is that disabling of host memory should follow other calls as well and placing it within the body of nvme_shutdown() would require more adjustments.
> 
> The call to nvme_disable_prepare_reset() with the flag shutdown set as true is made whenever the NVMe controller should be shut down anyway.

Just calling nvme_set_host_mem() should be sufficient; no need to free
the memory here as we may just be giving it back to the device on the
reset or resume side.

And per spec, the device is supposed to automatically clear its host
memory enabling on a reset or shutdown, so this shouldn't be necessary.
Sounds like something isn't spec complaint in your environment.

Going through the git histroy, we use to disable host mem here, but
timeout handling doesn't work within nvme_dev_disable(). All the
operations done from here need to guarantee forward progress, and this
set function command doesn't do that. The only example of admin commands
that handle their own timeout is the queue deletion sequence.


      reply	other threads:[~2024-02-22 20:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21  8:43 [PATCH v1 0/1] nvme: Fix problem when booting from NVMe drive was leading to a hang Michael Kropaczek
2024-02-22 16:27 ` Keith Busch
2024-02-22 20:02   ` Michael Kropaczek
2024-02-22 20:36     ` Keith Busch [this message]

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=ZdewTyX522lO3pTP@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=Michael.Kropaczek@solidigm.com \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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;
as well as URLs for NNTP newsgroup(s).