[PATCH v2 1/6] drivers: nvme: Log I/O timeouts

dmukhin at ford.com dmukhin at ford.com
Fri May 29 05:44:36 CEST 2026


From: Denis Mukhin <dmukhin at ford.com> 

Current code silently swallows any timed-out commands scheduled
to NVMe. Log those to be able to debug any potential problems with
the NVMe hardware/firmware.

Signed-off-by: Denis Mukhin <dmukhin at ford.com>
Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>
---
Changes since v1:
- added Neil's R-b
---
 drivers/nvme/nvme.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
index 0631b190b978..c3c44e50f19a 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -182,8 +182,10 @@ static int nvme_submit_sync_cmd(struct nvme_queue *nvmeq,
 		if ((status & 0x01) == phase)
 			break;
 		if (timeout_us > 0 && (timer_get_us() - start_time)
-		    >= timeout_us)
+		    >= timeout_us) {
+			pr_warn("nvme: cmd %#x timed out\n", cmd->common.command_id);
 			return -ETIMEDOUT;
+		}
 	}
 
 	ops = (struct nvme_ops *)nvmeq->dev->udev->driver->ops;
-- 
2.54.0



More information about the U-Boot mailing list