--- old/usr/src/uts/common/io/ib/ibtl/ibtl_handlers.c	Sun Jun 11 17:03:50 2017
+++ new/usr/src/uts/common/io/ib/ibtl/ibtl_handlers.c	Sun Jun 11 17:03:50 2017
@@ -158,8 +158,6 @@
 
 ibtl_node_info_cb_t ibtl_node_info_cb;
 
-_NOTE(LOCK_ORDER(ibtl_clnt_list_mutex ibtl_async_mutex))
-
 void
 ibtl_cm_set_node_info_cb(ibt_status_t (*node_info_cb)(ib_guid_t, uint8_t,
     ib_lid_t, ibt_node_info_t *))
@@ -416,10 +414,8 @@
 
 	clntp = ibt_hca->ha_clnt_devp;
 
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibtl_last_client_name))
 	/* Record who is being called (just a debugging aid) */
 	ibtl_last_client_name = client_name = clntp->clnt_name;
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibtl_last_client_name))
 
 	client_private = clntp->clnt_private;
 	async_handler = clntp->clnt_modinfop->mi_async_handler;
@@ -533,7 +529,6 @@
 	if (async_handler == NULL)
 		return;
 
-	_NOTE(NO_COMPETING_THREADS_NOW)
 	mgrp = kmem_alloc(sizeof (*mgrp), KM_SLEEP);
 	mgrp->mgr_hca_devp = hca_devp;
 	mgrp->mgr_async_handler = async_handler;
@@ -542,9 +537,6 @@
 
 	(void) taskq_dispatch(ibtl_async_taskq,
 	    ibt_cisco_embedded_sm_rereg_fix, mgrp, TQ_SLEEP);
-#ifndef lint
-	_NOTE(COMPETING_THREADS_NOW)
-#endif
 }
 
 static void
@@ -556,7 +548,6 @@
 	if (async_handler == NULL)
 		return;
 
-	_NOTE(NO_COMPETING_THREADS_NOW)
 	mgrp = kmem_alloc(sizeof (*mgrp), KM_SLEEP);
 	mgrp->mgr_hca_devp = hca_devp;
 	mgrp->mgr_async_handler = async_handler;
@@ -565,9 +556,6 @@
 
 	(void) taskq_dispatch(ibtl_async_taskq, ibtl_do_mgr_async_task, mgrp,
 	    TQ_SLEEP);
