From nobody Fri Dec 17 10:37:13 2021 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 B574818FF605; Fri, 17 Dec 2021 10:37:16 +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 4JFlmB58zTz4WNm; Fri, 17 Dec 2021 10:37:14 +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 BF8251A4A0; Fri, 17 Dec 2021 10:37:13 +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 1BHAbDi8092545; Fri, 17 Dec 2021 10:37:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BHAbDeU092544; Fri, 17 Dec 2021 10:37:13 GMT (envelope-from git) Date: Fri, 17 Dec 2021 10:37:13 GMT Message-Id: <202112171037.1BHAbDeU092544@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: 0fff02894f30 - stable/13 - ocs_fc: When commands complete with an error, freeze the device queue. 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: ram X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0fff02894f308ec3943b9cbce09d468e7d9974ea Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639737435; 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=gsMmcZOAs0C0kMArN2xyEOuy5gJE6D/Ldn7RYlONO8Y=; b=YDG5olfGggnP+uYY7K/pcKDGuevI9xx8ocONg3mhLK3UfXVpefoJcDJPQXwVY6ZT6YpT7C qPj5fKIN6mpP505j6/DRYB74bLVhR/O+2IkgTGxWrcM3MttspR9Urv5ysn0W76BDP5DyBm 6JeWbjfS5W8peDOyx95crjLWeRJ0hQ8HiKCRi52ylyaAoazg0CQEEub5Q/qKztd+EGFI1e xWcklbTuKoBxM86qiJuuNJ1F+Px+yQFD73M7yAu6TTOWg5cDeLi+K/s1bAZ8SPbA/BuW+a /4fTqV1ncjuZtPUMoc4QbAomDaSfbOxFcw7bAcjCxh2qtTSLGXw/XGidt3aIyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639737435; a=rsa-sha256; cv=none; b=BzYcIbfI1+imOQ+8uWDPkb6MQPtaWXvEGGja4brCSkKdd+Q2nn9XNbLmOlH1Pric4MWd8T ZlEtIW/uCN2VJgVPZzt0hETEQCBlATJnnSRYIn2S4dtPgZwDXZdVMj/zY6WY0L5DXhu0Ay pXxviqLBwuuhYTwVa6pnlJDZNoylTCLaRDfIIhqd3lqKsmfFjbiDk4cpRSa1gdrgiYltLy G8aNc+coG4YYtIivrb3iMHzCYL2XRegt5dQmAI2hDQpOJJELbS/TD8Ys4fex28Z36RV8ZA xIgDenjY2zT6EWIUOaOXqozLUYflvtYNGKtXZOnIfY0Y2Oq98FXwukXtPLNQNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=0fff02894f308ec3943b9cbce09d468e7d9974ea commit 0fff02894f308ec3943b9cbce09d468e7d9974ea Author: Ram Kishore Vegesna AuthorDate: 2021-09-24 09:32:09 +0000 Commit: Ram Kishore Vegesna CommitDate: 2021-12-17 10:31:06 +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 82b5371b7875..6a9ef6160cee 100644 --- a/sys/dev/ocs_fc/ocs_cam.c +++ b/sys/dev/ocs_fc/ocs_cam.c @@ -1523,10 +1523,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; } @@ -1537,8 +1533,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;