--- old/usr/src/uts/common/io/ib/clients/daplt/daplt.c	Sun Jun 11 17:03:41 2017
+++ new/usr/src/uts/common/io/ib/clients/daplt/daplt.c	Sun Jun 11 17:03:41 2017
@@ -69,9 +69,6 @@
 static size_t daplka_dbgnext;
 static int daplka_dbginit = 0;
 static kmutex_t daplka_dbglock;
-_NOTE(MUTEX_PROTECTS_DATA(daplka_dbglock,
-    daplka_dbgbuf
-    daplka_dbgnext))
 
 static int daplka_dbg = 0x0103;
 static void daplka_console(const char *, ...);
@@ -559,8 +556,6 @@
 static avl_tree_t daplka_shared_mr_tree;
 static kmutex_t daplka_shared_mr_lock;
 static int daplka_shared_mr_cmp(const void *, const void *);
-_NOTE(MUTEX_PROTECTS_DATA(daplka_shared_mr_lock,
-    daplka_shared_mr_tree))
 
 /*
  * default kmem flags used by this driver
@@ -2212,11 +2207,9 @@
 	 * put hello message in networking byte order
 	 */
 	dp = (DAPL_PRIVATE *)priv_data;
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*dp))
 	dp->hello_msg.hi_port = htons(dp->hello_msg.hi_port);
 	dp->hello_msg.hi_checksum = 0;
 	dp->hello_msg.hi_checksum = htons(daplka_hellomsg_cksum(dp));
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*dp))
 
 	if (args.epc_timeout > 0) {
 		/*
@@ -2606,7 +2599,6 @@
 	}
 
 	evd_rp = kmem_zalloc(sizeof (daplka_evd_resource_t), daplka_km_flags);
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*evd_rp))
 	DAPLKA_RS_INIT(evd_rp, DAPL_TYPE_EVD,
 	    DAPLKA_RS_RNUM(ia_rp), daplka_evd_destroy);
 
@@ -2694,7 +2686,6 @@
 		goto cleanup;
 	}
 	inserted = B_TRUE;
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*evd_rp))
 
 	/*
 	 * If this evd handles async events need to add to the IA resource
@@ -3488,7 +3479,6 @@
 	daplka_evd_event_t	*evt;
 	ibt_priv_data_len_t	len;
 
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*evd_rp))
 	D3("evd_destroy: entering, evd_rp 0x%p, rnum %d\n",
 	    evd_rp, DAPLKA_RS_RNUM(evd_rp));
 	/*
@@ -3713,7 +3703,6 @@
 		DERR("cno_alloc: cannot allocate cno resource\n");
 		return (ENOMEM);
 	}
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*cno_rp))
 	DAPLKA_RS_INIT(cno_rp, DAPL_TYPE_CNO,
 	    DAPLKA_RS_RNUM(ia_rp), daplka_cno_destroy);
 
@@ -3729,7 +3718,6 @@
 		goto cleanup;
 	}
 	inserted = B_TRUE;
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*cno_rp))
 
 	/* return hkey to library */
 	args.cno_hkey = cno_hkey;
@@ -4198,7 +4186,6 @@
 	uint64_t		spm_conn_qual;
 	daplka_sp_resource_t	*spm_sp_rp;
 } daplka_sp_match_t;
-_NOTE(SCHEME_PROTECTS_DATA("daplka", daplka_sp_match_s::spm_sp_rp))
 
 static int
 daplka_sp_match(void *objp, void *arg)
@@ -4591,7 +4578,6 @@
 		DERR("mr_register: cannot allocate mr resource\n");
 		return (ENOMEM);
 	}
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_rp))
 	DAPLKA_RS_INIT(mr_rp, DAPL_TYPE_MR,
 	    DAPLKA_RS_RNUM(ia_rp), daplka_mr_destroy);
 
@@ -4659,7 +4645,6 @@
 		goto cleanup;
 	}
 	inserted = B_TRUE;
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mr_rp))
 
 	args.mr_lkey = mr_rp->mr_desc.md_lkey;
 	args.mr_rkey = mr_rp->mr_desc.md_rkey;
@@ -4793,7 +4778,6 @@
 			mutex_exit(&daplka_shared_mr_lock);
 			goto cleanup;
 		}
-		_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*smrp))
 		smrp->smr_refcnt = 1;
 		smrp->smr_cookie = args.mrs_shm_cookie;
 		smrp->smr_state = DAPLKA_SMR_TRANSITIONING;
@@ -4800,7 +4784,6 @@
 		smrp->smr_mr_list = NULL;
 		cv_init(&smrp->smr_cv, NULL, CV_DRIVER, NULL);
 		avl_insert(&daplka_shared_mr_tree, smrp, where);
-		_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*smrp))
 	}
 	mutex_exit(&daplka_shared_mr_lock);
 
