diff mbox series

[4.19,28/78] nvme: have nvme_wait_freeze_timeout return if it timed out

Message ID 20200915140634.986905823@linuxfoundation.org
State Superseded
Headers show
Series None | expand

Commit Message

Greg KH Sept. 15, 2020, 2:12 p.m. UTC
From: Sagi Grimberg <sagi@grimberg.me>

[ Upstream commit 7cf0d7c0f3c3b0203aaf81c1bc884924d8fdb9bd ]

Users can detect if the wait has completed or not and take appropriate
actions based on this information (e.g. weather to continue
initialization or rather fail and schedule another initialization
attempt).

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/nvme/host/core.c | 3 ++-
 drivers/nvme/host/nvme.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Pavel Machek Sept. 16, 2020, 7:34 a.m. UTC | #1
Hi!

> [ Upstream commit 7cf0d7c0f3c3b0203aaf81c1bc884924d8fdb9bd ]

> 

> Users can detect if the wait has completed or not and take appropriate

> actions based on this information (e.g. weather to continue

> initialization or rather fail and schedule another initialization

> attempt).


This does not fix any bug and is not needed in 4.19-stable. In the
5.8-stable there are other patches that depend on that (which is
probably why it was merged), but those are not present in 4.19.

Please drop.

Best regards,
								Pavel

> -void nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout);

> +int nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout);


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Sasha Levin Sept. 17, 2020, 1:35 a.m. UTC | #2
On Wed, Sep 16, 2020 at 09:34:27AM +0200, Pavel Machek wrote:
>Hi!

>

>> [ Upstream commit 7cf0d7c0f3c3b0203aaf81c1bc884924d8fdb9bd ]

>>

>> Users can detect if the wait has completed or not and take appropriate

>> actions based on this information (e.g. weather to continue

>> initialization or rather fail and schedule another initialization

>> attempt).

>

>This does not fix any bug and is not needed in 4.19-stable. In the

>5.8-stable there are other patches that depend on that (which is

>probably why it was merged), but those are not present in 4.19.

>

>Please drop.


Right, now dropped. Thanks!

-- 
Thanks,
Sasha
diff mbox series

Patch

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 0d60f2f8f3eec..1b0133564f0ca 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3726,7 +3726,7 @@  void nvme_unfreeze(struct nvme_ctrl *ctrl)
 }
 EXPORT_SYMBOL_GPL(nvme_unfreeze);
 
-void nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout)
+int nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout)
 {
 	struct nvme_ns *ns;
 
@@ -3737,6 +3737,7 @@  void nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout)
 			break;
 	}
 	up_read(&ctrl->namespaces_rwsem);
+	return timeout;
 }
 EXPORT_SYMBOL_GPL(nvme_wait_freeze_timeout);
 
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index cc4273f119894..9bada68b4bd0c 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -438,7 +438,7 @@  void nvme_start_queues(struct nvme_ctrl *ctrl);
 void nvme_kill_queues(struct nvme_ctrl *ctrl);
 void nvme_unfreeze(struct nvme_ctrl *ctrl);
 void nvme_wait_freeze(struct nvme_ctrl *ctrl);
-void nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout);
+int nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout);
 void nvme_start_freeze(struct nvme_ctrl *ctrl);
 
 #define NVME_QID_ANY -1