Author: scottl
Date: Mon Dec 24 05:54:36 2018
New Revision: 342387
URL: https://svnweb.freebsd.org/changeset/base/342387

Log:
  Commands for user-initated device resets should come from the high-priority
  allocator.  Prior to this change, they would leak from the normal allocator.

Modified:
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mps/mps_sas.c

Modified: head/sys/dev/mpr/mpr_sas.c
==============================================================================
--- head/sys/dev/mpr/mpr_sas.c  Mon Dec 24 05:05:38 2018        (r342386)
+++ head/sys/dev/mpr/mpr_sas.c  Mon Dec 24 05:54:36 2018        (r342387)
@@ -3312,7 +3312,7 @@ mprsas_action_resetdev(struct mprsas_softc *sassc, uni
        KASSERT(ccb->ccb_h.target_id < sassc->maxtargets, ("Target %d out of "
            "bounds in XPT_RESET_DEV\n", ccb->ccb_h.target_id));
        sc = sassc->sc;
-       tm = mpr_alloc_command(sc);
+       tm = mprsas_alloc_tm(sc);
        if (tm == NULL) {
                mpr_dprint(sc, MPR_ERROR, "command alloc failure in "
                    "mprsas_action_resetdev\n");
@@ -3337,8 +3337,8 @@ mprsas_action_resetdev(struct mprsas_softc *sassc, uni
        mpr_dprint(sc, MPR_INFO, "%s: Sending reset for target ID %d\n",
            __func__, targ->tid);
        tm->cm_targ = targ;
-       targ->flags |= MPRSAS_TARGET_INRESET;
 
+       mprsas_prepare_for_tm(sc, cm, targ, CAM_LUN_WILDCARD);
        mpr_map_command(sc, tm);
 }
 

Modified: head/sys/dev/mps/mps_sas.c
==============================================================================
--- head/sys/dev/mps/mps_sas.c  Mon Dec 24 05:05:38 2018        (r342386)
+++ head/sys/dev/mps/mps_sas.c  Mon Dec 24 05:54:36 2018        (r342387)
@@ -3057,7 +3057,7 @@ mpssas_action_resetdev(struct mpssas_softc *sassc, uni
            ("Target %d out of bounds in XPT_RESET_DEV\n",
             ccb->ccb_h.target_id));
        sc = sassc->sc;
-       tm = mps_alloc_command(sc);
+       tm = mpssas_alloc_tm(sc);
        if (tm == NULL) {
                mps_dprint(sc, MPS_ERROR,
                    "command alloc failure in mpssas_action_resetdev\n");
@@ -3079,8 +3079,8 @@ mpssas_action_resetdev(struct mpssas_softc *sassc, uni
        tm->cm_complete = mpssas_resetdev_complete;
        tm->cm_complete_data = ccb;
        tm->cm_targ = targ;
-       targ->flags |= MPSSAS_TARGET_INRESET;
 
+       mpssas_prepare_for_tm(sc, tm, targ, CAM_LUN_WILDCARD);
        mps_map_command(sc, tm);
 }
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to