linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <florian@openwrt.org>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, dsd@gentoo.org,
	kune@deine-taler.de, jussi.kivilinna@mbnet.fi,
	Florian Fainelli <florian@openwrt.org>
Subject: [PATCH] zd1211rw: wait between setting hash table and powering radio on
Date: Thu,  9 Feb 2012 11:24:55 +0100	[thread overview]
Message-ID: <1328783095-8330-1-git-send-email-florian@openwrt.org> (raw)
In-Reply-To: <20120208180102.18346jfdlm9wakw8@www.81.fi>

I am running Debian testing kernel 3.1.0-1-amd64, using a 079b:0062 Sagem
XG-76NA 802.11bg stick.

Upon zd1211rw interface
bringup (ifconfig wlan0 up) I get the following timeout:

[  950.330573] zd1211rw 1-3:1.0: phy2
[  955.108510] zd1211rw 1-3:1.0: firmware version 4725
[  955.148532] zd1211rw 1-3:1.0: zd1211b chip 079b:0062 v4810 high 00-19-70
AL2230_RF pa0 g--NS
[snip]
[  955.204072] zd1211rw 1-3:1.0: error ioread32(CR_REG1): -110

A second ifconfig wlan0 up brings the interface up without problems.

After a bit more debugging, the call trace is the following:

[10241.028130] zd1211rw 1-3:1.0: zd_chip_lock_phy_regs: error
ioread32(CR_REG1): -110
[10241.028140] zd1211rw 1-3:1.0: zd_switch_radio_on: failed to lock PHY regs
[10241.028148] zd1211rw 1-3:1.0: zd_op_start: failed to set radio on

Adding a 10 milliseconds delay between the call to set_mc_hash() and
zd_chip_switch_radio_on() allows successful interface bringups in all
cases and matches what the vendor driver did.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
 drivers/net/wireless/zd1211rw/zd_mac.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 98a574a..bed634c 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -306,9 +306,14 @@ int zd_op_start(struct ieee80211_hw *hw)
 	r = set_mc_hash(mac);
 	if (r)
 		goto disable_int;
+	msleep(10);
+
 	r = zd_chip_switch_radio_on(chip);
-	if (r < 0)
+	if (r < 0) {
+		dev_err(zd_chip_dev(chip),
+			"%s: failed to set radio on\n", __func__);
 		goto disable_int;
+	}
 	r = zd_chip_enable_rxtx(chip);
 	if (r < 0)
 		goto disable_radio;
-- 
1.7.5.4


  reply	other threads:[~2012-02-09 10:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-29 14:44 zd1211rw firmware loading timeout Florian Fainelli
     [not found] ` <CAFAL1Txx=qn3WXdRrtaYPVySY2vx+HinKk-NgthR+2ufcYNMwA@mail.gmail.com>
2012-02-08 13:15   ` Jussi Kivilinna
2012-02-08 13:17     ` Florian Fainelli
2012-02-08 16:01       ` Jussi Kivilinna
2012-02-09 10:24         ` Florian Fainelli [this message]
2012-02-09 10:40           ` [PATCH] zd1211rw: wait between setting hash table and powering radio on Julian Calaby
2012-02-09 10:54             ` Florian Fainelli
2012-02-09 11:10               ` Julian Calaby
2012-02-09 11:41                 ` Jussi Kivilinna
2012-02-15 10:33                   ` Florian Fainelli
2012-02-15 12:52                     ` Jussi Kivilinna
2012-02-29  9:36                       ` [PATCH v2] " Florian Fainelli
2012-02-29 10:25                         ` Julian Calaby
2012-02-29 13:00                         ` [PATCH v3] " Florian Fainelli

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=1328783095-8330-1-git-send-email-florian@openwrt.org \
    --to=florian@openwrt.org \
    --cc=dsd@gentoo.org \
    --cc=jussi.kivilinna@mbnet.fi \
    --cc=kune@deine-taler.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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).