-#ifndef lint
-	_NOTE(COMPETING_THREADS_NOW)
-#endif
 }
 
 /*
@@ -1014,10 +1002,6 @@
 	ibtl_eec->eec_async_flags &= ~IBTL_ASYNC_PENDING;
 }
 
-#ifdef __lock_lint
-kmutex_t cpr_mutex;
-#endif
-
 /*
  * Loop forever, calling async_handlers until all of the async lists
  * are empty.
@@ -1026,19 +1010,12 @@
 static void
 ibtl_async_thread(void)
 {
-#ifndef __lock_lint
 	kmutex_t cpr_mutex;
-#endif
 	callb_cpr_t	cprinfo;
 
-	_NOTE(MUTEX_PROTECTS_DATA(cpr_mutex, cprinfo))
-	_NOTE(NO_COMPETING_THREADS_NOW)
 	mutex_init(&cpr_mutex, NULL, MUTEX_DRIVER, NULL);
 	CALLB_CPR_INIT(&cprinfo, &cpr_mutex, callb_generic_cpr,
 	    "ibtl_async_thread");
-#ifndef lint
-	_NOTE(COMPETING_THREADS_NOW)
-#endif
 
 	mutex_enter(&ibtl_async_mutex);
 
@@ -1122,10 +1099,8 @@
 
 	mutex_exit(&ibtl_async_mutex);
 
-#ifndef __lock_lint
 	mutex_enter(&cpr_mutex);
 	CALLB_CPR_EXIT(&cprinfo);
-#endif
 	mutex_destroy(&cpr_mutex);
 }
 
@@ -1246,7 +1221,6 @@
 
 	IBTF_DPRINTF_L4(ibtf_handlers, "ibtl_cq_handler_call(%p)", ibtl_cq);
 
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ibtl_cq))
 	cq_handler = ibtl_cq->cq_comp_handler;
 	arg = ibtl_cq->cq_arg;
 	if (cq_handler != NULL)
@@ -1288,19 +1262,12 @@
 static void
 ibtl_cq_thread(void)
 {
-#ifndef __lock_lint
 	kmutex_t cpr_mutex;
-#endif
 	callb_cpr_t	cprinfo;
 
-	_NOTE(MUTEX_PROTECTS_DATA(cpr_mutex, cprinfo))
-	_NOTE(NO_COMPETING_THREADS_NOW)
 	mutex_init(&cpr_mutex, NULL, MUTEX_DRIVER, NULL);
 	CALLB_CPR_INIT(&cprinfo, &cpr_mutex, callb_generic_cpr,
 	    "ibtl_cq_thread");
-#ifndef lint
-	_NOTE(COMPETING_THREADS_NOW)
-#endif
 
 	mutex_enter(&ibtl_cq_mutex);
 
@@ -1341,10 +1308,8 @@
 	}
 
 	mutex_exit(&ibtl_cq_mutex);
-#ifndef __lock_lint
 	mutex_enter(&cpr_mutex);
 	CALLB_CPR_EXIT(&cprinfo);
-#endif
 	mutex_destroy(&cpr_mutex);
 }
 
@@ -1433,7 +1398,6 @@
 	IBTF_DPRINTF_L3(ibtf_handlers, "ibt_set_cq_handler(%p, %p, %p)",
 	    ibtl_cq, completion_handler, arg);
 
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ibtl_cq))
 	ibtl_cq->cq_comp_handler = completion_handler;
 	ibtl_cq->cq_arg = arg;
 }
@@ -1466,12 +1430,6 @@
 	clntp->clnt_modinfop->mi_async_handler(
 	    clntp->clnt_private, NULL, new_hcap->nh_code, &async_event);
 	kmem_free(new_hcap, sizeof (*new_hcap));
-#ifdef __lock_lint
-	{
-		ibt_hca_hdl_t hca_hdl;
-		(void) ibt_open_hca(clntp, 0ULL, &hca_hdl);
-	}
-#endif
 	mutex_enter(&ibtl_clnt_list_mutex);
 	if (--hca_devp->hd_async_task_cnt == 0)
 		cv_signal(&hca_devp->hd_async_task_cv);
@@ -1509,15 +1467,11 @@
 			IBTF_DPRINTF_L4(ibtf_handlers,
 			    "ibtl_announce_new_hca: calling IBMF");
 			if (clntp->clnt_modinfop->mi_async_handler) {
-				_NOTE(NO_COMPETING_THREADS_NOW)
 				new_hcap = kmem_alloc(sizeof (*new_hcap),
 				    KM_SLEEP);
 				new_hcap->nh_clntp = clntp;
 				new_hcap->nh_hca_devp = hca_devp;
 				new_hcap->nh_code = IBT_HCA_ATTACH_EVENT;
-#ifndef lint
-				_NOTE(COMPETING_THREADS_NOW)
-#endif
 				clntp->clnt_async_cnt++;
 				hca_devp->hd_async_task_cnt++;
 
@@ -1538,15 +1492,11 @@
 			IBTF_DPRINTF_L4(ibtf_handlers, "ibtl_announce_new_hca: "
 			    "calling  %s", clntp->clnt_modinfop->mi_clnt_name);
 			if (clntp->clnt_modinfop->mi_async_handler) {
-				_NOTE(NO_COMPETING_THREADS_NOW)
 				new_hcap = kmem_alloc(sizeof (*new_hcap),
 				    KM_SLEEP);
 				new_hcap->nh_clntp = clntp;
 				new_hcap->nh_hca_devp = hca_devp;
 				new_hcap->nh_code = IBT_HCA_ATTACH_EVENT;
-#ifndef lint
-				_NOTE(COMPETING_THREADS_NOW)
-#endif
 				clntp->clnt_async_cnt++;
 				hca_devp->hd_async_task_cnt++;
 
@@ -1566,15 +1516,11 @@
 			IBTF_DPRINTF_L4(ibtf_handlers, "ibtl_announce_new_hca: "
 			    "calling  %s", clntp->clnt_modinfop->mi_clnt_name);
 			if (clntp->clnt_modinfop->mi_async_handler) {
-				_NOTE(NO_COMPETING_THREADS_NOW)
 				new_hcap = kmem_alloc(sizeof (*new_hcap),
 				    KM_SLEEP);
 				new_hcap->nh_clntp = clntp;
 				new_hcap->nh_hca_devp = hca_devp;
 				new_hcap->nh_code = IBT_HCA_ATTACH_EVENT;
-#ifndef lint
-				_NOTE(COMPETING_THREADS_NOW)
-#endif
 				clntp->clnt_async_cnt++;
 				hca_devp->hd_async_task_cnt++;
 
@@ -1598,15 +1544,11 @@
 			    "ibtl_announce_new_hca: Calling %s ",
 			    clntp->clnt_modinfop->mi_clnt_name);
 			if (clntp->clnt_modinfop->mi_async_handler) {
-				_NOTE(NO_COMPETING_THREADS_NOW)
 				new_hcap = kmem_alloc(sizeof (*new_hcap),
 				    KM_SLEEP);
 				new_hcap->nh_clntp = clntp;
 				new_hcap->nh_hca_devp = hca_devp;
 				new_hcap->nh_code = IBT_HCA_ATTACH_EVENT;
-#ifndef lint
-				_NOTE(COMPETING_THREADS_NOW)
-#endif
 				clntp->clnt_async_cnt++;
 				hca_devp->hd_async_task_cnt++;
 
@@ -1877,14 +1819,10 @@
 	int i;
 
 	for (i = 0; i < ifail->smf_num_sgids; i++) {
-		_NOTE(NO_COMPETING_THREADS_NOW)
 		noticep = kmem_zalloc(sizeof (*noticep), KM_SLEEP);
 		noticep->np_ibt_hdl = ibt_hdl;
 		noticep->np_sgid = *sgidp++;
 		noticep->np_code = IBT_SM_EVENT_UNAVAILABLE;
-#ifndef lint
-		_NOTE(COMPETING_THREADS_NOW)
-#endif
 		ibtl_inc_clnt_async_cnt(ibt_hdl);
 		(void) taskq_dispatch(ibtl_async_taskq,
 		    ibtl_sm_notice_task, noticep, TQ_SLEEP);
@@ -1898,7 +1836,6 @@
 ibtl_cm_sm_notice_handler(ib_gid_t sgid, ibt_subnet_event_code_t code,
     ibt_subnet_event_t *event)
 {
-	_NOTE(NO_COMPETING_THREADS_NOW)
 	struct ibtl_sm_notice	*noticep;
 	ibtl_clnt_t		*clntp;
 
@@ -1918,9 +1855,6 @@
 		clntp = clntp->clnt_list_link;
 	}
 	mutex_exit(&ibtl_clnt_list_mutex);
-#ifndef lint
-	_NOTE(COMPETING_THREADS_NOW)
-#endif
 }
 
 /*
@@ -1930,12 +1864,8 @@
 ibtl_cm_set_sm_notice_handler(ibt_clnt_hdl_t ibt_hdl,
     ibt_sm_notice_handler_t sm_notice_handler, void *private)
 {
-	_NOTE(NO_COMPETING_THREADS_NOW)
 	ibt_hdl->clnt_sm_trap_handler = sm_notice_handler;
 	ibt_hdl->clnt_sm_trap_handler_arg = private;
-#ifndef lint
-	_NOTE(COMPETING_THREADS_NOW)
-#endif
 }
 
 
@@ -1982,9 +1912,7 @@
 	mutex_exit(&ibtl_cq_mutex);
 	t = thread_create(NULL, 0, ibtl_cq_thread, NULL, 0, &p0, TS_RUN,
 	    ibtl_pri - 1);
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibtl_cq_did))
 	ibtl_cq_did[my_idx] = t->t_did;	/* save for thread_join() */
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibtl_cq_did))
 }
 
 void
