From nobody Tue Jul 22 04:00:56 2025 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 4bmNpx1hTlz62NXQ; Tue, 22 Jul 2025 04:00:57 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bmNpw67Ncz3cTW; Tue, 22 Jul 2025 04:00:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753156856; 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=GfkSaWv4e68TbWi7JaVZiGxxnQDQBRhpIvaMPLFzKFc=; b=gpf4Bi9VcC7hGnVGykELPLC9VGoScS3UNTTuXyqNYmCFTf5L49OD3HgAHqyBrYBoSF+XBq ChviTEDDHRsOJtxoWao8R89YMkQTeHZ5t9wpO8AByy1OhauGLex01u3gQwzk2r5VX0yUN7 ooTGmUk9j1BNbeWucqWOdD6dk15+XBOA26YEWLWSfund9tcpw05T5ZEYEgwEx4mfbLRI57 Xg2gitEryT34nwomH3UD9o5XCnFYHXERUV4+bwP/PwQKNlepWt1gAaUnKhpB6ac2d+rBQN ALPHXuIZyB9RkvBHIVxjCs/J+8s6aJhyKufYpr6rhzvz4vtaPbXFHYAxuG28cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753156856; 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=GfkSaWv4e68TbWi7JaVZiGxxnQDQBRhpIvaMPLFzKFc=; b=GkYDTJDyxpmRh7qaKDCq3ymdAkLg26kf0r4geyK65uTwQvcj/sHn2poueLJSFTE3R0c6W1 dcLp/TAZLF8IUc2HQZ+MlgBiYTfC6M/iE03s7VYwQ9qTX+1jsH+Nrjk+oSvNbQtzl1Lhqs J+ZGwvGuTzUAgKXDlfXfR56fDTN6gn7CGpJ4BkoLfXvn3QcYUW3x6gU8L1FnejEqDtgnQF 3DmjvScjGKnaiUt7YOLCxcGpU0CTN0jpo5/HFjYL7A8E/orWpcK+Mp2suWRN8DVX+/y65S atOe0QjhENzGgCpsCSp5qhLvtHhm3PbFmfFKwCpjYYkbNYQKDgMOIgvXODPDmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753156856; a=rsa-sha256; cv=none; b=hklOSXA0vII50nrBNQPKlvQcWHaVyFHbmKokgSZ3vWA8GdZKxse9/4EXYQEfi3L+Ij+f1k KAyK7RAyoQW0pArHklgebtvOzDuRmVyU4WJrxpkOFTms1IJ8PYoMw+MKzC1V2eSY7RbuPy SBv1x793N37MWGf+yHIq8GKIXy2TYP6pxLi2VFCy+/aNrQjPYo8pXuN6+uKT9a3Hz5Gnks DncGcPOOE6MlcSzyqJz01JhA3pueNfwqWCInEbZZ5OlFUpjLNEa2ukllqtqU5eSboY+cus /nuZt0vEGaGaz75nPPd0Hy/0wT3jqL5TDzEBfG7o5Rz4f+dzoVnA1F3ZzYF1JA== 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 4bmNpw4dvmz1Psy; Tue, 22 Jul 2025 04:00:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56M40uU4032590; Tue, 22 Jul 2025 04:00:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56M40udG032587; Tue, 22 Jul 2025 04:00:56 GMT (envelope-from git) Date: Tue, 22 Jul 2025 04:00:56 GMT Message-Id: <202507220400.56M40udG032587@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: b4b166b8c46b - main - cam: Enforce real priorities in xpt_action for queued ccbs. 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: b4b166b8c46b86df855f1621d2aa4b6ab26b3a5e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b4b166b8c46b86df855f1621d2aa4b6ab26b3a5e commit b4b166b8c46b86df855f1621d2aa4b6ab26b3a5e Author: Warner Losh AuthorDate: 2025-07-22 03:52:22 +0000 Commit: Warner Losh CommitDate: 2025-07-22 04:00:53 +0000 cam: Enforce real priorities in xpt_action for queued ccbs. All queued CCBs should be created with a real priority (one that's not CAM_PRIORITY_NONE). Recently, I introduced a bug that revealed a latent MMC bug where it would stop enumerating due to a bad priority. Add an assert to catch that (the other bug in mmc_da that it found has been fixed). Sponsored by: Netflix --- sys/cam/cam_xpt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 2ec736e7f4ac..cae29226d13c 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -2515,6 +2515,15 @@ xpt_action(union ccb *start_ccb) ("xpt_action: func %#x %s\n", start_ccb->ccb_h.func_code, xpt_action_name(start_ccb->ccb_h.func_code))); + /* + * Either it isn't queued, or it has a real priority. There still too + * many places that reuse CCBs with a real priority to do immediate + * queries to do the other side of this assert. + */ + KASSERT((start_ccb->ccb_h.func_code & XPT_FC_QUEUED) == 0 || + start_ccb->ccb_h.pinfo.priority != CAM_PRIORITY_NONE, + ("%s: queued ccb and CAM_PRIORITY_NONE illegal.", __func__)); + start_ccb->ccb_h.status = CAM_REQ_INPROG; (*(start_ccb->ccb_h.path->bus->xport->ops->action))(start_ccb); }