possible deadlocks?

Ted Unangst tedu at stanford.edu
Mon Aug 11 15:50:33 PDT 2003


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



More information about the freebsd-hackers mailing list