Adrian Chadd d52f713265 Attempt to further fix some of the concurrency/reset issues that occur.
* ath_reset() is being called in softclock context, which may have the
  thing sleep on a lock.  To avoid this, since we really _shouldn't_
  be sleeping on any locks, break out the no-loss reset path into a tasklet
  and call that from:

  + ath_calibrate()
  + ath_watchdog()

  This has the added advantage that it'll end up also doing the frame
  RX cleanup from within the taskqueue context, rather than the softclock
  context.

* Shuffle around the taskqueue_block() call to be before we grab the lock
  and disable interrupts.

  The trouble here is that taskqueue_block() doesn't block currently
  queued (but not yet running) tasks so calling it doesn't guarantee
  no further tasks (that weren't running on _A_ CPU at the time of this
  call) will complete.  Calling taskqueue_drain() on these tasks won't
  work because if any _other_ thread calls taskqueue_enqueue() for whatever
  reason, everything gets very angry and stops working.

  This slightly changes the race condition enough to let ath_rx_tasklet()
  run before we try disabling it, and thus quietens the warnings a bit.

  The (more) true solution will be doing something like the following:

  * having a taskqueue_blocked mask in ath_softc;
  * having an interrupt_blocked mask in ath_softc;
  * only calling taskqueue_drain() on each individual task _after_ the
    lock has been acquired - that way no further tasklet scheduling
    is going to occur.
  * Then once the tasks have been blocked _and_ the interrupt has been
    disabled, call taskqueue_drain() on each, ensuring that anything
    that _was_ scheduled or running is removed.

  The trouble is if something calls taskqueue_enqueue() on a task
  after taskqueue_blocked() has been called but BEFORE taskqueue_drain()
  has been called, ta_pending will be set to 1 and taskqueue_drain()
  will sit there stuck in msleep() until you hard-kill the machine.

PR: kern/165382
PR: kern/165220
2012-02-25 19:12:54 +00:00
..
2012-01-15 13:23:18 +00:00
2011-10-13 20:06:19 +00:00
2011-12-17 10:23:17 +00:00
2011-12-17 10:23:17 +00:00
2011-02-21 09:01:34 +00:00
2011-11-23 20:27:26 +00:00
2011-06-28 08:36:48 +00:00
2011-12-15 06:29:13 +00:00
2012-01-10 20:52:02 +00:00
2012-01-15 13:23:18 +00:00
2012-01-25 04:48:27 +00:00
2012-01-31 13:00:40 +00:00
2012-01-15 13:23:43 +00:00
2011-12-17 10:23:17 +00:00
2012-02-22 01:08:59 +00:00
2011-12-17 10:23:17 +00:00
2011-10-18 08:09:44 +00:00
2011-03-24 08:56:12 +00:00
2011-12-17 10:23:17 +00:00
2011-05-15 13:17:08 +00:00
2011-12-17 10:23:17 +00:00
2012-01-02 12:12:10 +00:00
2012-01-11 15:00:16 +00:00
2012-01-15 13:23:43 +00:00
2012-02-17 13:55:17 +00:00
2012-01-15 13:23:18 +00:00
2011-12-17 10:23:17 +00:00
2011-10-07 08:59:54 +00:00
2012-01-15 13:23:18 +00:00
2011-12-15 05:07:16 +00:00
2011-12-15 06:29:13 +00:00
2012-01-16 06:00:44 +00:00
2012-02-14 21:36:55 +00:00
2012-02-11 08:12:52 +00:00
2011-12-22 15:13:32 +00:00
2011-10-18 08:09:44 +00:00
2011-11-23 05:34:01 +00:00
2011-12-17 10:23:17 +00:00
2012-02-16 16:48:12 +00:00
2011-11-23 20:27:26 +00:00