@@ -2014,7 +1942,6 @@
 	}
 	initted = 1;
 	mutex_exit(&ibtl_async_mutex);
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibtl_async_did))
 	ibtl_async_did = kmem_zalloc(ibtl_async_thread_init * sizeof (kt_did_t),
 	    KM_SLEEP);
 
@@ -2025,16 +1952,11 @@
 		    TS_RUN, ibtl_pri - 1);
 		ibtl_async_did[i] = t->t_did; /* thread_join() */
 	}
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibtl_async_did))
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibtl_cq_threads))
 	for (i = 0; i < ibtl_cq_threads; i++) {
 		t = thread_create(NULL, 0, ibtl_cq_thread, NULL, 0, &p0,
 		    TS_RUN, ibtl_pri - 1);
-		_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibtl_cq_did))
 		ibtl_cq_did[i] = t->t_did; /* save for thread_join() */
-		_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibtl_cq_did))
 	}
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibtl_cq_threads))
 }
 
 void
@@ -2056,10 +1978,8 @@
 	cv_broadcast(&ibtl_async_cv);
 	mutex_exit(&ibtl_async_mutex);
 
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(ibtl_cq_threads))
 	for (i = 0; i < ibtl_cq_threads; i++)
 		thread_join(ibtl_cq_did[i]);
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(ibtl_cq_threads))
 
 	if (ibtl_async_did) {
 		for (i = 0; i < ibtl_async_thread_init; i++)
