]> git.baikalelectronics.ru Git - kernel.git/commitdiff
nvme-pci: print the command name of aborted commands
authorChristoph Hellwig <hch@lst.de>
Mon, 18 Jul 2022 05:13:24 +0000 (07:13 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:22:48 +0000 (17:22 -0600)
To allow for slightly better debugging, print the command name when
aborting an command.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/constants.c
drivers/nvme/host/pci.c

index 6973c2a17c13d2a40505d72d05152a17d005b7e8..e958d501558570a926bf205c73b5be9215b7a0f7 100644 (file)
@@ -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)
 {
index 36b8c0e2bb7cc714b387579f822f08e036008d79..4a3ba57bcf5ac926164e2b43d59a4c4f80825940 100644 (file)
@@ -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);