From 87de303c4ad52700564bc256ff246b9b3515d1ce Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Fri, 24 Feb 2017 14:48:17 +0000 Subject: [PATCH] Respecting r314204 tighten ATIO cleanup requirements. Every ATIO must complete with either successfully sent status or XPT_ABORT. MFC after: 2 weeks --- sys/dev/isp/isp_freebsd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index 8f6afef56ce..e66fd46bced 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -2289,6 +2289,8 @@ isp_handle_platform_ctio(ispsoftc_t *isp, void *arg) return; } if (ct->ct_nphdl == CT_HBA_RESET) { + sentstatus = (ccb->ccb_h.flags & CAM_SEND_STATUS) && + (atp->sendst == 0); failure = CAM_UNREC_HBA_ERROR; } else { sentstatus = ct->ct_flags & CT7_SENDSTATUS; @@ -2311,6 +2313,8 @@ isp_handle_platform_ctio(ispsoftc_t *isp, void *arg) return; } if (ct->ct_status == CT_HBA_RESET) { + sentstatus = (ccb->ccb_h.flags & CAM_SEND_STATUS) && + (atp->sendst == 0); failure = CAM_UNREC_HBA_ERROR; } else { sentstatus = ct->ct_flags & CT2_SENDSTATUS; @@ -2356,9 +2360,10 @@ isp_handle_platform_ctio(ispsoftc_t *isp, void *arg) } /* - * If we sent status or error happened, we are done with this ATIO. + * We are done with this ATIO if we successfully sent status. + * In all other cases expect either another CTIO or XPT_ABORT. */ - if (sentstatus || !ok) + if (ok && sentstatus) isp_put_atpd(isp, bus, atp); /*