From: Larry Finger <Larry.Finger@lwfinger.net>
To: stable@kernel.org
Cc: netdev@vger.kernel.org, mb@bu3sch.de, greg@kroah.com
Subject: [PATCH] bcm43xx: Drain TX status before starting IRQs
Date: Sun, 05 Nov 2006 15:34:36 -0600 [thread overview]
Message-ID: <454E58EC.mail20S110EOC@lwfinger.net> (raw)
From: Michael Buesch <mb@bu3sch.de>
Drain the Microcode TX-status-FIFO before we enable IRQs.
This is required, because the FIFO may still have entries left
from a previous run. Those would immediately fire after enabling
IRQs and would lead to an oops in the DMA TXstatus handling code.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
Index: linux-2.6.18/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- linux-2.6.18.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ linux-2.6.18/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -1463,6 +1463,23 @@ static void handle_irq_transmit_status(s
}
}
+static void drain_txstatus_queue(struct bcm43xx_private *bcm)
+{
+ u32 dummy;
+
+ if (bcm->current_core->rev < 5)
+ return;
+ /* Read all entries from the microcode TXstatus FIFO
+ * and throw them away.
+ */
+ while (1) {
+ dummy = bcm43xx_read32(bcm, BCM43xx_MMIO_XMITSTAT_0);
+ if (!dummy)
+ break;
+ dummy = bcm43xx_read32(bcm, BCM43xx_MMIO_XMITSTAT_1);
+ }
+}
+
static void bcm43xx_generate_noise_sample(struct bcm43xx_private *bcm)
{
bcm43xx_shm_write16(bcm, BCM43xx_SHM_SHARED, 0x408, 0x7F7F);
@@ -3517,6 +3534,7 @@ int bcm43xx_select_wireless_core(struct
bcm43xx_macfilter_clear(bcm, BCM43xx_MACFILTER_ASSOC);
bcm43xx_macfilter_set(bcm, BCM43xx_MACFILTER_SELF, (u8 *)(bcm->net_dev->dev_addr));
bcm43xx_security_init(bcm);
+ drain_txstatus_queue(bcm);
ieee80211softmac_start(bcm->net_dev);
/* Let's go! Be careful after enabling the IRQs.
next reply other threads:[~2006-11-05 21:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-05 21:34 Larry Finger [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-11-06 15:45 [PATCH] bcm43xx: Drain TX status before starting IRQs Larry Finger
2006-10-19 15:29 Michael Buesch
[not found] ` <200610191729.35402.mb-fseUSCV1ubazQB+pC5nmwQ@public.gmane.org>
2006-10-20 0:25 ` Benjamin Herrenschmidt
2006-11-02 5:46 ` Larry Finger
[not found] ` <45498633.7040808-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
2006-11-02 8:45 ` Johannes Berg
2006-11-03 16:56 ` Jouni Malinen
[not found] ` <20061103165627.GC16894-T6t7IcXamKWaos4igUoMUw@public.gmane.org>
2006-11-04 16:38 ` Larry Finger
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=454E58EC.mail20S110EOC@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=greg@kroah.com \
--cc=mb@bu3sch.de \
--cc=netdev@vger.kernel.org \
--cc=stable@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.