linux/drivers/net/wireless
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
..
ath5k ath5k: correct handling of rx status fields 2008-11-06 16:37:11 -05:00
ath9k ath9k/mac80211: disallow fragmentation in ath9k, report to userspace 2008-10-14 21:12:37 -04:00
b43 Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2008-10-13 14:12:40 -07:00
b43legacy mac80211: add multi-rate retry support 2008-10-06 18:14:57 -04:00
hostap hostap: pad the skb->cb usage in lieu of a proper fix 2008-11-12 16:54:22 -05:00
iwlwifi iwlagn: fix RX skb alignment 2008-11-18 17:26:26 -05:00
libertas libertas: fix buffer overrun 2008-10-29 17:54:35 -04:00
libertas_tf libertas_tf: fix skb tail pointer 2008-11-18 17:26:26 -05:00
p54 p54: fix build warnings 2008-10-27 17:46:11 -04:00
prism54 wireless: replace __FUNCTION__ with __func__ 2008-08-22 16:29:56 -04:00
rt2x00 rt2x00: Fix build error when mac80211=M rt2x00=Y 2008-10-29 17:54:35 -04:00
zd1211rw zd1211rw: Add 2 device IDs 2008-11-06 16:37:10 -05:00
Kconfig orinoco: Add MIC on TX and check on RX 2008-08-22 19:28:07 -04:00
Makefile orinoco: Move firmware download functionality into new module 2008-08-22 19:28:04 -04:00
adm8211.c mac80211: use nl80211 interface types 2008-09-15 16:48:23 -04:00
adm8211.h mac80211: move TX info into skb->cb 2008-05-21 21:48:11 -04:00
airo.c wireless: Read scan flags correctly on x86-64 2008-09-24 16:17:58 -04:00
airo.h
airo_cs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2008-10-13 14:12:40 -07:00
airport.c orinoco: Invoke firmware download in main driver 2008-08-22 19:28:05 -04:00
arlan-main.c arlan: use netstats in net_device structure 2008-05-14 16:29:48 -04:00
arlan-proc.c arlan: fix warning when PROC_FS=n 2008-03-24 19:25:08 -04:00
arlan.h arlan: use netstats in net_device structure 2008-05-14 16:29:48 -04:00
atmel.c wireless: Read scan flags correctly on x86-64 2008-09-24 16:17:58 -04:00
atmel.h
atmel_cs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2008-10-13 14:12:40 -07:00
atmel_pci.c
hermes.c orinoco: Add function to execute Hermes initialisation commands synchronously 2008-08-22 19:28:04 -04:00
hermes.h orinoco: Add MIC on TX and check on RX 2008-08-22 19:28:07 -04:00
hermes_dld.c orinoco: Extend hermes_dld routines for Agere firmware 2008-08-22 19:28:05 -04:00
hermes_dld.h orinoco: Extend hermes_dld routines for Agere firmware 2008-08-22 19:28:05 -04:00
hermes_rid.h orinoco: Add WE-18 ioctls for WPA 2008-08-22 19:28:06 -04:00
i82586.h
i82593.h
ipw2100.c wireless: replace __FUNCTION__ with __func__ 2008-08-22 16:29:56 -04:00
ipw2100.h
ipw2200.c removed unused #include <version.h> 2008-08-18 11:05:15 -04:00
ipw2200.h wireless: replace __FUNCTION__ with __func__ 2008-08-22 16:29:56 -04:00
mac80211_hwsim.c device create: net: convert device_create_drvdata to device_create 2008-10-16 09:24:43 -07:00
netwave_cs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2008-10-13 14:12:40 -07:00
orinoco.c orinoco: reduce stack usage in firmware download path 2008-10-22 18:09:32 -04:00
orinoco.h orinoco: Add MIC on TX and check on RX 2008-08-22 19:28:07 -04:00
orinoco_cs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-10-16 11:26:26 -07:00
orinoco_nortel.c orinoco: Invoke firmware download in main driver 2008-08-22 19:28:05 -04:00
orinoco_pci.c orinoco: Invoke firmware download in main driver 2008-08-22 19:28:05 -04:00
orinoco_pci.h
orinoco_plx.c orinoco: Invoke firmware download in main driver 2008-08-22 19:28:05 -04:00
orinoco_tmd.c orinoco: Invoke firmware download in main driver 2008-08-22 19:28:05 -04:00
ray_cs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2008-10-13 14:12:40 -07:00
ray_cs.h
rayctl.h
rndis_wlan.c wireless: Read scan flags correctly on x86-64 2008-09-24 16:17:58 -04:00
rtl818x.h rtl818x: merge tx/rx descriptor flags 2008-08-22 16:29:48 -04:00
rtl8180.h rtl818x: merge tx/rx descriptor flags 2008-08-22 16:29:48 -04:00
rtl8180_dev.c mac80211: add multi-rate retry support 2008-10-06 18:14:57 -04:00
rtl8180_grf5101.c rtl8180: fix wrong parameter in grf5101_rf_set_channel 2008-05-28 16:43:40 -04:00
rtl8180_grf5101.h
rtl8180_max2820.c rtl8180: fix wrong parameter in max2820_rf_set_channel 2008-05-28 16:43:39 -04:00
rtl8180_max2820.h
rtl8180_rtl8225.c
rtl8180_rtl8225.h
rtl8180_sa2400.c rtl8180: fix wrong parameter in sa2400_rf_set_channel 2008-05-28 16:43:38 -04:00
rtl8180_sa2400.h
rtl8187.h rtl818x: merge tx/rx descriptor flags 2008-08-22 16:29:48 -04:00
rtl8187_dev.c rtl8187 : support for Sitecom WL-168 0001 v4 2008-11-12 16:49:57 -05:00
rtl8187_rtl8225.c rtl8187: use different ANAPARAM*_OFF values for 8187B 2008-07-14 14:52:56 -04:00
rtl8187_rtl8225.h rtl8187: use different ANAPARAM*_OFF values for 8187B 2008-07-14 14:52:56 -04:00
spectrum_cs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-10-16 11:26:26 -07:00
strip.c Fix strip driver back up for ldisc/tty changes 2008-07-20 17:12:38 -07:00
wavelan.c net: Rationalise email address: Network Specific Parts 2008-10-13 19:01:08 -07:00
wavelan.h
wavelan.p.h net: Rationalise email address: Network Specific Parts 2008-10-13 19:01:08 -07:00
wavelan_cs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2008-10-13 14:12:40 -07:00
wavelan_cs.h wavelan_cs arm fix 2008-03-24 19:25:07 -04:00
wavelan_cs.p.h wavelan_cs: stop inlining largish static functions 2008-04-08 15:05:57 -04:00
wl3501.h
wl3501_cs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6 2008-10-13 14:12:40 -07:00
zd1201.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2008-07-18 02:39:39 -07:00
zd1201.h