From nobody Fri Dec 17 10:03:53 2021 X-Original-To: dev-commits-src-branches@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 BFC9C18F755D; Fri, 17 Dec 2021 10:03:54 +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 4JFl1k03fGz3ssd; Fri, 17 Dec 2021 10:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 4CA8F19D4F; Fri, 17 Dec 2021 10:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BHA3rXq052037; Fri, 17 Dec 2021 10:03:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BHA3rS6052036; Fri, 17 Dec 2021 10:03:53 GMT (envelope-from git) Date: Fri, 17 Dec 2021 10:03:53 GMT Message-Id: <202112171003.1BHA3rS6052036@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ram Kishore Vegesna Subject: git: 668615aea2c9 - stable/12 - ocs_fc: When commands complete with an error, freeze the device queue. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ram X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 668615aea2c9e3ef33ebe23c497955a922fa20c8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639735434; 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=dYyBhFFoAG6JYuNkHzG60rwd6HLaTrS3bJixKjtrOzE=; b=o8uQ0s2Gv8YY466ztN5B/KYu8GOblZnjxvej08CeO5ooeGFD1MmiZOg9OMQdh+cNoOh/Ts NvFP9n/6ho7+xfWFNhzosggcv62oQoSXEQ+wKZJz7idWBNaQrPBXEMMkckNd0zJ15y0+mR OgTix0CKqzLiB8B2GxOh2p9kYA9itndeAkjLk8BWo8+bmlAkF4r81edlaZkH0J1GlkdgCQ t3zKEnAcxJ2uFbHDqCS+SqxYdnWudbf2O9v6fypYmezMSqjo3Ghw8f7e/iRlAQ5Yuyzgxj 59r9FLmR1RBACcxreri3iU3eZ1CeauiaPJwkEMuJDQkR0Q0yp0V3x9O0xGF9JA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639735434; a=rsa-sha256; cv=none; b=klU3gKcu1mKChIhBN9O2YCKgBlfOvdtlh4AC8pacptvadNEBqGYz1DTcQ1TPkKbmqJssks J1VJ3u7XSGrE7M6VaLNmycKlt7QOplGM7NOe5kDXTwzsu6Q8EQOXstxi7EMjgqxs74Db/F Es32zsgkpqNerWxsxmdxwKKgKqOUPUbh/hSb8Unh8sz6dIJ+da0PJJbPfR3OLWuVKEadc2 l5IfXJxrkXHsGsOmTRMGAmQDN+n/gTjFnODiVKCd5g+qt8l3GF2Y6tlccU4SLUnjuk4Qot B2HWRFQkfuz7E8kydFHCfgb3I2wOWU/TyLGb/p47uthHhrkEfbWcpTSvSG2a7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=668615aea2c9e3ef33ebe23c497955a922fa20c8 commit 668615aea2c9e3ef33ebe23c497955a922fa20c8 Author: Ram Kishore Vegesna AuthorDate: 2021-09-24 09:32:09 +0000 Commit: Ram Kishore Vegesna CommitDate: 2021-12-17 09:57:50 +0000 ocs_fc: When commands complete with an error, freeze the device queue. Proper error recovery depends on freezing the device queue when an error occurs, so we can recover from an error before sending additional commands. The ocs_fc(4) driver was not freezing the device queue for most SCSI errors, and that broke error recovery. sys/dev/ocs_fc/ocs_cam.c: In ocs_scsi_initiator_io_cb(), freeze the device queue if we're passing back status other than CAM_REQ_CMP. Submitted by: ken@kdm.org Reviewed by: mav, ken (cherry picked from commit d063d1bc928165e7798df5ec1c424794a1ec41e9) --- sys/dev/ocs_fc/ocs_cam.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/dev/ocs_fc/ocs_cam.c b/sys/dev/ocs_fc/ocs_cam.c index e5862f093ed3..c773eab105f0 100644 --- a/sys/dev/ocs_fc/ocs_cam.c +++ b/sys/dev/ocs_fc/ocs_cam.c @@ -1520,10 +1520,6 @@ static int32_t ocs_scsi_initiator_io_cb(ocs_io_t *io, } } else if (scsi_status != OCS_SCSI_STATUS_GOOD) { ccb_status = CAM_REQ_CMP_ERR; - ocs_set_ccb_status(ccb, ccb_status); - csio->ccb_h.status |= CAM_DEV_QFRZN; - xpt_freeze_devq(csio->ccb_h.path, 1); - } else { ccb_status = CAM_REQ_CMP; } @@ -1534,8 +1530,15 @@ static int32_t ocs_scsi_initiator_io_cb(ocs_io_t *io, csio->ccb_h.ccb_io_ptr = NULL; csio->ccb_h.ccb_ocs_ptr = NULL; + ccb->ccb_h.status &= ~CAM_SIM_QUEUED; + if ((ccb_status != CAM_REQ_CMP) && + ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0)) { + ccb->ccb_h.status |= CAM_DEV_QFRZN; + xpt_freeze_devq(ccb->ccb_h.path, 1); + } + xpt_done(ccb); return 0;