Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Apr 2003 11:09:09 -0700 (PDT)
From:      Nate Lawson <nate@root.org>
To:        Warner Losh <imp@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h
Message-ID:  <Pine.BSF.4.21.0304291101001.75697-100000@root.org>
In-Reply-To: <20030429054515.D74EF37B490@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 28 Apr 2003, Warner Losh wrote:
>   Modified files:
>     sys/dev/fxp          if_fxp.c if_fxpvar.h 
>   Log:
>   Fix 5 bugs:
>           1) always call fxp_stop in fxp_detach.  Since we don't read from
>              the card, there's no need to carefully look at things with
>              bus_child_present.

However, we do write to the card registers (i.e. to disable interrupt
generation).  Since you were the one who suggested I should add these
calls, can you give more information about when bus_child_present should
be used (and update the man page if anything changed)?

>           2) Call FXP_UNLOCK() before calling bus_teardown_intr to avoid
>              a possible deadlock reported by jhb.

This adds a race since fxp_intr could occur after the unlock but before
the bus_teardown_intr call.  The reason why I tore down the intr while
holding the lock is so fxp_intr would be prevented from accessing the
device until it has been disabled.  Then the normal checks in fxp_intr
(IFF_OACTIVE or whatever) would show the card is gone and return without
accessing it.  I guess this is ok since ether_ifdetach is still called
with the lock held (since it is what clears IFF_OACTIVE) but I'm
interested in your thoughts.

>           3) add gone to the softc.  Set it to true in detach.
>           4) Return immediately if gone is true in fxp_ioctl
>           5) Return immediately if gone is true in fxp_intr

Not sure this approach is necessary.

-Nate



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0304291101001.75697-100000>