Re: [PATCH] nvme-pci: quiesce IO queues prior to disabling device HMB accesses

2018-02-16 Thread James Smart

On 2/12/2018 10:40 AM, Sagi Grimberg wrote:

Thanks, I picked this up for 4.17 (unless someone thinks
this is 4.16-rc material?)

___
Linux-nvme mailing list
linux-n...@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme


Note: I really hope that we can eventually commonize all the 
quiesce/unquiesce logic and points relative to controller state.  We 
have just enough differences to be interesting.


-- james




Re: [PATCH] nvme-pci: quiesce IO queues prior to disabling device HMB accesses

2018-02-16 Thread James Smart

On 2/12/2018 10:40 AM, Sagi Grimberg wrote:

Thanks, I picked this up for 4.17 (unless someone thinks
this is 4.16-rc material?)

___
Linux-nvme mailing list
linux-n...@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme


Note: I really hope that we can eventually commonize all the 
quiesce/unquiesce logic and points relative to controller state.  We 
have just enough differences to be interesting.


-- james




Re: [PATCH] nvme-pci: quiesce IO queues prior to disabling device HMB accesses

2018-02-12 Thread Sagi Grimberg

Thanks, I picked this up for 4.17 (unless someone thinks
this is 4.16-rc material?)


Re: [PATCH] nvme-pci: quiesce IO queues prior to disabling device HMB accesses

2018-02-12 Thread Sagi Grimberg

Thanks, I picked this up for 4.17 (unless someone thinks
this is 4.16-rc material?)


[PATCH] nvme-pci: quiesce IO queues prior to disabling device HMB accesses

2018-02-12 Thread Jianchao Wang
Quiesce IO queues prior to disabling device HMB accesses. A controller
using HMB may relay on it to efficiently complete IO commands.

Reviewed-by: Keith Busch 
Reviewed-by: Sagi Grimberg 
Signed-off-by: Jianchao Wang 
---
 drivers/nvme/host/pci.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index ab9c195..4a7c420 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2186,7 +2186,11 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool 
shutdown)
if (!dead) {
if (shutdown)
nvme_wait_freeze_timeout(>ctrl, NVME_IO_TIMEOUT);
+   }
+
+   nvme_stop_queues(>ctrl);
 
+   if (!dead) {
/*
 * If the controller is still alive tell it to stop using the
 * host memory buffer.  In theory the shutdown / reset should
@@ -2195,11 +2199,6 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool 
shutdown)
 */
if (dev->host_mem_descs)
nvme_set_host_mem(dev, 0);
-
-   }
-   nvme_stop_queues(>ctrl);
-
-   if (!dead) {
nvme_disable_io_queues(dev);
nvme_disable_admin_queue(dev, shutdown);
}
-- 
2.7.4



[PATCH] nvme-pci: quiesce IO queues prior to disabling device HMB accesses

2018-02-12 Thread Jianchao Wang
Quiesce IO queues prior to disabling device HMB accesses. A controller
using HMB may relay on it to efficiently complete IO commands.

Reviewed-by: Keith Busch 
Reviewed-by: Sagi Grimberg 
Signed-off-by: Jianchao Wang 
---
 drivers/nvme/host/pci.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index ab9c195..4a7c420 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2186,7 +2186,11 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool 
shutdown)
if (!dead) {
if (shutdown)
nvme_wait_freeze_timeout(>ctrl, NVME_IO_TIMEOUT);
+   }
+
+   nvme_stop_queues(>ctrl);
 
+   if (!dead) {
/*
 * If the controller is still alive tell it to stop using the
 * host memory buffer.  In theory the shutdown / reset should
@@ -2195,11 +2199,6 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool 
shutdown)
 */
if (dev->host_mem_descs)
nvme_set_host_mem(dev, 0);
-
-   }
-   nvme_stop_queues(>ctrl);
-
-   if (!dead) {
nvme_disable_io_queues(dev);
nvme_disable_admin_queue(dev, shutdown);
}
-- 
2.7.4