1
0
mirror of https://git.FreeBSD.org/src.git synced 2026-06-02 11:24:32 +00:00

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
This commit is contained in:
Warner Losh
2025-07-21 21:52:22 -06:00
parent 7cbf41ef60
commit b4b166b8c4
+9
View File
@@ -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);
}