Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jun 2021 19:46:54 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 33755dbb2078 - main - mpr/mps: Minor state machine fix
Message-ID:  <202106031946.153Jkst3021571@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

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

commit 33755dbb207878c10fd99de39dadf89fad713bc7
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2021-06-03 19:46:19 +0000
Commit:     Warner Losh <imp@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;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106031946.153Jkst3021571>