All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Copeland <me@bobcopeland.com>
To: henk <henk@god.dyndns.org>
Cc: linux-wireless@vger.kernel.org
Subject: Re: ath5k in AP mode works!! (but sometimes with an oops, and a panic)
Date: Thu, 28 May 2009 19:47:02 -0400	[thread overview]
Message-ID: <20090528234702.GA9455@hash.localnet> (raw)
In-Reply-To: <20090527184956.GA14462@god.dyndns.org>

On Wed, May 27, 2009 at 08:49:56PM +0200, henk wrote:
> 
> I added some extra checks in ath5k/base.c
> see http://bugzilla.kernel.org/show_bug.cgi?id=13381#c3
> 
> This resolves the panic for now.

Can you try this patch?  It should reduce to a warning if there is
still a bug but hopefully you won't see the warning.  

There's also a chance that it could break beaconing if you kill
hostapd and restart it a few times, but I did a little testing and
it seemed to work ok.

From: Bob Copeland <me@bobcopeland.com>
Date: Thu, 28 May 2009 19:33:50 -0400
Subject: [PATCH] ath5k: disable beacon interrupt when interface is down

When we remove the active interface, there's no need to continue
sending beacons; doing so would cause a null pointer deref in
ieee80211_beacon_get().  Disable the interrupt in remove_interface
and add a WARN_ON(!vif) in case there are other instances lurking.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
 drivers/net/wireless/ath/ath5k/base.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index b6fb15e..f011c44 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2070,6 +2070,13 @@ err_unmap:
 	return ret;
 }
 
+static void ath5k_beacon_disable(struct ath5k_softc *sc)
+{
+	sc->imask &= ~(AR5K_INT_BMISS | AR5K_INT_SWBA);
+	ath5k_hw_set_imr(sc->ah, sc->imask);
+	ath5k_hw_stop_tx_dma(sc->ah, sc->bhalq);
+}
+
 /*
  * Transmit a beacon frame at SWBA.  Dynamic updates to the
  * frame contents are done as needed and the slot time is
@@ -2758,6 +2765,7 @@ ath5k_remove_interface(struct ieee80211_hw *hw,
 
 	ath5k_hw_set_lladdr(sc->ah, mac);
 	sc->vif = NULL;
+	ath5k_beacon_disable(sc);
 end:
 	mutex_unlock(&sc->lock);
 }
@@ -3059,7 +3067,14 @@ ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 {
 	int ret;
 	struct ath5k_softc *sc = hw->priv;
-	struct sk_buff *skb = ieee80211_beacon_get(hw, vif);
+	struct sk_buff *skb;
+
+	if (WARN_ON(!vif)) {
+		ret = -EINVAL;
+		goto out;
+	}
+
+	skb = ieee80211_beacon_get(hw, vif);
 
 	if (!skb) {
 		ret = -ENOMEM;
-- 
1.6.0.6


-- 
Bob Copeland %% www.bobcopeland.com


  reply	other threads:[~2009-05-28 23:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-24 22:20 ath5k in AP mode works!! (but sometimes with an oops, and a panic) henk
2009-05-27 12:50 ` Bob Copeland
2009-05-27 17:43   ` henk
2009-05-27 18:49   ` henk
2009-05-28 23:47     ` Bob Copeland [this message]
2009-05-29 22:02       ` henk
2009-05-30  1:06         ` Bob Copeland
2009-06-01 22:22           ` henk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090528234702.GA9455@hash.localnet \
    --to=me@bobcopeland.com \
    --cc=henk@god.dyndns.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.