From nobody@FreeBSD.org  Sun Jun  2 22:06:00 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 61169E31
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  2 Jun 2013 22:06:00 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	by mx1.freebsd.org (Postfix) with ESMTP id 540941A8B
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  2 Jun 2013 22:06:00 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r52M60VX060717
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 2 Jun 2013 22:06:00 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r52M60MW060713;
	Sun, 2 Jun 2013 22:06:00 GMT
	(envelope-from nobody)
Message-Id: <201306022206.r52M60MW060713@oldred.freebsd.org>
Date: Sun, 2 Jun 2013 22:06:00 GMT
From: Kim Culhan <w8hdkim@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: panic in ath
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         179232
>Category:       kern
>Synopsis:       [ath] panic in ath
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-wireless
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 02 22:10:00 UTC 2013
>Closed-Date:    Sun Apr 20 01:47:19 UTC 2014
>Last-Modified:  Sun Apr 20 01:47:19 UTC 2014
>Originator:     Kim Culhan
>Release:        10.0-CURRENT r251078M
>Organization:
>Environment:
FreeBSD hyster3.kim.net 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r251078M: Tue May 28 20:02:52 EDT 2013     kimc@hyster3.kim.net:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
panic in ath driver, after which console is in the debugger.

The machine is used a router and wireless access point among other things,
panic may happen once in 24 hours of use.

Has Intel Core 2 cpu, 4 GB ram, running 10.0-current built with clang.

Very reliable otherwise.


>How-To-Repeat:
ATH wireless running with Atheros 9227 and 4 access points configured and running.

2 wired network interfaces, routing between interfaces, no traffic on wireless.

Run the machine for several hours, panic occurs randomly, traffic on the
wireless is not necessary.

Not necessary to have any of the access points associated with clients.

>Fix:
Crash dump not attached to this report, 160KB, too large for 100KB limit.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-wireless 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Jun 3 11:27:32 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=179232 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/179232: commit references a PR
Date: Mon,  3 Jun 2013 19:39:50 +0000 (UTC)

 Author: adrian
 Date: Mon Jun  3 19:39:37 2013
 New Revision: 251342
 URL: http://svnweb.freebsd.org/changeset/base/251342
 
 Log:
   Fix the order of TX shutdown and reset.
   
   * Grab the reset lock first, so any subsequent interrupt, TX, RX work
     will fail
   
   * Then shut down interrupts
   
   * Then wait for TX/RX to finish running
   
   At this point no further work will be running, so it's safe to do the
   reset path code.
   
   PR:		kern/179232
 
 Modified:
   head/sys/dev/ath/if_ath.c
 
 Modified: head/sys/dev/ath/if_ath.c
 ==============================================================================
 --- head/sys/dev/ath/if_ath.c	Mon Jun  3 19:29:03 2013	(r251341)
 +++ head/sys/dev/ath/if_ath.c	Mon Jun  3 19:39:37 2013	(r251342)
 @@ -2328,12 +2328,27 @@ ath_reset(struct ifnet *ifp, ATH_RESET_T
  	taskqueue_block(sc->sc_tq);
  
  	ATH_PCU_LOCK(sc);
 -	ath_hal_intrset(ah, 0);		/* disable interrupts */
 -	ath_txrx_stop_locked(sc);	/* Ensure TX/RX is stopped */
 +
 +	/*
 +	 * Grab the reset lock before TX/RX is stopped.
 +	 *
 +	 * This is needed to ensure that when the TX/RX actually does finish,
 +	 * no further TX/RX/reset runs in parallel with this.
 +	 */
  	if (ath_reset_grablock(sc, 1) == 0) {
  		device_printf(sc->sc_dev, "%s: concurrent reset! Danger!\n",
  		    __func__);
  	}
 +
 +	/* disable interrupts */
 +	ath_hal_intrset(ah, 0);
 +
 +	/*
 +	 * Now, ensure that any in progress TX/RX completes before we
 +	 * continue.
 +	 */
 +	ath_txrx_stop_locked(sc);
 +
  	ATH_PCU_UNLOCK(sc);
  
  	/*
 @@ -4871,12 +4886,18 @@ ath_chan_set(struct ath_softc *sc, struc
  	taskqueue_block(sc->sc_tq);
  
  	ATH_PCU_LOCK(sc);
 -	ath_hal_intrset(ah, 0);		/* Stop new RX/TX completion */
 -	ath_txrx_stop_locked(sc);	/* Stop pending RX/TX completion */
 +
 +	/* Stop new RX/TX/interrupt completion */
  	if (ath_reset_grablock(sc, 1) == 0) {
  		device_printf(sc->sc_dev, "%s: concurrent reset! Danger!\n",
  		    __func__);
  	}
 +
 +	ath_hal_intrset(ah, 0);
 +
 +	/* Stop pending RX/TX completion */
 +	ath_txrx_stop_locked(sc);
 +
  	ATH_PCU_UNLOCK(sc);
  
  	DPRINTF(sc, ATH_DEBUG_RESET, "%s: %u (%u MHz, flags 0x%x)\n",
 _______________________________________________
 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"
 
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Sun Apr 20 01:43:17 UTC 2014 
State-Changed-Why:  
fixed nearly 1 year ago. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=179232 
>Unformatted:
