[PATCH] fix: nvme_update_ns_info method should be called even if nvme_ms_ids_equal return false

me at kingtous.cn me at kingtous.cn
Thu Apr 7 19:57:04 PDT 2022


From: kingtous <kingtous at qq.com>

I've encountered the suspend issue which causes NVMe SSD cannot be detected after reboot from Linux or wake from suspend. 
I've tried almost all popular Linux distributions like Ubuntu, Debian, Arch, Manjaro. None of them works with my NVMe SSD.
I changed a brand new SSD but it doesn't work either. Originally, if nvme_ns_ids_equal method returns false, the nvme ns info will not try to update and namespace suddenly be removed. This is the issue I've found causing my laptop SSD not detected after suspend or reboot from Linux. After removing 'goto out_free_id', the suspend issue has gone, everything works.
When nvme namespaced ids are not equal, we should also try to update namespace info, not just skip it.

Signed-off-by: kingtous <kingtous at qq.com>
---
 drivers/nvme/host/core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index efb85c6d8..89c6a9598 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4056,7 +4056,6 @@ static void nvme_validate_ns(struct nvme_ns *ns, struct nvme_ns_ids *ids)
 	if (!nvme_ns_ids_equal(&ns->head->ids, ids)) {
 		dev_err(ns->ctrl->device,
 			"identifiers changed for nsid %d\n", ns->head->ns_id);
-		goto out_free_id;
 	}
 
 	ret = nvme_update_ns_info(ns, id);
-- 
2.35.1




More information about the Linux-nvme mailing list