From: Christoph Hellwig Date: Mon, 18 Jul 2022 05:13:24 +0000 (+0200) Subject: nvme-pci: print the command name of aborted commands X-Git-Tag: baikal/mips/sdk6.1~5126^2~42 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=692a98bb069f5d4e62d5f692996fa2b8b61a6cad;p=kernel.git nvme-pci: print the command name of aborted commands To allow for slightly better debugging, print the command name when aborting an command. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Jens Axboe --- diff --git a/drivers/nvme/host/constants.c b/drivers/nvme/host/constants.c index 6973c2a17c13d..e958d50155857 100644 --- a/drivers/nvme/host/constants.c +++ b/drivers/nvme/host/constants.c @@ -177,6 +177,7 @@ const unsigned char *nvme_get_opcode_str(u8 opcode) return nvme_ops[opcode]; return "Unknown"; } +EXPORT_SYMBOL_GPL(nvme_get_opcode_str); const unsigned char *nvme_get_admin_opcode_str(u8 opcode) { diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 36b8c0e2bb7cc..4a3ba57bcf5ac 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1434,8 +1434,10 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req) cmd.abort.sqid = cpu_to_le16(nvmeq->qid); dev_warn(nvmeq->dev->ctrl.device, - "I/O %d QID %d timeout, aborting\n", - req->tag, nvmeq->qid); + "I/O %d (%s) QID %d timeout, aborting\n", + req->tag, + nvme_get_opcode_str(nvme_req(req)->cmd->common.opcode), + nvmeq->qid); abort_req = blk_mq_alloc_request(dev->ctrl.admin_q, nvme_req_op(&cmd), BLK_MQ_REQ_NOWAIT);