From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling
Date: Thu, 25 May 2017 10:30:23 +0200 [thread overview]
Message-ID: <20170525083023.GA22852@lst.de> (raw)
In-Reply-To: <20170524142623.GA27721@dhcp-216.srv.tuxera.com>
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 4c2ff2b..ba54e2a 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -1903,9 +1903,6 @@ static void nvme_reset_work(struct work_struct *work)
> bool was_suspend = !!(dev->ctrl.ctrl_config & NVME_CC_SHN_NORMAL);
> int result = -ENODEV;
>
> - if (WARN_ON(dev->ctrl.state == NVME_CTRL_RESETTING))
> - goto out;
Can we keep a
WARN_ON(dev->ctrl.state != NVME_CTRL_RESETTING))
here?
> goto out;
> @@ -2009,8 +2003,8 @@ static int nvme_reset(struct nvme_dev *dev)
> {
> if (!dev->ctrl.admin_q || blk_queue_dying(dev->ctrl.admin_q))
> return -ENODEV;
> - if (work_busy(&dev->reset_work))
> - return -ENODEV;
> + if (!nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_RESETTING))
> + return -EBUSY;
> if (!queue_work(nvme_workq, &dev->reset_work))
> return -EBUSY;
nvme_probe will also have to set the state to NVME_CTRL_RESETTING to
keep the old behavior, which had some error handling implications.
Also we can replace the work_busy(&dev->reset_work) check in
nvme_should_reset with a check for the NVME_CTRL_RESETTING state now.
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Rakesh Pandit <rakesh@tuxera.com>
Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
Keith Busch <keith.busch@intel.com>, Jens Axboe <axboe@fb.com>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>
Subject: Re: [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling
Date: Thu, 25 May 2017 10:30:23 +0200 [thread overview]
Message-ID: <20170525083023.GA22852@lst.de> (raw)
In-Reply-To: <20170524142623.GA27721@dhcp-216.srv.tuxera.com>
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 4c2ff2b..ba54e2a 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -1903,9 +1903,6 @@ static void nvme_reset_work(struct work_struct *work)
> bool was_suspend = !!(dev->ctrl.ctrl_config & NVME_CC_SHN_NORMAL);
> int result = -ENODEV;
>
> - if (WARN_ON(dev->ctrl.state == NVME_CTRL_RESETTING))
> - goto out;
Can we keep a
WARN_ON(dev->ctrl.state != NVME_CTRL_RESETTING))
here?
> goto out;
> @@ -2009,8 +2003,8 @@ static int nvme_reset(struct nvme_dev *dev)
> {
> if (!dev->ctrl.admin_q || blk_queue_dying(dev->ctrl.admin_q))
> return -ENODEV;
> - if (work_busy(&dev->reset_work))
> - return -ENODEV;
> + if (!nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_RESETTING))
> + return -EBUSY;
> if (!queue_work(nvme_workq, &dev->reset_work))
> return -EBUSY;
nvme_probe will also have to set the state to NVME_CTRL_RESETTING to
keep the old behavior, which had some error handling implications.
Also we can replace the work_busy(&dev->reset_work) check in
nvme_should_reset with a check for the NVME_CTRL_RESETTING state now.
next prev parent reply other threads:[~2017-05-25 8:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-24 14:26 [PATCH V2 1/1] nvme: fix multiple ctrl removal scheduling Rakesh Pandit
2017-05-24 14:26 ` Rakesh Pandit
2017-05-25 8:30 ` Christoph Hellwig [this message]
2017-05-25 8:30 ` Christoph Hellwig
2017-05-26 20:12 ` Rakesh Pandit
2017-05-26 20:12 ` Rakesh Pandit
2017-05-26 10:06 ` Keith Busch
2017-05-26 10:06 ` Keith Busch
2017-05-26 15:28 ` Rakesh Pandit
2017-05-26 15:28 ` Rakesh Pandit
2017-05-30 11:58 ` Sagi Grimberg
2017-05-30 11:58 ` Sagi Grimberg
2017-05-31 16:17 ` Keith Busch
2017-05-31 16:17 ` 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=20170525083023.GA22852@lst.de \
--to=hch@lst.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.