From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 11 15:50:32 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1FBF437B40C for ; Mon, 11 Aug 2003 15:50:32 -0700 (PDT) Received: from smtp4.Stanford.EDU (smtp4.Stanford.EDU [171.67.16.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8964443FB1 for ; Mon, 11 Aug 2003 15:50:28 -0700 (PDT) (envelope-from tedu@stanford.edu) Received: (from root@localhost) by smtp4.Stanford.EDU (8.12.9/8.12.9) id h7BMoSFI009626 for freebsd-hackers@FreeBSD.org; Mon, 11 Aug 2003 15:50:28 -0700 (PDT) Received: from saga8.Stanford.EDU (saga8.Stanford.EDU [171.64.15.138]) by smtp4.Stanford.EDU (8.12.9/8.12.9) with ESMTP id h7BMoQZu009618; Mon, 11 Aug 2003 15:50:26 -0700 (PDT) Date: Mon, 11 Aug 2003 15:50:26 -0700 (PDT) From: Ted Unangst To: John Baldwin In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@FreeBSD.org Subject: Re: possible deadlocks? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2003 22:50:33 -0000 On Mon, 11 Aug 2003, John Baldwin wrote: > You can't ifconfig sk0 until after it attaches. sk0 and sk1 don't > share locks, so you don't have to worry about the interaction there. I believe they do share a lock. Each port of a dual port sk appears as an individual interface, but they share the same sk_softc. Is that incorrect? So sk0 will be attached, but for a short while, sk1 will not be attached, even though they share the softc, which is really for the skc. > Also, SK_LOCK != SK_IF_LOCK, or is that a typo? If it is a typo, > then the lock order should still be fixed in some fashion. They are the same. SK_IF_LOCK is called on the sk_if_softc, but just locks the shared sk_softc mutex. Does that make sense? #define SK_LOCK(_sc) mtx_lock(&(_sc)->sk_mtx) #define SK_IF_LOCK(_sc) mtx_lock(&(_sc)->sk_softc->sk_mtx) -- "I am a great mayor; I am an upstanding Christian man; I am an intelligent man; I am a deeply educated man; I am a humble man." - M. Barry, Mayor of Washington, DC