FreeBSD/sys/dev/mps/mps_sas.c
/* we need to freeze the simq during attach and diag reset, to avoid failing
 * commands before device handles have been found by discovery.  Since
 * discovery involves reading config pages and possibly sending commands,
 * discovery actions may continue even after we receive the end of discovery
 * event, so refcount discovery actions instead of assuming we can unfreeze
 * the simq when we get the event.
 */
we need to freeze the simq during attach and diag reset, to avoid failing
commands before device handles have been found by discovery.  Since
discovery involves reading config pages and possibly sending commands,
discovery actions may continue even after we receive the end of discovery
event, so refcount discovery actions instead of assuming we can unfreeze
the simq when we get the event.
we need to freeze the simq during attach and diag reset to avoid failing commands before device handles have been found by discovery . Since discovery involves reading config pages and possibly sending commands discovery actions may continue even after we receive the end of discovery event so refcount discovery actions instead of assuming we can unfreeze the simq when we get the event .
void
mpssas_startup_increment(struct mpssas_softc *sassc)
{
	MPS_FUNCTRACE(sassc->sc);
	if ((sassc->flags & MPSSAS_IN_STARTUP) != 0) {
		if (sassc->startup_refcount++ == 0) {
			mps_dprint(sassc->sc, MPS_INIT,
			    "%s freezing simq\n", __func__);
#if __FreeBSD_version >= 1000039
			xpt_hold_boot();
#endif
			xpt_freeze_simq(sassc->sim, 1);
		}
		mps_dprint(sassc->sc, MPS_INIT, "%s refcount %u\n", __func__,
		    sassc->startup_refcount);
	}
}
void mpssas_startup_increment ( struct mpssas_softc * sassc ) { MPS_FUNCTRACE ( sassc -> sc ) ; if ( ( sassc -> flags & MPSSAS_IN_STARTUP ) != 0 ) { if ( sassc -> startup_refcount ++ == 0 ) { mps_dprint ( sassc -> sc , MPS_INIT , " \n " , __func__ ) ; #if __FreeBSD_version >= 1000039 xpt_hold_boot ( ) ; #endif xpt_freeze_simq ( sassc -> sim , 1 ) ; } mps_dprint ( sassc -> sc , MPS_INIT , " \n " , __func__ , sassc -> startup_refcount ) ; } }
we need to freeze the simq during attach and diag reset, to avoid failing
 commands before device handles have been found by discovery.
we need to freeze the simq during attach and diag reset to avoid failing commands before device handles have been found by discovery .
/* just starting, freeze the simq */