From nobody Fri Jul 21 16:14:09 2023 X-Original-To: dev-commits-src-main@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 4R6vkn5f3vz4pPf0; Fri, 21 Jul 2023 16:14:09 +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 4R6vkn2ZCkz4XKj; Fri, 21 Jul 2023 16:14:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689956049; 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=yQJ8poOuSjcfHT5aCgJZnSq3qwhI7GBNt8bwSsUH14I=; b=rIPDDPwKyjIPlkYxdlycZw35to7UiJSyNHqb5UjrCiZXmcLwYY0qJoKrJnoNwhnBMN/k27 De6AOENtzvExZRYRuNehy3+oq6iR5jIoe/ebk/e2/6R+RFo43wR7HfniS8l91MWVleQegW XyO95D4GOTWrI3CGhoFfV1Fo5g7KswDR9+9+OH+2TNlQ6Tupc5hq0TroOQO3spDy48eyW1 y333td4ZwFIxM/06s+k1tMEA99EuBLtiAJwBlZ9rbsMwIKRIG7qu/RA4SSjBGdMouAUrqT IU+XTD6wLbuZM/0C7gaNh3Q0ujvt5LJujFDVgoLk99SQoW8zvauSkn3vRdc8+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689956049; 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=yQJ8poOuSjcfHT5aCgJZnSq3qwhI7GBNt8bwSsUH14I=; b=Tqxyr6TxY7QbH37XBvvUwTtrGpWR9cQS/6o5b/W/S7pn5D490tRsw5lY0KDCqMKzo3jCxp 8skgF3OnMFEE4G+/v9ASWNT7jxR5hUNsYRnO6Z9lw+Fj5yqlic4AEF6oisDHi7T4s6HjHa JTTIu//K/UG3JnmGCyR7z2aMEwJizrZfeF/b1ObtINTruRU52HoFEr/q9njzj3CMlBeRrg eqI10821mQdLV/9ar4jXI8X6OWvZa2jJ7MxOjKiMtDKWf8bH5/g/enrnA+goNCQelnq1Ba p95gkmgHn3WcKYe9iYOuFqDZPZbb60J+am7C1oh7QdWpdb1/mCZ/ud1lVlO1KA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689956049; a=rsa-sha256; cv=none; b=d+Me3hmkX1+b7skkVPppgMB+C1lWD1OHtrZWvl32+vlCgTWy/3ir/+hmusqvvRmsEW/FxG PzVSJHzb8GlwtEN976ow8nVnulwRk1mxavCeapFa2k2w9KAiLLDPZpDCtIMkLfjqI4o7tZ YFJHePJmTeVSzG8kWMvZx7dxkAsmrT7y9Z6uROslQ7XUVSvlehJUHrSMIW7YHG5VzBzkLk DvX9J0BGDx1b9hpAhXDhQ7CH4H3fj83AAqud+ZaoQcnyJiJ+eyKmhDoQqO5E7h4wZOdoAX 9KLzDKj+I9vikFiP0j6a40GxRKfk+3PKVkOpRHnh5NB+Rh8EhBaYklDHDVpW1g== 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 4R6vkn1QwYzKVL; Fri, 21 Jul 2023 16:14:09 +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 36LGE96K075332; Fri, 21 Jul 2023 16:14:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LGE9E8075331; Fri, 21 Jul 2023 16:14:09 GMT (envelope-from git) Date: Fri, 21 Jul 2023 16:14:09 GMT Message-Id: <202307211614.36LGE9E8075331@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: ff4633d9f897 - main - cam_periph: Comment about why we need to reset cbfcnp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: ff4633d9f897c2247bc67930740509a1ba315c81 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ff4633d9f897c2247bc67930740509a1ba315c81 commit ff4633d9f897c2247bc67930740509a1ba315c81 Author: Warner Losh AuthorDate: 2023-07-21 16:11:37 +0000 Commit: Warner Losh CommitDate: 2023-07-21 16:11:37 +0000 cam_periph: Comment about why we need to reset cbfcnp Just spent a few minutes puzzling out why we do this. Add a comment to remind my future self (and other intersted folk) why we do the reset here when we'd set it a few lines above. Sponsored by: Netflix --- sys/cam/cam_periph.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 9ff3d156023d..0de73cffdc1f 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1298,6 +1298,11 @@ cam_periph_runccb(union ccb *ccb, if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) error = 0; else if (error_routine != NULL) { + /* + * cbfcnp is modified by cam_periph_ccbwait so + * reset it before we call the error routine + * which may call xpt_done. + */ ccb->ccb_h.cbfcnp = cam_periph_done; error = (*error_routine)(ccb, camflags, sense_flags); } else