--- old/usr/src/uts/common/io/ib/adapters/hermon/hermon_wr.c	Sun Jun 11 17:03:29 2017
+++ new/usr/src/uts/common/io/ib/adapters/hermon/hermon_wr.c	Sun Jun 11 17:03:29 2017
@@ -99,7 +99,6 @@
 	hermon_pio_init(fm_loop_cnt, fm_status, fm_test_num);
 
 	ASSERT(MUTEX_HELD(&qp->qp_sq_lock));
-	_NOTE(LOCK_RELEASED_AS_SIDE_EFFECT(&qp->qp_sq_lock))
 
 	/* Grab the lock for the WRID list */
 	membar_consumer();
@@ -456,7 +455,6 @@
 	hermon_pio_init(fm_loop_cnt, fm_status, fm_test_num);
 
 	ASSERT(MUTEX_HELD(&qp->qp_sq_lock));
-	_NOTE(LOCK_RELEASED_AS_SIDE_EFFECT(&qp->qp_sq_lock))
 
 	/* Save away some initial QP state */
 	wq = qp->qp_sq_wqhdr;
@@ -2220,10 +2218,6 @@
 	if (qp->qp_alloc_flags & IBT_QP_USER_MAP)
 		return (DDI_SUCCESS);
 
-#ifdef __lock_lint
-	mutex_enter(&qp->qp_rq_cqhdl->cq_lock);
-	mutex_enter(&qp->qp_sq_cqhdl->cq_lock);
-#else
 	/* grab the cq lock(s) to modify the wqavl tree */
 	if (qp->qp_rq_cqhdl)
 		mutex_enter(&qp->qp_rq_cqhdl->cq_lock);
@@ -2230,7 +2224,6 @@
 	if (qp->qp_rq_cqhdl != qp->qp_sq_cqhdl &&
 	    qp->qp_sq_cqhdl != NULL)
 		mutex_enter(&qp->qp_sq_cqhdl->cq_lock);
-#endif
 
 	/* Chain the newly allocated work queue header to the CQ's list */
 	if (qp->qp_sq_cqhdl)
@@ -2248,9 +2241,6 @@
 	 * Note: We still use the 'qp_rq_cqhdl' even in the SRQ case.
 	 */
 
-#ifdef __lock_lint
-	mutex_enter(&qp->qp_srqhdl->srq_lock);
-#else
 	if (qp->qp_alloc_flags & IBT_QP_USES_SRQ) {
 		mutex_enter(&qp->qp_srqhdl->srq_lock);
 	} else {
@@ -2260,27 +2250,17 @@
 		rwq->wq_full = 0;
 		qp->qp_rq_wqecntr = 0;
 	}
-#endif
 	hermon_cq_workq_add(qp->qp_rq_cqhdl, &qp->qp_rq_wqavl);
 
-#ifdef __lock_lint
-	mutex_exit(&qp->qp_srqhdl->srq_lock);
-#else
 	if (qp->qp_alloc_flags & IBT_QP_USES_SRQ) {
 		mutex_exit(&qp->qp_srqhdl->srq_lock);
 	}
-#endif
 
-#ifdef __lock_lint
-	mutex_exit(&qp->qp_sq_cqhdl->cq_lock);
-	mutex_exit(&qp->qp_rq_cqhdl->cq_lock);
-#else
 	if (qp->qp_rq_cqhdl != qp->qp_sq_cqhdl &&
 	    qp->qp_sq_cqhdl != NULL)
 		mutex_exit(&qp->qp_sq_cqhdl->cq_lock);
 	if (qp->qp_rq_cqhdl)
 		mutex_exit(&qp->qp_rq_cqhdl->cq_lock);
-#endif
 	return (DDI_SUCCESS);
 }
 
@@ -2300,10 +2280,6 @@
 	 * polled/flushed.
 	 * Grab the CQ lock(s) before manipulating the lists.
 	 */
