Skip to contentSkip to conversation

nvme: log additional message for controller status

PATCH Superseded Rupesh Girase 5 participants 5 messages Feb 24, 2020 – Feb 25, 2020 NVMe

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: log additional message for controller status

Logging the controller fatal and ready status would help to identfy if issue lies within kernel nvme subsytem or controller is unhealthy.

---
 drivers/nvme/host/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +3 -2
index ada59df..2dfca9d 100644
@@ -2079,8 +2079,9 @@ static int nvme_wait_ready(struct nvme_ctrl *ctrl, u64 cap, bool enabled)
 			return -EINTR;
 		if (time_after(jiffies, timeout)) {
 			dev_err(ctrl->device,
-				"Device not ready; aborting %s\n", enabled ?
-						"initialisation" : "reset");
+				"Device not ready; aborting %s, RDY=0x%x, CFS=0x%x\n",
+				enabled ? "initialisation" : "reset",
+				csts & NVME_CSTS_RDY, csts & NVME_CSTS_CFS);
 			return -ENODEV;
 		}
 	}
Signature · 7 lines
1.8.3.1


_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Rupesh Girase

Logging the controller fatal and ready status would help to identfy if issue lies within kernel nvme subsytem or controller is unhealthy.

There should be no tabs before the commit message.

Otherwise this looks good:

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

Reviewed-by on v1 1/1
#2 lore raw
In reply to Rupesh Girase

Looks good, with tabs in commit log fixed at the time of applying patch.

Quoted 5 lines · Rupesh Girase

Logging the controller fatal and ready status would help to identfy if issue lies within kernel nvme subsytem or controller is unhealthy.

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

maintainer
#3 lore raw
In reply to Rupesh Girase

drivers/nvme/host/core.c static int nvme_wait_ready(struct nvme_ctrl *ctrl, u64 cap, bool enabled) · line 2084

Quoted 6 lines · Rupesh Girase
drivers/nvme/host/core.c +3 -2
 			dev_err(ctrl->device,
-				"Device not ready; aborting %s\n", enabled ?
-						"initialisation" : "reset");
+				"Device not ready; aborting %s, RDY=0x%x, CFS=0x%x\n",
+				enabled ? "initialisation" : "reset",
+				csts & NVME_CSTS_RDY, csts & NVME_CSTS_CFS);

The RDY bit is a bit redundant. If "initialisation", we know it's not 1, and if "reset", we know it's not 0. We also know it's not all 1's if we reach here.

CFS may be useful, but the print will look a strange. If CFS is set, you'll see "CFS=0x2", but the CFS field can only be either 0 or 1. I say just print out the entire csts field in case SHST or NSSRO may provide insights to the vendor.

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

maintainer Reviewed-by
#4 lore raw
Quoted 13 lines · Rupesh Girase

drivers/nvme/host/core.c static int nvme_wait_ready(struct nvme_ctrl *ctrl, u64 cap, bool enabled) · line 2084

Quoted 6 lines

dev_err(ctrl->device,

drivers/nvme/host/core.c +3 -2
-				"Device not ready; aborting %s\n", enabled ?
-						"initialisation" : "reset");
+				"Device not ready; aborting %s, RDY=0x%x, CFS=0x%x\n",
+				enabled ? "initialisation" : "reset",
+				csts & NVME_CSTS_RDY, csts & NVME_CSTS_CFS);

The RDY bit is a bit redundant. If "initialisation", we know it's not 1, and if "reset", we know it's not 0. We also know it's not all 1's if we reach here.

Quoted 4 lines

CFS may be useful, but the print will look a strange. If CFS is set, you'll see "CFS=0x2", but the CFS field can only be either 0 or 1. I say just print out the entire csts field in case SHST or NSSRO may provide insights to the vendor.

Suggestions sound fine, looks reasonable either way.

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme