[PATCH v3 0/1] nvme: Fix problem when booting from NVMe drive was leading to a hang.

Michael Kropaczek Michael.Kropaczek at solidigm.com
Tue Mar 12 08:17:21 PDT 2024


Thank you, Keith,

Understood,

  Michael 

-----Original Message-----
From: Keith Busch <kbusch at kernel.org> 
Sent: Tuesday, March 12, 2024 7:39 AM
To: Michael Kropaczek <Michael.Kropaczek at solidigm.com>
Cc: linux-nvme at lists.infradead.org; Jens Axboe <axboe at fb.com>; Christoph Hellwig <hch at lst.de>; Sagi Grimberg <sagi at grimberg.me>
Subject: Re: [PATCH v3 0/1] nvme: Fix problem when booting from NVMe drive was leading to a hang.

Caution: External Email


On Mon, Mar 11, 2024 at 03:08:11PM -0700, Michael Kropaczek wrote:
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 
> e6267a6aa380..bda7cf5ff674 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -2593,6 +2593,9 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
>                       nvme_wait_freeze_timeout(&dev->ctrl, NVME_IO_TIMEOUT);
>       }
>
> +     if (shutdown && dev->hmb)
> +             nvme_set_host_mem(dev, 0);
> +

As I said last time, this deadlocks if the controller doesn't respond to the command. While that shouldn't happen with a properly functioning controller, we can't count on that to prevent a deadlock.

>       nvme_quiesce_io_queues(&dev->ctrl);
>
>       if (!dead && dev->ctrl.queue_count > 0) {
> --



More information about the Linux-nvme mailing list