1
linux/drivers/net/wireless/iwlwifi
Johannes Berg 4018517a1a iwlagn: fix RX skb alignment
So I dug deeper into the DMA problems I had with iwlagn and a kind soul
helped me in that he said something about pci-e alignment and mentioned
the iwl_rx_allocate function to check for crossing 4KB boundaries. Since
there's 8KB A-MPDU support, crossing 4k boundaries didn't seem like
something the device would fail with, but when I looked into the
function for a minute anyway I stumbled over this little gem:

	BUG_ON(rxb->dma_addr & (~DMA_BIT_MASK(36) & 0xff));

Clearly, that is a totally bogus check, one would hope the compiler
removes it entirely. (Think about it)

After fixing it, I obviously ran into it, nothing guarantees the
alignment the way you want it,  because of the way skbs and their
headroom are allocated. I won't explain that here nor double-check that
I'm right, that goes beyond what most of the CC'ed people care about.

So then I came up with the patch below, and so far my system has
survived minutes with 64K pages, when it would previously fail in
seconds. And I haven't seen a single instance of the TX bug either. But
when you see the patch it'll be pretty obvious to you why.

This should fix the following reported kernel bugs:

http://bugzilla.kernel.org/show_bug.cgi?id=11596
http://bugzilla.kernel.org/show_bug.cgi?id=11393
http://bugzilla.kernel.org/show_bug.cgi?id=11983

I haven't checked if there are any elsewhere, but I suppose RHBZ will
have a few instances too...

I'd like to ask anyone who is CC'ed (those are people I know ran into
the bug) to try this patch.

I am convinced that this patch is correct in spirit, but I haven't
understood why, for example, there are so many unmap calls. I'm not
entirely convinced that this is the only bug leading to the TX reply
errors.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-18 17:26:26 -05:00
..
iwl3945-base.c mac80211: remove ieee80211_notify_mac 2008-11-18 17:26:26 -05:00
iwl-3945-commands.h
iwl-3945-core.h
iwl-3945-debug.h
iwl-3945-hw.h
iwl-3945-io.h
iwl-3945-led.c
iwl-3945-led.h
iwl-3945-rs.c mac80211: clean up rate control API 2008-09-24 16:18:03 -04:00
iwl-3945-rs.h mac80211: clean up rate control API 2008-09-24 16:18:03 -04:00
iwl-3945.c mac80211: use nl80211 interface types 2008-09-15 16:48:23 -04:00
iwl-3945.h mac80211: clean up rate control API 2008-09-24 16:18:03 -04:00
iwl-4965-hw.h
iwl-4965.c iwlwifi: fix compile warning 2008-09-11 15:53:31 -04:00
iwl-5000-hw.h
iwl-5000.c iwlwifi: fix ct kill configuration for 5350 2008-10-14 20:47:30 -04:00
iwl-agn-rs.c iwlwifi: fix compilation warning when CONFIG_IWLWIFI_DEBUG is not set. 2008-10-14 20:46:26 -04:00
iwl-agn-rs.h iwlwifi: Added support for 3 antennas 2008-09-11 15:53:39 -04:00
iwl-agn.c iwlagn: fix RX skb alignment 2008-11-18 17:26:26 -05:00
iwl-calib.c iwlwifi: use the results from disconnected antenna algorithm 2008-09-11 15:53:31 -04:00
iwl-calib.h
iwl-commands.h
iwl-core.c iwlwifi: remove HT flags from RXON when not in HT anymore 2008-09-24 16:18:01 -04:00
iwl-core.h iwlwifi: remove STATUS_CONF_PENDING in scanning 2008-10-06 18:14:58 -04:00
iwl-csr.h iwlwifi: refactor rx register initialization 2008-09-30 14:07:22 -04:00
iwl-debug.h
iwl-debugfs.c
iwl-dev.h iwlagn: fix RX skb alignment 2008-11-18 17:26:26 -05:00
iwl-eeprom.c
iwl-eeprom.h
iwl-fh.h iwlwifi: refactor rx register initialization 2008-09-30 14:07:22 -04:00
iwl-hcmd.c
iwl-helpers.h
iwl-io.h
iwl-led.c
iwl-led.h
iwl-power.c mac80211: use nl80211 interface types 2008-09-15 16:48:23 -04:00
iwl-power.h iwlwifi: remove uneeded declarations 2008-09-11 15:53:31 -04:00
iwl-prph.h
iwl-rfkill.c
iwl-rfkill.h
iwl-rx.c iwlagn: fix RX skb alignment 2008-11-18 17:26:26 -05:00
iwl-scan.c iwlwifi: clear scanning bits upon failure 2008-11-06 16:37:08 -05:00
iwl-spectrum.h
iwl-sta.c mac80211: use nl80211 interface types 2008-09-15 16:48:23 -04:00
iwl-sta.h
iwl-tx.c iwlagn: downgrade BUG_ON in interrupt 2008-09-24 16:18:04 -04:00
Kconfig
Makefile