From owner-freebsd-wireless@FreeBSD.ORG Fri Mar 2 03:00:35 2012 Return-Path: Delivered-To: freebsd-wireless@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 975A8106564A for ; Fri, 2 Mar 2012 03:00:35 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6D03E8FC15 for ; Fri, 2 Mar 2012 03:00:35 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q2230Zmo098603 for ; Fri, 2 Mar 2012 03:00:35 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q2230Z5B098602; Fri, 2 Mar 2012 03:00:35 GMT (envelope-from gnats) Date: Fri, 2 Mar 2012 03:00:35 GMT Message-Id: <201203020300.q2230Z5B098602@freefall.freebsd.org> To: freebsd-wireless@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: kern/163318: commit references a PR X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service 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: Fri, 02 Mar 2012 03:00:35 -0000 The following reply was made to PR kern/163318; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/163318: commit references a PR Date: Fri, 2 Mar 2012 02:53:55 +0000 (UTC) Author: adrian Date: Fri Mar 2 02:53:43 2012 New Revision: 232373 URL: http://svn.freebsd.org/changeset/base/232373 Log: Attempt to catch scan cancellations at exactly the wrong time from occuring. The scan code unlocks the comlock and calls into the driver. It then assumes the state hasn't changed from underneath it. Although I haven't seen this particular condition trigger, I'd like to be informed if I or anyone else sees it. What I'm thinking may occur: * A cancellation comes in during the scan_end call; * the cancel flag is set; * but it's never checked, so scandone isn't updated; * .. and the interface stays in the STA power save mode. It's a subtle race, if it even exists. PR: kern/163318 Modified: head/sys/net80211/ieee80211_scan.c Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Fri Mar 2 00:21:07 2012 (r232372) +++ head/sys/net80211/ieee80211_scan.c Fri Mar 2 02:53:43 2012 (r232373) @@ -960,6 +960,19 @@ scan_task(void *arg, int pending) IEEE80211_LOCK(ic); /* + * Since a cancellation may have occured during one of the + * driver calls (whilst unlocked), update scandone. + */ + if (scandone == 0 && + ((SCAN_PRIVATE(ss)->ss_iflags & ISCAN_CANCEL) != 0)) { + /* XXX printf? */ + if_printf(vap->iv_ifp, + "%s: OOPS! scan cancelled during driver call!\n", + __func__); + } + scandone |= ((SCAN_PRIVATE(ss)->ss_iflags & ISCAN_CANCEL) != 0); + + /* * Record scan complete time. Note that we also do * this when canceled so any background scan will * not be restarted for a while. _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"