git: 33755dbb2078 - main - mpr/mps: Minor state machine fix

Warner Losh imp at FreeBSD.org
Thu Jun 3 19:46:55 UTC 2021


The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=33755dbb207878c10fd99de39dadf89fad713bc7

commit 33755dbb207878c10fd99de39dadf89fad713bc7
Author:     Warner Losh <imp at FreeBSD.org>
AuthorDate: 2021-06-03 19:46:19 +0000
Commit:     Warner Losh <imp at FreeBSD.org>
CommitDate: 2021-06-03 19:46:19 +0000

    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
---
 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 a840f8f3d5ee..e5ed9b250ca0 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 98c224237b0c..88e5cd0516bd 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;
 		}


More information about the dev-commits-src-main mailing list