Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1699666imm; Thu, 19 Jul 2018 06:31:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeBofKf2pwiwBCgjqAIwcqiT/AHKuoynOjAj/c8HneawnyR7Co1NmMh6jjbYvBzHX2eoNLj X-Received: by 2002:a17:902:e005:: with SMTP id ca5-v6mr10201925plb.224.1532007103896; Thu, 19 Jul 2018 06:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532007103; cv=none; d=google.com; s=arc-20160816; b=jgA7V6ivrS5k5nXiq9pskBdjMhbzaHI84uB5S/SL5NxuetrHGhspiLoKwtVo+F+QZh OPU8pruj0AEY4fEM9aSxsKFdDSArpNzGxAmK8cozx+NHmr4BNsWB4jc5dUci5GGlbw/P XZDaJKDO9FK1jARgOEufZ4849fHQJEeeEmJjapO0EtOt74B8sVxvwwbEfWHl9xJxZFqv QZWp83TM4diUk0dGRDUN+nGTyiitT/UQTDLm3C7kUB4FosVio9DNKxZxjxK24j5Uh1wR ZHAV7QixK+EboVLFySWdwLyuR7YgiXPNKbIl4Bk2gLv6h9LYE19WYZ5ZrLnIB2sVloZp UUKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=VvzbFiX0Y5ziQsW3dPPPyi/n2xiP4ShW74ECs8c/9SE=; b=mYs0vDwnYsZAaNeYqBs4TqQavzpHFGvkWiPE+ZODk4ipyW4HixVi0So2xX0bDvBMdF m8WmY957AtUXDiTs5aUVEg7RAVaSp7Vam5yJazn3V3IyYQ0KGdGWrrw+j7KJJakJUzyo n6U0Ef35Z7fWNgjg7EcQY8kkkYEbDaYMsEbXnYlSCh/248UoDsiYwz3ICkpTNQIgKdkl KwFPW8wMSs9/25ubzeX9+m64wFS9rh4r+LxMvh8FdyD29dwypAXC3F8sRGXGTtS5SCrA NgzhPHrpLmyGdnZb5s2TxslFij0EJ4be2R7sApH2P2Rbk+s1aPovVyHNOtMSstOyntwO mbLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n28-v6si5566013pfg.127.2018.07.19.06.31.29; Thu, 19 Jul 2018 06:31:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731874AbeGSON5 (ORCPT + 99 others); Thu, 19 Jul 2018 10:13:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:54176 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731770AbeGSON4 (ORCPT ); Thu, 19 Jul 2018 10:13:56 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 38F59AF4C; Thu, 19 Jul 2018 13:30:44 +0000 (UTC) From: Johannes Thumshirn To: Christoph Hellwig , Sagi Grimberg , Keith Busch Cc: James Smart , Hannes Reinecke , Ewan Milne , Max Gurtovoy , Linux NVMe Mailinglist , Linux Kernel Mailinglist , Johannes Thumshirn Subject: [PATCH 4/4] nvme: fc: abort commands before resetting controller Date: Thu, 19 Jul 2018 15:28:38 +0200 Message-Id: <20180719132838.15556-5-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180719132838.15556-1-jthumshirn@suse.de> References: <20180719132838.15556-1-jthumshirn@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently if a timeout on fc happens we just go ahead and reset the underlying transport. Instead try for a more fine grained error recovery by first aborting the FC OP, if this fails abort the NVMe command and if this as well fails go the hard route and reset the controller. Signed-off-by: Johannes Thumshirn --- drivers/nvme/host/fc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 9cc33752539a..0ba0075c3b75 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -2054,6 +2054,15 @@ nvme_fc_timeout(struct request *rq, bool reserved) { struct nvme_fc_fcp_op *op = blk_mq_rq_to_pdu(rq); struct nvme_fc_ctrl *ctrl = op->ctrl; + u16 qid = op->queue->qnum; + int ret; + + if (!__nvme_fc_abort_op(ctrl, op)) + return BLK_EH_RESET_TIMER; + + ret = nvme_abort_cmd(&ctrl->ctrl, rq, cpu_to_le16(qid)); + if (!ret) + return BLK_EH_RESET_TIMER; /* * we can't individually ABTS an io without affecting the queue, -- 2.16.4