aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mps
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2018-12-09 06:10:11 +0000
committerScott Long <scottl@FreeBSD.org>2018-12-09 06:10:11 +0000
commit617e85f387b47aefafd84d55cde2565e0e266ef4 (patch)
tree3e5cf1a3d3254802b4e5aa262a7a7a685ed264b8 /sys/dev/mps
parent44f299a3cce6028a62915649b3df512cb2c6ff5d (diff)
Notes
Diffstat (limited to 'sys/dev/mps')
-rw-r--r--sys/dev/mps/mps.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/dev/mps/mps.c b/sys/dev/mps/mps.c
index 77353b184a3e..79558c8a2a08 100644
--- a/sys/dev/mps/mps.c
+++ b/sys/dev/mps/mps.c
@@ -2361,12 +2361,13 @@ void
mps_intr_locked(void *data)
{
MPI2_REPLY_DESCRIPTORS_UNION *desc;
+ MPI2_DIAG_RELEASE_REPLY *rel_rep;
+ mps_fw_diagnostic_buffer_t *pBuffer;
struct mps_softc *sc;
struct mps_command *cm = NULL;
+ uint64_t tdesc;
uint8_t flags;
u_int pq;
- MPI2_DIAG_RELEASE_REPLY *rel_rep;
- mps_fw_diagnostic_buffer_t *pBuffer;
sc = (struct mps_softc *)data;
@@ -2378,6 +2379,17 @@ mps_intr_locked(void *data)
for ( ;; ) {
cm = NULL;
desc = &sc->post_queue[sc->replypostindex];
+
+ /*
+ * Copy and clear out the descriptor so that any reentry will
+ * immediately know that this descriptor has already been
+ * looked at. There is unfortunate casting magic because the
+ * MPI API doesn't have a cardinal 64bit type.
+ */
+ tdesc = 0xffffffffffffffff;
+ tdesc = atomic_swap_64((uint64_t *)desc, tdesc);
+ desc = (MPI2_REPLY_DESCRIPTORS_UNION *)&tdesc;
+
flags = desc->Default.ReplyFlags &
MPI2_RPY_DESCRIPT_FLAGS_TYPE_MASK;
if ((flags == MPI2_RPY_DESCRIPT_FLAGS_UNUSED)
@@ -2496,9 +2508,6 @@ mps_intr_locked(void *data)
mps_display_reply_info(sc,cm->cm_reply);
mps_complete_command(sc, cm);
}
-
- desc->Words.Low = 0xffffffff;
- desc->Words.High = 0xffffffff;
}
if (pq != sc->replypostindex) {