Author: mav
Date: Fri Feb 24 14:48:17 2017
New Revision: 314208
URL: https://svnweb.freebsd.org/changeset/base/314208

Log:
  Respecting r314204 tighten ATIO cleanup requirements.
  
  Every ATIO must complete with either successfully sent status or XPT_ABORT.
  
  MFC after:    2 weeks

Modified:
  head/sys/dev/isp/isp_freebsd.c

Modified: head/sys/dev/isp/isp_freebsd.c
==============================================================================
--- head/sys/dev/isp/isp_freebsd.c      Fri Feb 24 14:40:15 2017        
(r314207)
+++ head/sys/dev/isp/isp_freebsd.c      Fri Feb 24 14:48:17 2017        
(r314208)
@@ -2289,6 +2289,8 @@ isp_handle_platform_ctio(ispsoftc_t *isp
                        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
                        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
        }
 
        /*
-        * 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);
 
        /*
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to