From owner-p4-projects@FreeBSD.ORG Thu Jan 4 20:06:20 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CBB5C16A47B; Thu, 4 Jan 2007 20:06:20 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8E6B216A416 for ; Thu, 4 Jan 2007 20:06:20 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 80E8C13C43E for ; Thu, 4 Jan 2007 20:06:20 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l04K6KdL007852 for ; Thu, 4 Jan 2007 20:06:20 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l04K6K1F007848 for perforce@freebsd.org; Thu, 4 Jan 2007 20:06:20 GMT (envelope-from kmacy@freebsd.org) Date: Thu, 4 Jan 2007 20:06:20 GMT Message-Id: <200701042006.l04K6K1F007848@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 112489 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: Thu, 04 Jan 2007 20:06:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=112489 Change 112489 by kmacy@kmacy_serendipity:sam_wifi on 2007/01/04 20:06:08 fix LOR by dropping softc lock before callling ieee80211_input avoid race with unload by making stop sleep if RAL_INPUT_RUNNING is set Affected files ... .. //depot/projects/wifi/sys/dev/ral/rt2560.c#8 edit .. //depot/projects/wifi/sys/dev/ral/rt2560var.h#5 edit Differences ... ==== //depot/projects/wifi/sys/dev/ral/rt2560.c#8 (text) ==== @@ -1170,6 +1170,8 @@ bpf_mtap2(sc->sc_drvbpf, tap, sc->sc_rxtap_len, m); } + sc->sc_flags |= RAL_INPUT_RUNNING; + RAL_UNLOCK(sc); wh = mtod(m, struct ieee80211_frame *); ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); @@ -1184,6 +1186,8 @@ /* node is no longer needed */ ieee80211_free_node(ni); + RAL_LOCK(sc); + sc->sc_flags &= ~RAL_INPUT_RUNNING; skip: desc->flags = htole32(RT2560_RX_BUSY); DPRINTFN(15, ("decryption done idx=%u\n", sc->rxq.cur_decrypt)); @@ -2736,7 +2740,12 @@ struct rt2560_softc *sc = priv; struct ieee80211com *ic = &sc->sc_ic; struct ifnet *ifp = ic->ic_ifp; + volatile int *flags = &sc->sc_flags; + while (*flags & RAL_INPUT_RUNNING) { + msleep(sc, &sc->sc_mtx, 0, "ralrunning", hz/10); + } + sc->sc_tx_timer = 0; ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); ==== //depot/projects/wifi/sys/dev/ral/rt2560var.h#5 (text) ==== @@ -156,6 +156,8 @@ } sc_txtapu; #define sc_txtap sc_txtapu.th int sc_txtap_len; +#define RAL_INPUT_RUNNING 1 + int sc_flags; }; int rt2560_attach(device_t, int);