Skip to content

nvme: Add verbose error logging

Alan Adamson linux-nvme 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest1 patch 2 repliesIn review
  2. v51 patch 1 replySuperseded
  3. v41 patch 6 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v31 patch1 replySuperseded
v21 patch4 repliesSuperseded
v11 patch9 repliesSuperseded

Changes in v6 from the cover letter

- Create helpers that are stubbed out if CONFIG_NVME_VERBOSE_ERRORS is not set.
- Couple more nits.

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1nvme: Add verbose error loggingdrivers/nvme/host/Kconfig drivers/nvme/host/Makefile drivers/nvme/host/core.c +3 more+277 -12 replies

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchHimanshu MadhaniKeith Busch
1/1R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH V6 0/1] nvme: Add verbose error logging

V6:
- Create helpers that are stubbed out if CONFIG_NVME_VERBOSE_ERRORS is not set.
- Couple more nits.

V5:
- Change nvme_ops[] and nvme_admin_ops[] to a sparse array where the opcode is used as an index into the array.
- Various other nits.

V4:
- Adding logging for admin commands.
- Display NVMe Command Opcode value rather than generic block opcode.
- Various other nits.

V3:
- Don't populate nvme_errors[] array with NULL strings.

V2:
- Change nvme_errors[] to a sparse array where the status is used as an index into the array.

- Change pr_err() to pr_err_ratelimited().

- By enabling CONFIG_NVME_VERBOSE_ERRORS, the verbose status error is displayed. If it is not enabled, then a message will still be displayed, but without the verbose status.

- Remove call to nvme_error_status() when determining whether to call nvme_error_log(). Speeds up the fast path just a bit.

This patch improves logging for NVMe errors. Currently, we only get a a vague idea as to why commands fail since only the block layer status is captured on error. This patch allows us to see why a command was failed by the controller. This is very useful when debugging problems in the field.

An example of an improved logged error:

[  183.333734] nvme0n1: Read(0x2) @ LBA 0, 1 blocks, Unrecovered Read Error (sct 0x2 / sc 0x81) DNR
[  227.767945] nvme0: Activate Firmware(0x10), Invalid Field in Command (sct 0x0 / sc 0x2) DNR

Alan Adamson (1):
nvme: Add verbose error logging

 drivers/nvme/host/Kconfig  |   8 ++
 drivers/nvme/host/Makefile |   2 +-
 drivers/nvme/host/core.c   |  41 ++++++++
 drivers/nvme/host/errors.c | 206 +++++++++++++++++++++++++++++++++++++
 drivers/nvme/host/nvme.h   |  20 ++++
 include/linux/nvme.h       |   1 +
 6 files changed, 277 insertions(+), 1 deletion(-)
 create mode 100644 drivers/nvme/host/errors.c
Signature · 1 line
2.27.0