@@ -4809,7 +4792,6 @@
 		DERR("mr_register_shared: cannot allocate mr resource\n");
 		goto cleanup;
 	}
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_rp))
 	DAPLKA_RS_INIT(mr_rp, DAPL_TYPE_MR,
 	    DAPLKA_RS_RNUM(ia_rp), daplka_mr_destroy);
 
@@ -4923,7 +4905,6 @@
 		goto cleanup;
 	}
 	inserted = B_TRUE;
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mr_rp))
 
 	/*
 	 * at this point, there are two references to our mr resource.
@@ -4978,13 +4959,11 @@
 		if (smrp->smr_refcnt == 0) {
 			DERR("mr_register_shared: freeing smrp 0x%p\n", smrp);
 			avl_remove(&daplka_shared_mr_tree, smrp);
-			_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*smrp))
 			if (smrp->smr_mr_list != NULL) {
 				/*
 				 * the refcnt is 0. if there is anything
 				 * left on the list, it must be ours.
 				 */
-				_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_rp))
 				ASSERT(smrp->smr_mr_list == mr_rp);
 				DAPLKA_RS_UNREF(mr_rp);
 				smrp->smr_mr_list = NULL;
@@ -5006,7 +4985,6 @@
 				/*
 				 * search and remove mr_rp from smr_mr_list
 				 */
-				_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_rp))
 				mpp = &smrp->smr_mr_list;
 				while (*mpp != NULL) {
 					if (*mpp == mr_rp) {
@@ -5078,7 +5056,6 @@
 		retval = ENOMEM;
 		goto cleanup;
 	}
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_rp))
 	DAPLKA_RS_INIT(mr_rp, DAPL_TYPE_MR,
 	    DAPLKA_RS_RNUM(ia_rp), daplka_mr_destroy);
 
@@ -5136,7 +5113,6 @@
 		goto cleanup;
 	}
 	inserted = B_TRUE;
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mr_rp))
 
 	args.mrl_lkey = mr_rp->mr_desc.md_lkey;
 	args.mrl_rkey = mr_rp->mr_desc.md_rkey;
@@ -5367,7 +5343,6 @@
 	daplka_mr_resource_t	*mr_rp = (daplka_mr_resource_t *)gen_rp;
 	ibt_status_t		status;
 
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mr_rp))
 	ASSERT(DAPLKA_RS_REFCNT(mr_rp) == 0);
 	ASSERT(mr_rp->mr_shared_mr == NULL);
 	D3("mr_destroy: entering, mr_rp 0x%p, rnum %d\n",
@@ -5459,7 +5434,6 @@
 		DERR("pd_alloc: cannot allocate pd resource\n");
 		return (ENOMEM);
 	}
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*pd_rp))
 	DAPLKA_RS_INIT(pd_rp, DAPL_TYPE_PD,
 	    DAPLKA_RS_RNUM(ia_rp), daplka_pd_destroy);
 
@@ -5482,7 +5456,6 @@
 		goto cleanup;
 	}
 	inserted = B_TRUE;
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*pd_rp))
 
 	/* return hkey to library */
 	args.pda_hkey = pd_hkey;
@@ -5525,7 +5498,6 @@
 	daplka_pd_resource_t *pd_rp = (daplka_pd_resource_t *)gen_rp;
 	ibt_status_t status;
 
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*pd_rp))
 	ASSERT(DAPLKA_RS_REFCNT(pd_rp) == 0);
 	D3("pd_destroy: entering, pd_rp %p, rnum %d\n",
 	    pd_rp, DAPLKA_RS_RNUM(pd_rp));
@@ -5617,7 +5589,6 @@
 		DERR("mw_alloc: cannot allocate mw resource\n");
 		return (ENOMEM);
 	}
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mw_rp))
 	DAPLKA_RS_INIT(mw_rp, DAPL_TYPE_MW,
 	    DAPLKA_RS_RNUM(ia_rp), daplka_mw_destroy);
 
@@ -5698,7 +5669,6 @@
 		goto cleanup;
 	}
 	inserted = B_TRUE;
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mw_rp))
 
 	D3("mw_alloc: ibt_alloc_mw mw_hdl(%p) mw_rkey(0x%llx)\n",
 	    mw_rp->mw_hdl, (longlong_t)mw_rkey);
@@ -5793,7 +5763,6 @@
 	daplka_mw_resource_t	*mw_rp = (daplka_mw_resource_t *)gen_rp;
 	ibt_status_t		status;
 
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mw_rp))
 	ASSERT(DAPLKA_RS_REFCNT(mw_rp) == 0);
 	D3("mw_destroy: entering, mw_rp 0x%p, rnum %d\n",
 	    mw_rp, DAPLKA_RS_RNUM(mw_rp));
@@ -6203,7 +6172,6 @@
 		DERR("service_register: cannot allocate sp resource\n");
 		return (ENOMEM);
 	}
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sp_rp))
 	DAPLKA_RS_INIT(sp_rp, DAPL_TYPE_SP,
 	    DAPLKA_RS_RNUM(ia_rp), daplka_sp_destroy);
 