-#ifdef __lock_lint
-	mutex_enter(&qp->qp_rq_cqhdl->cq_lock);
-	mutex_enter(&qp->qp_sq_cqhdl->cq_lock);
-#else
 	/* grab the cq lock(s) to modify the wqavl tree */
 	if (qp->qp_rq_cqhdl)
 		mutex_enter(&qp->qp_rq_cqhdl->cq_lock);
@@ -2310,42 +2286,28 @@
 	if (qp->qp_rq_cqhdl != qp->qp_sq_cqhdl &&
 	    qp->qp_sq_cqhdl != NULL)
 		mutex_enter(&qp->qp_sq_cqhdl->cq_lock);
-#endif
 
-#ifdef __lock_lint
-	mutex_enter(&qp->qp_srqhdl->srq_lock);
-#else
 	if (qp->qp_alloc_flags & IBT_QP_USES_SRQ) {
 		mutex_enter(&qp->qp_srqhdl->srq_lock);
 	}
-#endif
 	/*
 	 * Flush the entries on the CQ for this QP's QPN.
 	 */
 	hermon_cq_entries_flush(state, qp);
 
-#ifdef __lock_lint
-	mutex_exit(&qp->qp_srqhdl->srq_lock);
-#else
 	if (qp->qp_alloc_flags & IBT_QP_USES_SRQ) {
 		mutex_exit(&qp->qp_srqhdl->srq_lock);
 	}
-#endif
 
 	hermon_cq_workq_remove(qp->qp_rq_cqhdl, &qp->qp_rq_wqavl);
 	if (qp->qp_sq_cqhdl != NULL)
 		hermon_cq_workq_remove(qp->qp_sq_cqhdl, &qp->qp_sq_wqavl);
 
-#ifdef __lock_lint
-	mutex_exit(&qp->qp_sq_cqhdl->cq_lock);
-	mutex_exit(&qp->qp_rq_cqhdl->cq_lock);
-#else
 	if (qp->qp_rq_cqhdl != qp->qp_sq_cqhdl &&
 	    qp->qp_sq_cqhdl != NULL)
 		mutex_exit(&qp->qp_sq_cqhdl->cq_lock);
 	if (qp->qp_rq_cqhdl)
 		mutex_exit(&qp->qp_rq_cqhdl->cq_lock);
-#endif
 
 	return (IBT_SUCCESS);
 }
@@ -2446,9 +2408,6 @@
 	 */
 	cmp.cmp_qpn = qpn;
 	cmp.cmp_type = wq_type;
-#ifdef __lock_lint
-	hermon_wrid_workq_compare(NULL, NULL);
-#endif
 	curr = avl_find(&cq->cq_wrid_wqhdr_avl_tree, &cmp, NULL);
 
 	return (curr);
@@ -2472,7 +2431,6 @@
 	if (wqhdr == NULL) {
 		return (NULL);
 	}
-	_NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*wqhdr))
 	wqhdr->wq_wrid = kmem_zalloc(bufsz * sizeof (uint64_t), KM_NOSLEEP);
 	if (wqhdr->wq_wrid == NULL) {
 		kmem_free(wqhdr, sizeof (*wqhdr));
@@ -2504,9 +2462,6 @@
 
 	cmp.cmp_qpn = wqavl->wqa_qpn;
 	cmp.cmp_type = wqavl->wqa_type;
-#ifdef __lock_lint
-	hermon_wrid_workq_compare(NULL, NULL);
-#endif
 	(void) avl_find(&cq->cq_wrid_wqhdr_avl_tree, &cmp, &where);
 	avl_insert(&cq->cq_wrid_wqhdr_avl_tree, wqavl, where);
 }
@@ -2519,8 +2474,5 @@
 static void
 hermon_cq_workq_remove(hermon_cqhdl_t cq, hermon_workq_avl_t *wqavl)
 {
-#ifdef __lock_lint
-	hermon_wrid_workq_compare(NULL, NULL);
-#endif
 	avl_remove(&cq->cq_wrid_wqhdr_avl_tree, wqavl);
 }
