From a2784b47e481c86ec6011639158016d626828626 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 3 Jun 2021 13:46:19 -0600 Subject: [PATCH] mpr/mps: Minor state machine fix When a DMA chain can't be loaded, set the state to STATE_INQUEUE so that the mp[rs]_complete_command can properly fail the command. Sponsored by: Netflix (cherry picked from commit 33755dbb207878c10fd99de39dadf89fad713bc7) --- sys/dev/mpr/mpr.c | 1 + sys/dev/mps/mps.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index c43eccb7cb36..796f74c2547b 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -3703,6 +3703,7 @@ mpr_data_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) mpr_dprint(sc, MPR_INFO, "Out of chain frames, " "consider increasing hw.mpr.max_chains.\n"); cm->cm_flags |= MPR_CM_FLAGS_CHAIN_FAILED; + cm->cm_state = MPR_CM_STATE_INQUEUE; mpr_complete_command(sc, cm); return; } diff --git a/sys/dev/mps/mps.c b/sys/dev/mps/mps.c index 3adb16416fa9..b4e0142204ef 100644 --- a/sys/dev/mps/mps.c +++ b/sys/dev/mps/mps.c @@ -2978,6 +2978,7 @@ mps_data_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) mps_dprint(sc, MPS_INFO, "Out of chain frames, " "consider increasing hw.mps.max_chains.\n"); cm->cm_flags |= MPS_CM_FLAGS_CHAIN_FAILED; + cm->cm_state = MPS_CM_STATE_INQUEUE; mps_complete_command(sc, cm); return; }