From owner-freebsd-wireless@FreeBSD.ORG Tue May 20 18:22:04 2014 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7027FCB; Tue, 20 May 2014 18:22:04 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48B4B223A; Tue, 20 May 2014 18:22:04 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D30431FE026; Tue, 20 May 2014 20:22:00 +0200 (CEST) Message-ID: <537B9D78.3030103@selasky.org> Date: Tue, 20 May 2014 20:22:48 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Idwer Vollering Subject: Re: if_rsu hardware causes a kernel panic on removal.. References: <537AEC79.6080406@selasky.org> <537B497E.8070701@selasky.org> <537B6F44.6070905@selasky.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------060006010008000807010602" Cc: freebsd-wireless@freebsd.org, freebsd-usb@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2014 18:22:04 -0000 This is a multi-part message in MIME format. --------------060006010008000807010602 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > Hi, > > Certainly, here it is: > http://ra.openbios.org/~idwer/freebsd/core.txt.9_fbsd_10-stable_rsu-panic-on-insertion > > Idwer > Does the attached patch make any difference? --HPS --------------060006010008000807010602 Content-Type: text/x-diff; name="rsu.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rsu.diff" === if_rsu.c ================================================================== --- if_rsu.c (revision 266476) +++ if_rsu.c (local) @@ -189,9 +189,9 @@ static void rsu_init_locked(struct rsu_softc *); static void rsu_watchdog(void *); static int rsu_tx_start(struct rsu_softc *, struct ieee80211_node *, - struct mbuf *, struct rsu_data *); + struct mbuf *, struct rsu_data *, struct usb_xfer *); static void rsu_start(struct ifnet *); -static void rsu_start_locked(struct ifnet *); +static void rsu_start_locked(struct ifnet *, struct usb_xfer *); static int rsu_ioctl(struct ifnet *, u_long, caddr_t); static void rsu_stop(struct ifnet *, int); static void rsu_stop_locked(struct ifnet *, int); @@ -1610,7 +1610,7 @@ usbd_xfer_set_frame_data(xfer, 0, data->buf, data->buflen); DPRINTF("submitting transfer %p\n", data); usbd_transfer_submit(xfer); - rsu_start_locked(ifp); + rsu_start_locked(ifp, xfer); break; default: data = STAILQ_FIRST(&sc->sc_tx_active); @@ -1631,7 +1631,7 @@ static int rsu_tx_start(struct rsu_softc *sc, struct ieee80211_node *ni, - struct mbuf *m0, struct rsu_data *data) + struct mbuf *m0, struct rsu_data *data, struct usb_xfer *xfer_self) { struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; @@ -1736,8 +1736,9 @@ data->ni = ni; data->m = m0; STAILQ_INSERT_TAIL(&sc->sc_tx_pending, data, next); - usbd_transfer_start(xfer); + if (xfer != xfer_self) + usbd_transfer_start(xfer); return (0); } @@ -1750,12 +1751,12 @@ return; RSU_LOCK(sc); - rsu_start_locked(ifp); + rsu_start_locked(ifp, NULL); RSU_UNLOCK(sc); } static void -rsu_start_locked(struct ifnet *ifp) +rsu_start_locked(struct ifnet *ifp, struct usb_xfer *xfer_self) { struct rsu_softc *sc = ifp->if_softc; struct ieee80211_node *ni; @@ -1776,7 +1777,7 @@ ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; m->m_pkthdr.rcvif = NULL; - if (rsu_tx_start(sc, ni, m, bf) != 0) { + if (rsu_tx_start(sc, ni, m, bf, xfer_self) != 0) { ifp->if_oerrors++; STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); ieee80211_free_node(ni); @@ -2303,7 +2304,7 @@ return (ENOBUFS); } ifp->if_opackets++; - if (rsu_tx_start(sc, ni, m, bf) != 0) { + if (rsu_tx_start(sc, ni, m, bf, NULL) != 0) { ieee80211_free_node(ni); ifp->if_oerrors++; STAILQ_INSERT_HEAD(&sc->sc_tx_inactive, bf, next); --------------060006010008000807010602--