linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elias Oltmanns <eo@nebensachen.de>
To: linux-wireless@vger.kernel.org
Cc: ath5k-devel@lists.ath5k.org
Subject: Re: Oops with current kernel and ath5k
Date: Wed, 01 Oct 2008 23:10:37 +0200	[thread overview]
Message-ID: <87ej30m376.fsf@denkblock.local> (raw)
In-Reply-To: 200810012055.58085.toralf.foerster@gmx.de

Toralf F=F6rster <toralf.foerster@gmx.de> wrote:
> Hello,
>
> the issue (initially reported in August 2008) still remains in the cu=
rrent=20
> kernel at my ThinkPad T41, a screen shot is attached. The steps to re=
produce=20
> are :
>
> 1. modprobe it
> 2. suspend the system to ram
> 3. wake it up
> 4. rmmod the driver

Yes, I have run into this problem too. The patch below (applies to
2.6.27-rc8) fixes the problem, but since I'm not a wireless hacker,
developers might prefer a different approach. Please let me know if I
should change anything. Perhaps I should split this into two separate
patches?

Regards,

Elias

---
=46rom: Elias Oltmanns <eo@nebensachen.de>
Subject: ath5k: Do not start the hw unconditionally on resume from s2ra=
m

Currently, ath5k_pci_resume() calls ath5k_init() unconditionally.
Therefore, the following sequence of events leads to a kernel panic:
# modprobe ath5k
suspend to ram
resume
# modprobe -r ath5k
The calibration timer is not stopped even though the structs go away
underneath.

Signed-off-by: Elias Oltmanns <eo@nebensachen.de>
---

 drivers/net/wireless/ath5k/base.c |    8 +++++---
 include/net/mac80211.h            |   11 +++++++++++
 net/mac80211/main.c               |    6 ++++++
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/a=
th5k/base.c
index 0676c6d..df602ee 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -621,9 +621,11 @@ ath5k_pci_resume(struct pci_dev *pdev)
 		goto err_no_irq;
 	}
=20
-	err =3D ath5k_init(sc);
-	if (err)
-		goto err_irq;
+	if (ieee80211_opened(hw)) {
+		err =3D ath5k_init(sc);
+		if (err)
+			goto err_irq;
+	}
 	ath5k_led_enable(sc);
=20
 	/*
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index ff137fd..d15a6ba 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1671,6 +1671,17 @@ void ieee80211_iterate_active_interfaces_atomic(=
struct ieee80211_hw *hw,
 						void *data);
=20
 /**
+ * ieee80211_opened - Determine whether device has been opened.
+ * @hw: pointer as obtained from ieee80211_alloc_hw().
+ * @return: how many times interface has been opened
+ *
+ * Allows low level drivers to find out whether the ieee80211 layer
+ * considers the device opened. In fact, the number of opened virtual
+ * interfaces associated with the hw is returned.
+ */
+int ieee80211_opened(struct ieee80211_hw *hw);
+
+/**
  * ieee80211_start_tx_ba_session - Start a tx Block Ack session.
  * @hw: pointer as obtained from ieee80211_alloc_hw().
  * @ra: receiver address of the BA session recipient
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index aa5a191..4f77496 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -557,6 +557,12 @@ static int ieee80211_stop(struct net_device *dev)
 	return 0;
 }
=20
+int ieee80211_opened(struct ieee80211_hw *hw)
+{
+	return hw_to_local(hw)->open_count;
+}
+EXPORT_SYMBOL(ieee80211_opened);
+
 int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16=
 tid)
 {
 	struct ieee80211_local *local =3D hw_to_local(hw);

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-10-01 21:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200808101401.03339.toralf.foerster@gmx.de>
     [not found] ` <b6c5339f0808101124x6f9359dct9ad828db1e6d1b2c@mail.gmail.com>
2008-10-01 18:55   ` Oops with current kernel and ath5k Toralf Förster
2008-10-01 21:10     ` Elias Oltmanns [this message]
2008-10-01 22:15       ` [ath5k-devel] " Bob Copeland
2008-10-01 22:34         ` Elias Oltmanns
2008-10-02  2:04           ` Bob Copeland
2008-10-02  7:53             ` Elias Oltmanns
2008-10-02  9:24               ` Johannes Berg
2008-10-02 12:52               ` Bob Copeland
2008-10-02 15:02                 ` Bob Copeland
2008-10-02 16:31                   ` Elias Oltmanns
2008-10-02 18:37                     ` Bob Copeland
2008-10-03 14:13                       ` Bob Copeland
2008-10-03 14:42                         ` Elias Oltmanns
2008-10-03 19:43                           ` Bob Copeland
2008-10-05 12:45                             ` Elias Oltmanns
2008-10-06 14:12                               ` Bob Copeland
2008-10-06 14:23                                 ` Johannes Berg
2008-10-06 14:36                                   ` Bob Copeland
2008-10-09 10:40                                     ` Johannes Berg
2008-10-07  1:35                               ` Bob Copeland
2008-10-07 10:44                                 ` Elias Oltmanns
2008-10-07 12:19                                   ` Bob Copeland
2008-10-07 12:57                                   ` Bob Copeland
2008-10-07 20:48                                     ` Elias Oltmanns
2008-10-07 13:06                                   ` Bob Copeland
2008-10-07 20:52                                     ` Elias Oltmanns
2008-10-09  2:15                                       ` Bob Copeland
2008-10-11 20:30                                         ` Elias Oltmanns
2008-10-02  8:17       ` Johannes Berg

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=87ej30m376.fsf@denkblock.local \
    --to=eo@nebensachen.de \
    --cc=ath5k-devel@lists.ath5k.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).