From 37b807ff3653902e1291cea80f3b104a830f27f7 Mon Sep 17 00:00:00 2001 From: Scott Long Date: Sun, 24 Mar 2019 19:09:50 +0000 Subject: [PATCH] r329522 created problemss with commands that enter the TIMEDOUT state but are successfully returned by the card (usually due to an abort being issued as part of timeout recovery). Remove what amounts to an insufficient KASSERT, and don't overwrite the state value. State should probably be re-designed, and that will be done with a future commit. Reported by: phk, bei.io Reviewed by: imp, mav Differential Revision: D19677 --- sys/dev/mpr/mpr.c | 6 ++---- sys/dev/mps/mps.c | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index fb804375fb4..8741777333c 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -2617,10 +2617,8 @@ mpr_intr_locked(void *data) } else { cm = &sc->commands[ le16toh(desc->AddressReply.SMID)]; - KASSERT(cm->cm_state == MPR_CM_STATE_INQUEUE, - ("command SMID %d not inqueue\n", - desc->AddressReply.SMID)); - cm->cm_state = MPR_CM_STATE_BUSY; + if (cm->cm_state != MPR_CM_STATE_TIMEDOUT) + cm->cm_state = MPR_CM_STATE_BUSY; cm->cm_reply = reply; cm->cm_reply_data = le32toh(desc->AddressReply. diff --git a/sys/dev/mps/mps.c b/sys/dev/mps/mps.c index 0b7ec2ed68a..71e23186749 100644 --- a/sys/dev/mps/mps.c +++ b/sys/dev/mps/mps.c @@ -2481,9 +2481,8 @@ mps_intr_locked(void *data) } else { cm = &sc->commands[ le16toh(desc->AddressReply.SMID)]; - KASSERT(cm->cm_state == MPS_CM_STATE_INQUEUE, - ("command not inqueue\n")); - cm->cm_state = MPS_CM_STATE_BUSY; + if (cm->cm_state != MPS_MPS_STATE_TIMEDOUT) + cm->cm_state = MPS_CM_STATE_BUSY; cm->cm_reply = reply; cm->cm_reply_data = le32toh( desc->AddressReply.ReplyFrameAddress);