From owner-svn-src-stable@FreeBSD.ORG Tue Oct 30 19:24:06 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 30B4C72D; Tue, 30 Oct 2012 19:24:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17CAF8FC14; Tue, 30 Oct 2012 19:24:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UJO5FM057696; Tue, 30 Oct 2012 19:24:05 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UJO503057694; Tue, 30 Oct 2012 19:24:05 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201210301924.q9UJO503057694@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 30 Oct 2012 19:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242370 - stable/8/sys/dev/cxgb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 19:24:06 -0000 Author: np Date: Tue Oct 30 19:24:05 2012 New Revision: 242370 URL: http://svn.freebsd.org/changeset/base/242370 Log: MFC r242087: Initialize the response queue mutex a bit earlier to avoid a panic that occurs if t3_sge_alloc_qset fails and then t3_free_qset attempts to destroy an uninitialized mutex. Modified: stable/8/sys/dev/cxgb/cxgb_sge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/cxgb/ (props changed) Modified: stable/8/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_sge.c Tue Oct 30 19:21:53 2012 (r242369) +++ stable/8/sys/dev/cxgb/cxgb_sge.c Tue Oct 30 19:24:05 2012 (r242370) @@ -2593,6 +2593,10 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i goto err; } + snprintf(q->rspq.lockbuf, RSPQ_NAME_LEN, "t3 rspq lock %d:%d", + device_get_unit(sc->dev), irq_vec_idx); + MTX_INIT(&q->rspq.lock, q->rspq.lockbuf, NULL, MTX_DEF); + for (i = 0; i < ntxq; ++i) { size_t sz = i == TXQ_CTRL ? 0 : sizeof(struct tx_sw_desc); @@ -2708,11 +2712,7 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i goto err_unlock; } } - - snprintf(q->rspq.lockbuf, RSPQ_NAME_LEN, "t3 rspq lock %d:%d", - device_get_unit(sc->dev), irq_vec_idx); - MTX_INIT(&q->rspq.lock, q->rspq.lockbuf, NULL, MTX_DEF); - + mtx_unlock_spin(&sc->sge.reg_lock); t3_update_qset_coalesce(q, p); q->port = pi;