From nobody Tue Apr 23 21:02:30 2024 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 4VPF1f5sppz5J4CJ; Tue, 23 Apr 2024 21:02:30 +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 4VPF1f50lyz4qws; Tue, 23 Apr 2024 21:02:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713906150; 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=e2VvIn+VOMOyusC1w86cDq4FrXoPzhrTp4SMug/cvzk=; b=L56v7IBCtNvKiYdvrErN1j6vUEq+QWGDjwrRNMDV6Q9QDv20ZvVHkOtVTKLec3/77uqjQJ oYxDt47jUB8RaEen9tgIyDB9kC5EC50fZFEyk8J3Edk4s8Jv100C0MfgtDRiaeQ/VTvseL 8JdGovRXuaAWP9j5CDI75sBe0dkVUgHdPx5E4LLaqqBDcCGFOxiBsZDddDLHo22NhylQw8 eNELRWe6+gR0iTWHmmT7LwH91azm+aiFUkENIW3pSW8NduRQID4xBHVbsulmIl5+aJc9Wt gOPC4NDRf+J7i9dsiL132dOS1Rh8Mg+BmO60UXnoiv5hMFqTitgnQxxSJUSZRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713906150; a=rsa-sha256; cv=none; b=ouwqY4hAVna1Hvcx1tkn0LxYQVmZJ3AXhlw70KnSsLoLvOyPQrP8c9W08WO0ZnjPhVHyEX df8pFPIpa/WIqGWgvMzdoiG2Iwq9ZOygGcIyWfjEMfS8WRCbjwKdw75FvXVMWNbZ1U88gW KfWiIavuFphh0JwEN3IXMhA9JDroyZ4VkS9o0GEhx3LRRsB07nvyeXguucDHVACpFatWf1 cz3QFu0Y4mljauul+nouiYWFZIpnEQ6D8FxSMQOOesYiX2lSXzHmE8tk6jHKxazQOnt7Pd 5NCH7p6AK4TKCQfMHzU74ZoGgpfbfD86us2VNTEGORlvoO+96kNGHZxkrzxC7A== 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=1713906150; 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=e2VvIn+VOMOyusC1w86cDq4FrXoPzhrTp4SMug/cvzk=; b=WF+kAqYiVQhuH7vtBEN0cq+zPXk4QP+kALCK2nWlzOPN1X8in4+D6F4OfV8UenbcESJ9wk mmTXp7vubGdNrJdnHiLWtQvTUm/Tr4wiij/hYwGz45Q8HoNgPa/ylDyh8SHI4O3J+JAaya kmNs76zjYmunX8TaoisDr8TjriUEUSB4KWUTsNiHiVuZlOU62ifWrhYZImUzfVHKyZHBtT 0byVktksl+eIgwdp24nVCrdFZZzg/kzmU1cj+QWgAk0v/LUFHoRa6gJz+Z1sET1tHHLNIv c04WC1BwYvCKbAntlf8zFTTntVMGGPfE8957Z73Qjr9nQ/S5tYDZmc+0Det1ug== 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 4VPF1f4cKvzncM; Tue, 23 Apr 2024 21:02:30 +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 43NL2UOx013111; Tue, 23 Apr 2024 21:02:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43NL2UYk013108; Tue, 23 Apr 2024 21:02:30 GMT (envelope-from git) Date: Tue, 23 Apr 2024 21:02:30 GMT Message-Id: <202404232102.43NL2UYk013108@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: d31b677356d7 - main - ahc(4)/ahd(4): target mode: cancel outstanding AIOs and INOTs 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: d31b677356d74b5747814f98a5151e8ee0595399 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d31b677356d74b5747814f98a5151e8ee0595399 commit d31b677356d74b5747814f98a5151e8ee0595399 Author: HP van Braam AuthorDate: 2024-04-23 20:47:12 +0000 Commit: Warner Losh CommitDate: 2024-04-23 20:57:19 +0000 ahc(4)/ahd(4): target mode: cancel outstanding AIOs and INOTs When disabling a lun there can still be outstanding AIOs and INOTs, when this happens previously the lun would just fail to disable and trying to re-use the lun would break the card. isp(4) in target mode does the same thing when disabling a lun, in testing this allows re-starting of ctld(8) with connected initiators and allows initiators to gracefully resume afterwards. Signed-off-by: HP van Braam Reviewed by: imp, mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1190 --- sys/dev/aic7xxx/aic79xx.c | 13 +++++++++++-- sys/dev/aic7xxx/aic7xxx.c | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/sys/dev/aic7xxx/aic79xx.c b/sys/dev/aic7xxx/aic79xx.c index 61e65bf253d7..1b1d31769f90 100644 --- a/sys/dev/aic7xxx/aic79xx.c +++ b/sys/dev/aic7xxx/aic79xx.c @@ -9803,6 +9803,7 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) struct ahd_tmode_tstate *tstate; struct ahd_tmode_lstate *lstate; struct ccb_en_lun *cel; + union ccb *cancel_ccb; cam_status status; u_int target; u_int lun; @@ -10021,12 +10022,20 @@ ahd_handle_en_lun(struct ahd_softc *ahd, struct cam_sim *sim, union ccb *ccb) if (SLIST_FIRST(&lstate->accept_tios) != NULL) { printf("ATIOs pending\n"); - ccb->ccb_h.status = CAM_REQ_INVALID; + while ((cancel_ccb = (union ccb *)SLIST_FIRST(&lstate->accept_tios)) != NULL) { + SLIST_REMOVE_HEAD(&lstate->accept_tios, sim_links.sle); + cancel_ccb->ccb_h.status = CAM_REQ_ABORTED; + xpt_done(cancel_ccb); + }; } if (SLIST_FIRST(&lstate->immed_notifies) != NULL) { printf("INOTs pending\n"); - ccb->ccb_h.status = CAM_REQ_INVALID; + while ((cancel_ccb = (union ccb *)SLIST_FIRST(&lstate->immed_notifies)) != NULL) { + SLIST_REMOVE_HEAD(&lstate->immed_notifies, sim_links.sle); + cancel_ccb->ccb_h.status = CAM_REQ_ABORTED; + xpt_done(cancel_ccb); + }; } if (ccb->ccb_h.status != CAM_REQ_CMP) { diff --git a/sys/dev/aic7xxx/aic7xxx.c b/sys/dev/aic7xxx/aic7xxx.c index b59a35ab5667..1560aa4fe312 100644 --- a/sys/dev/aic7xxx/aic7xxx.c +++ b/sys/dev/aic7xxx/aic7xxx.c @@ -7253,6 +7253,7 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) struct ahc_tmode_tstate *tstate; struct ahc_tmode_lstate *lstate; struct ccb_en_lun *cel; + union ccb *cancel_ccb; cam_status status; u_int target; u_int lun; @@ -7520,12 +7521,20 @@ ahc_handle_en_lun(struct ahc_softc *ahc, struct cam_sim *sim, union ccb *ccb) if (SLIST_FIRST(&lstate->accept_tios) != NULL) { printf("ATIOs pending\n"); - ccb->ccb_h.status = CAM_REQ_INVALID; + while ((cancel_ccb = (union ccb *)SLIST_FIRST(&lstate->accept_tios)) != NULL) { + SLIST_REMOVE_HEAD(&lstate->accept_tios, sim_links.sle); + cancel_ccb->ccb_h.status = CAM_REQ_ABORTED; + xpt_done(cancel_ccb); + }; } if (SLIST_FIRST(&lstate->immed_notifies) != NULL) { printf("INOTs pending\n"); - ccb->ccb_h.status = CAM_REQ_INVALID; + while ((cancel_ccb = (union ccb *)SLIST_FIRST(&lstate->immed_notifies)) != NULL) { + SLIST_REMOVE_HEAD(&lstate->immed_notifies, sim_links.sle); + cancel_ccb->ccb_h.status = CAM_REQ_ABORTED; + xpt_done(cancel_ccb); + }; } if (ccb->ccb_h.status != CAM_REQ_CMP) {