More fully implement the state machine.

When a command is finished running, we must transition it from INQUEUE
to busy state. We were failing to do that, so we hit a panic when the
commands were freed. This only affects mpr, mps already did simmilar
things. Now both the polling and interrupt paths properly set BUSY as
appropriate.
This commit is contained in:
Warner Losh 2019-07-11 06:22:15 +00:00
parent 1cf999a5f3
commit 4b1ac5c2d8

View File

@ -2367,6 +2367,7 @@ mpr_complete_command(struct mpr_softc *sc, struct mpr_command *cm)
return; return;
} }
cm->cm_state = MPR_CM_STATE_BUSY;
if (cm->cm_flags & MPR_CM_FLAGS_POLLED) if (cm->cm_flags & MPR_CM_FLAGS_POLLED)
cm->cm_flags |= MPR_CM_FLAGS_COMPLETE; cm->cm_flags |= MPR_CM_FLAGS_COMPLETE;
@ -3879,7 +3880,7 @@ mpr_request_polled(struct mpr_softc *sc, struct mpr_command **cmp)
break; break;
} }
} }
cm->cm_state = MPR_CM_STATE_BUSY;
if (error) { if (error) {
mpr_dprint(sc, MPR_FAULT, "Calling Reinit from %s\n", __func__); mpr_dprint(sc, MPR_FAULT, "Calling Reinit from %s\n", __func__);
rc = mpr_reinit(sc); rc = mpr_reinit(sc);