From owner-svn-src-head@FreeBSD.ORG Sat Feb 9 00:35:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 304DADF0; Sat, 9 Feb 2013 00:35:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 224DBC41; Sat, 9 Feb 2013 00:35:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r190ZS1Q005014; Sat, 9 Feb 2013 00:35:28 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r190ZS1X005013; Sat, 9 Feb 2013 00:35:28 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201302090035.r190ZS1X005013@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 9 Feb 2013 00:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246575 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 00:35:29 -0000 Author: np Date: Sat Feb 9 00:35:28 2013 New Revision: 246575 URL: http://svnweb.freebsd.org/changeset/base/246575 Log: Do not hold locks around hardware context reads. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Feb 9 00:29:36 2013 (r246574) +++ head/sys/dev/cxgbe/t4_main.c Sat Feb 9 00:35:28 2013 (r246575) @@ -5161,23 +5161,24 @@ get_sge_context(struct adapter *sc, stru cntxt->mem_id != CTXT_FLM && cntxt->mem_id != CTXT_CNM) return (EINVAL); + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4ctxt"); + if (rc) + return (rc); + if (sc->flags & FW_OK) { - rc = begin_synchronized_op(sc, NULL, HOLD_LOCK, "t4ctxt"); - if (rc == 0) { - rc = -t4_sge_ctxt_rd(sc, sc->mbox, cntxt->cid, - cntxt->mem_id, &cntxt->data[0]); - end_synchronized_op(sc, LOCK_HELD); - if (rc == 0) - return (0); - } + rc = -t4_sge_ctxt_rd(sc, sc->mbox, cntxt->cid, cntxt->mem_id, + &cntxt->data[0]); + if (rc == 0) + goto done; } /* * Read via firmware failed or wasn't even attempted. Read directly via * the backdoor. */ - rc = -t4_sge_ctxt_rd_bd(sc, cntxt->cid, cntxt->mem_id, - &cntxt->data[0]); + rc = -t4_sge_ctxt_rd_bd(sc, cntxt->cid, cntxt->mem_id, &cntxt->data[0]); +done: + end_synchronized_op(sc, 0); return (rc); }