@@ -6297,7 +6265,6 @@
 		DERR("service_register: cannot insert sp resource\n");
 		goto cleanup;
 	}
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*sp_rp))
 
 	/* insert into per-IA sp hash table */
 	retval = daplka_hash_insert(&ia_rp->ia_sp_htbl,
@@ -6425,7 +6392,6 @@
 	daplka_sp_resource_t *sp_rp = (daplka_sp_resource_t *)gen_rp;
 	ibt_status_t status;
 
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*sp_rp))
 	ASSERT(DAPLKA_RS_REFCNT(sp_rp) == 0);
 	D3("sp_destroy: entering, sp_rp %p, rnum %d\n",
 	    sp_rp, DAPLKA_RS_RNUM(sp_rp));
@@ -6583,7 +6549,6 @@
 		    spp->sp_backlog_size);
 		return (IBT_CM_NO_RESOURCE);
 	}
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*conn))
 
 	/*
 	 * save data for cr_handoff
@@ -6671,7 +6636,6 @@
 	daplka_evd_wakeup(spp->sp_evd_res,
 	    &spp->sp_evd_res->evd_cr_events, cr_ev);
 
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*conn))
 	return (IBT_CM_DEFER);
 
 cleanup:;
@@ -6994,7 +6958,6 @@
 	 * default is not to return priv data
 	 */
 	if (ret_args != NULL) {
-		_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ret_args))
 		ret_args->cm_ret_len = 0;
 	}
 
@@ -7423,7 +7386,6 @@
 	 * default is not to return priv data
 	 */
 	if (ret_args != NULL) {
-		_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ret_args))
 		ret_args->cm_ret_len = 0;
 	}
 
@@ -7545,7 +7507,6 @@
 	ibt_free_portinfo(pinfop, size);
 
 	ia_rp = kmem_zalloc(sizeof (daplka_ia_resource_t), daplka_km_flags);
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ia_rp))
 	DAPLKA_RS_INIT(ia_rp, DAPL_TYPE_IA, rnum, daplka_ia_destroy);
 
 	mutex_init(&ia_rp->ia_lock, NULL, MUTEX_DRIVER, NULL);
@@ -7637,7 +7598,6 @@
 		goto cleanup;
 	}
 	inserted = B_TRUE;
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*ia_rp))
 
 	args.ia_resnum = rnum;
 	retval = copyout(&args, (void *)arg, sizeof (dapl_ia_create_t));
@@ -7675,7 +7635,6 @@
 	int			cnt;
 	ibt_ar_t		ar_s;
 
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*ia_rp))
 	D3("ia_destroy: entering, ia_rp 0x%p\n", ia_rp);
 
 	/* deregister Address Record */
@@ -9083,7 +9042,6 @@
 static void
 daplka_resource_init(void)
 {
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(daplka_resource))
 	rw_init(&daplka_resource.daplka_rct_lock, NULL, RW_DRIVER, NULL);
 	daplka_resource.daplka_rc_len = 0;
 	daplka_resource.daplka_rc_sz = 0;
@@ -9090,7 +9048,6 @@
 	daplka_resource.daplka_rc_cnt = 0;
 	daplka_resource.daplka_rc_flag = 0;
 	daplka_resource.daplka_rc_root = NULL;
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(daplka_resource))
 }
 
 /*
@@ -9429,7 +9386,6 @@
 		DERR("hash_create: nbuckets not power of 2\n");
 		return (EINVAL);
 	}
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*htblp))
 
 	htblp->ht_buckets =
 	    kmem_zalloc(sizeof (daplka_hash_bucket_t) * nbuckets,
@@ -9439,10 +9395,8 @@
 		return (ENOMEM);
 	}
 	for (i = 0; i < nbuckets; i++) {
-		_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(htblp->ht_buckets[i]))
 		htblp->ht_buckets[i].hb_count = 0;
 		htblp->ht_buckets[i].hb_entries = NULL;
-		_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(htblp->ht_buckets[i]))
 	}
 	rw_init(&htblp->ht_table_lock, NULL, RW_DRIVER, NULL);
 	mutex_init(&htblp->ht_key_lock, NULL, MUTEX_DRIVER, NULL);
@@ -9454,7 +9408,6 @@
 	htblp->ht_lookup_func = lookup_func;
 	htblp->ht_initialized = B_TRUE;
 	D3("hash_create: done, buckets = %d\n", nbuckets);
-	_NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*htblp))
 	return (0);
 }
 
@@ -9648,7 +9601,6 @@
 
 	ASSERT(lockmode == RW_WRITER || lockmode == RW_READER);
 
-	/* needed for warlock */
 	if (lockmode == RW_WRITER) {
 		rw_enter(&htblp->ht_table_lock, RW_WRITER);
 	} else {
