From nobody Sun Sep 17 15:16:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RpWjT5JnJz4t3Tg; Sun, 17 Sep 2023 15:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RpWjT4sP1z4LbT; Sun, 17 Sep 2023 15:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694963789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EOs0fFWe4mRV7uMEdIVqgn4f5s9+jx99nTsKOkt2+R0=; b=mwNn+887EBlN3jvMCVeaa5bcBIyccmSOEqUBuyjWKUDbkp17MrpPNDxxIPqv03mUrqbTSP KWvWV+jE6Qf8hmi8AXFPAlLRs5APmvGoD63RXfpz/YhpFYQliai7twz4PXl/yHViKkX0Zy M+j+ah6J7ys2Qw6S1Kqkc4NcyOP7soYk1MKvlgs10VxYtojl0Bniw8jA+ni1y7sEypjKyZ H5ICqJlREDtPTtaGvm2CVfj+QP3LX0oh2U6Y7bcdCxkoEbPtzTxyaVXk/9DFatwUxXIX9S hUtqrbhviZ8Kxc/IbNyXr1lk1BcD+0Rwz2clyxk6y79IeSTA72J660iGR4KMpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694963789; a=rsa-sha256; cv=none; b=QqG1/NTuqgxZvdc9i5ZN/+5/rMq3uUhGkfe9kT3rtbK+SImlyko7ySauE5DRBVDzrsXbPg Drsd7pVuEUh9GYPcgy9Ic3g0le6M3R47xKO9L0Q/eUOJKLPLWUZmDekOOZmnRaz1UaePJr SMpMwOH4RH6qJugCj/CF8Fgtx67X4sBO95hwYMY2D8zshIkuHJ5jA01H2Yzw6BSmqIYVnZ h0VexnC3p2dfRmJHE/JRdUflMIuxjcv71VeeWqVc6/rasFOvqmqrf2A/irhqTG2wY7Jdw6 ibFcw5/rTo/BcdUK7rC02jTwxUIhnKHGvMDVrkG38sRkBmVYVjdO9poHPLLA8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694963789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EOs0fFWe4mRV7uMEdIVqgn4f5s9+jx99nTsKOkt2+R0=; b=ZBgBAVDh9pn7sJNUU42djmOtx0SPmqOaqzx67KZ1CeZMJoD69R2+M4+opo5uxMbACADoVP BG9UShJEHLdMEET+j8h+/P5Y8qiFb3sHdtfDUoHicwyEFZiBNZtF1CXNKrjhWkgPs6bw7a PPEqRTNHkU9cABc5NXqUduciTtQ1tULGMkL1zmCYm1PZ4i11oko959PeTbwW+sikS8zICA gHo1NnF1eu2oS5JN23wrVCxz0xWtqplSYvvJ0FD7XahOC2KyCUuPQWPNA6U4hS7A42u9cn bZz5EwRFxNrKTfiIaxaDi3lHqodP6W0s19Z8AI5/RqGTSmZYJ7K+YvOl0eH/dw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RpWjT3wqMztST; Sun, 17 Sep 2023 15:16:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38HFGTPW089936; Sun, 17 Sep 2023 15:16:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38HFGT2g089933; Sun, 17 Sep 2023 15:16:29 GMT (envelope-from git) Date: Sun, 17 Sep 2023 15:16:29 GMT Message-Id: <202309171516.38HFGT2g089933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d95431624f93 - main - nvme: Give up when we've failed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d95431624f934fe4740211738fc787808005b14e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d95431624f934fe4740211738fc787808005b14e commit d95431624f934fe4740211738fc787808005b14e Author: Warner Losh AuthorDate: 2023-09-15 16:02:32 +0000 Commit: Warner Losh CommitDate: 2023-09-17 15:11:56 +0000 nvme: Give up when we've failed Normally, we poll the device every so often to see if commands have timed out. However, we'll go into the recovery state as part of failing the drive. To account for all possibilties, if we're failed when we get into the polling function, just stop polling: Party is over. Sponsored by: Netflix --- sys/dev/nvme/nvme_qpair.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index b256c4713c8d..4e37aa0e1020 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -1011,6 +1011,17 @@ nvme_qpair_timeout(void *arg) mtx_assert(&qpair->recovery, MA_OWNED); + /* + * If the controller has failed, give up. We're never going to change + * state from a failed controller: no further transactions are possible. + * We go ahead and let the timeout expire in many cases for simplicity. + */ + if (qpair->ctrlr->is_failed) { + nvme_printf(ctrlr, "Controller failed, giving up\n"); + qpair->timer_armed = false; + return; + } + switch (qpair->recovery_state) { case RECOVERY_NONE: /* @@ -1094,8 +1105,8 @@ nvme_qpair_timeout(void *arg) idle = false; /* We want to keep polling */ break; case RECOVERY_WAITING: - nvme_printf(ctrlr, "waiting for reset to complete\n"); - idle = false; /* We want to keep polling */ + nvme_printf(ctrlr, "Waiting for reset to complete\n"); + idle = false; /* We want to keep polling */ break; }