lkml.org 
[lkml]   [2017]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/2] nvme: fix status message while removing controller
Instead of -ENODEV, -EBUSY seems more appropriate if device state
change fails inside nvme_reset_work. This should ideally only fail if
device is already undergoing deletion or is dead.

Signed-off-by: Rakesh Pandit <rakesh@tuxera.com>
---
drivers/nvme/host/pci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 177e5ee..04fe52c 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1910,8 +1910,10 @@ static void nvme_reset_work(struct work_struct *work)
if (dev->ctrl.ctrl_config & NVME_CC_ENABLE)
nvme_dev_disable(dev, false);

- if (!nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_RESETTING))
+ if (!nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_RESETTING)) {
+ result = -EBUSY;
goto out;
+ }

result = nvme_pci_enable(dev);
if (result)
--
2.5.5
\
 
 \ /
  Last update: 2017-05-24 00:17    [W:0.021 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site