All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] nvme-pci: Fix controller freeze wait disabling
@ 2019-05-15 16:36 Keith Busch
  2019-05-15 16:36 ` [PATCH 2/6] nvme-pci: Don't disable on timeout in reset state Keith Busch
                   ` (6 more replies)
  0 siblings, 7 replies; 51+ messages in thread
From: Keith Busch @ 2019-05-15 16:36 UTC (permalink / raw)


If a controller disabling didn't start a freeze, like when we disable
whilst in the connecting state, don't wait for freeze to complete.

Signed-off-by: Keith Busch <keith.busch at intel.com>
---
 drivers/nvme/host/pci.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 2a8708c9ac18..d4e442160048 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2376,7 +2376,7 @@ static void nvme_pci_disable(struct nvme_dev *dev)
 
 static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
 {
-	bool dead = true;
+	bool dead = true, freeze = false;
 	struct pci_dev *pdev = to_pci_dev(dev->dev);
 
 	mutex_lock(&dev->shutdown_lock);
@@ -2384,8 +2384,10 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
 		u32 csts = readl(dev->bar + NVME_REG_CSTS);
 
 		if (dev->ctrl.state == NVME_CTRL_LIVE ||
-		    dev->ctrl.state == NVME_CTRL_RESETTING)
+		    dev->ctrl.state == NVME_CTRL_RESETTING) {
+			freeze = true;
 			nvme_start_freeze(&dev->ctrl);
+		}
 		dead = !!((csts & NVME_CSTS_CFS) || !(csts & NVME_CSTS_RDY) ||
 			pdev->error_state  != pci_channel_io_normal);
 	}
@@ -2394,10 +2396,8 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
 	 * Give the controller a chance to complete all entered requests if
 	 * doing a safe shutdown.
 	 */
-	if (!dead) {
-		if (shutdown)
-			nvme_wait_freeze_timeout(&dev->ctrl, NVME_IO_TIMEOUT);
-	}
+	if (!dead && shutdown && freeze)
+		nvme_wait_freeze_timeout(&dev->ctrl, NVME_IO_TIMEOUT);
 
 	nvme_stop_queues(&dev->ctrl);
 
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2019-05-23 15:27 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-15 16:36 [PATCH 1/6] nvme-pci: Fix controller freeze wait disabling Keith Busch
2019-05-15 16:36 ` [PATCH 2/6] nvme-pci: Don't disable on timeout in reset state Keith Busch
2019-05-16  3:07   ` Ming Lei
2019-05-16 14:33     ` Keith Busch
2019-05-16  6:27   ` Christoph Hellwig
2019-05-15 16:36 ` [PATCH 3/6] nvme-pci: Unblock reset_work on IO failure Keith Busch
2019-05-16  3:13   ` Ming Lei
2019-05-16 14:14     ` Keith Busch
2019-05-17  2:31       ` Ming Lei
2019-05-16  6:28   ` Christoph Hellwig
2019-05-15 16:36 ` [PATCH 4/6] nvme-pci: Sync queues on reset Keith Busch
2019-05-16  3:34   ` Ming Lei
2019-05-16  6:29   ` Christoph Hellwig
2019-05-16 14:08     ` Keith Busch
2019-05-16 13:43   ` Minwoo Im
2019-05-15 16:36 ` [PATCH 5/6] nvme: Export get and set features Keith Busch
2019-05-16  6:26   ` Christoph Hellwig
2019-05-16 13:47   ` Minwoo Im
2019-05-15 16:36 ` [PATCHv2 6/6] nvme-pci: Use host managed power state for suspend Keith Busch
2019-05-15 19:33   ` Mario.Limonciello
2019-05-15 19:34     ` Keith Busch
2019-05-15 19:43       ` Mario.Limonciello
2019-05-16  6:25   ` Christoph Hellwig
2019-05-16 14:24     ` Keith Busch
2019-05-17  9:08       ` Christoph Hellwig
2019-05-16  9:29   ` Rafael J. Wysocki
2019-05-16 14:26     ` Keith Busch
2019-05-16 18:27       ` Kai-Heng Feng
2019-05-16 18:33         ` Mario.Limonciello
2019-05-16 19:38           ` Keith Busch
2019-05-16 20:25             ` Rafael J. Wysocki
2019-05-16 20:39               ` Keith Busch
2019-05-16 20:56                 ` Rafael J. Wysocki
2019-05-17  8:39                   ` Rafael J. Wysocki
2019-05-17  9:05                     ` Christoph Hellwig
2019-05-17  9:17                       ` Rafael J. Wysocki
2019-05-17  9:35                         ` Christoph Hellwig
2019-05-17 10:34                           ` Rafael J. Wysocki
2019-05-22  6:47                             ` Kai Heng Feng
2019-05-22 15:52                               ` Christoph Hellwig
2019-05-22 16:02                                 ` Keith Busch
2019-05-22 16:35                                   ` Mario.Limonciello
2019-05-22 16:56                                     ` Keith Busch
2019-05-22 23:08                                     ` Keith Busch
2019-05-23 15:27                                       ` Keith Busch
2019-05-17  9:22                     ` Kai-Heng Feng
2019-05-17  9:32                       ` Rafael J. Wysocki
2019-05-16 20:24         ` Rafael J. Wysocki
2019-05-16  2:43 ` [PATCH 1/6] nvme-pci: Fix controller freeze wait disabling Ming Lei
2019-05-17 18:40   ` Keith Busch
2019-05-16  6:27 ` Christoph Hellwig

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.