linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Michael Kropaczek <Michael.Kropaczek@solidigm.com>
To: Keith Busch <kbusch@kernel.org>
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 20:02:52 +0000	[thread overview]
Message-ID: <PH0PR10MB541949F6392DE75106A93A0192562@PH0PR10MB5419.namprd10.prod.outlook.com> (raw)
In-Reply-To: <Zdd2BOp6DEC6N51V@kbusch-mbp>



> -----Original Message-----
> From: Keith Busch <kbusch@kernel.org> 
> Sent: Thursday, February 22, 2024 8:28 AM
> To: Michael Kropaczek <Michael.Kropaczek@solidigm.com>
> Cc: 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.
> 
> 
> On Wed, Feb 21, 2024 at 12:43:40AM -0800, Michael Kropaczek wrote:
> > @@ -2593,6 +2593,16 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
> >                       nvme_wait_freeze_timeout(&dev->ctrl, NVME_IO_TIMEOUT);
> >       }
> >
> > +     /*
> > +      * On certain host architectures/HW, DRAM was keeping memory contents over reboot-cycles.
> > +      * It was observed that certain controllers were accessing host memory after
> > +      * resetting which led to undefined state preventing proper initialization.
> > +      */
> > +     if (dev->hmb)
> > +             nvme_set_host_mem(dev, 0);
> > +
> > +     nvme_free_host_mem(dev);
> > +
> 
> Shouldn't this go in nvme_shutdown() instead? I don't think we want to tear down the controller's host memory on every controller reset.

Thank you, Keith, this is a valid point.
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.


  reply	other threads:[~2024-02-22 20:03 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 [this message]
2024-02-22 20:36     ` Keith Busch

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=PH0PR10MB541949F6392DE75106A93A0192562@PH0PR10MB5419.namprd10.prod.outlook.com \
    --to=michael.kropaczek@solidigm.com \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --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).