From owner-p4-projects@FreeBSD.ORG Fri Oct 2 01:58:49 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C8C66106568D; Fri, 2 Oct 2009 01:58:49 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D53B106566B for ; Fri, 2 Oct 2009 01:58:49 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7CA6E8FC17 for ; Fri, 2 Oct 2009 01:58:49 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n921wnx3031411 for ; Fri, 2 Oct 2009 01:58:49 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n921wnsh031409 for perforce@freebsd.org; Fri, 2 Oct 2009 01:58:49 GMT (envelope-from scottl@freebsd.org) Date: Fri, 2 Oct 2009 01:58:49 GMT Message-Id: <200910020158.n921wnsh031409@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Cc: Subject: PERFORCE change 169116 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2009 01:58:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=169116 Change 169116 by scottl@scottl-y1 on 2009/10/02 01:58:39 Reduce the scope of the locking in xpt_finishconfig_func. The locking is wonky because of the device iteration code that needs to grab each SIM lock. Affected files ... .. //depot/projects/firewire/sys/cam/cam_xpt.c#3 edit Differences ... ==== //depot/projects/firewire/sys/cam/cam_xpt.c#3 (text+ko) ==== @@ -4716,7 +4716,6 @@ struct periph_driver **p_drv; int i; - mtx_lock(&xsoftc.xpt_lock); if (busses_to_config == 0) { /* Register all the peripheral drivers */ /* XXX This will have to change when we have loadable modules */ @@ -4733,11 +4732,12 @@ xpt_for_all_devices(xptpassannouncefunc, NULL); /* Release our hook so that the boot can continue. */ + mtx_lock(&xsoftc.xpt_lock); wakeup(xpt_config); + mtx_unlock(&xsoftc.xpt_lock); } free(context, M_CAMXPT); - mtx_unlock(&xsoftc.xpt_lock); } static void