linux/drivers/net
Sergey Ryazanov 4a2f248f9e ath5k: channel change fix
ath5k updates the channel pointer and after that it stops the Rx logic
and apply channel to HW. In case of channel switch, such sequence
creates a small window when a frame, which is received on the old
channel is considered as a frame received on the new one.

The most notable consequence of this situation occurs during the switch
from 2 GHz band (CCK+OFDM) to the 5GHz band (OFDM-only). Frame received
with CCK rate, e.g. beacon received at the 1mbps, causes the following
warning:

  WARNING: at ath5k/base.c:589 ath5k_tasklet_rx+0x318/0x6ec [ath5k]()
  invalid hw_rix: 1a
  [..]
  Call Trace:
  [<802656a8>] show_stack+0x48/0x70
  [<802dd92c>] warn_slowpath_common+0x88/0xbc
  [<802dd98c>] warn_slowpath_fmt+0x2c/0x38
  [<81b51be8>] ath5k_tasklet_rx+0x318/0x6ec [ath5k]
  [<8028ac64>] tasklet_action+0x8c/0xf0
  [<80075804>] __do_softirq+0x180/0x32c
  [<80196ce8>] irq_exit+0x54/0x70
  [<80041848>] ret_from_irq+0x0/0x4
  [<80182fdc>] ioread32+0x4/0xc
  [<81b4c42c>] ath5k_hw_set_sleep_clock+0x2ec/0x474 [ath5k]
  [<81b4cf28>] ath5k_hw_reset+0x50/0xeb8 [ath5k]
  [<81b50900>] ath5k_reset+0xd4/0x310 [ath5k]
  [<81b557e8>] ath5k_config+0x4c/0x104 [ath5k]
  [<80d01770>] ieee80211_hw_config+0x2f4/0x35c [mac80211]
  [<80d09aa8>] ieee80211_scan_work+0x2e4/0x414 [mac80211]
  [<8022c3f4>] process_one_work+0x28c/0x400
  [<802df8f8>] worker_thread+0x258/0x3c0
  [<801b5710>] kthread+0xe0/0xec
  [<800418a8>] ret_from_kernel_thread+0x14/0x1c

The easiest way to reproduce this warning is to run scan with dualband
NIC in noisy environments, when the channel 11 runs multiple APs. In my
tests if the APs num >= 12, the warning appears in the first few
seconds of scanning.

In order to fix this, the Rx disable code moved to a higher level and
placed before the channel pointer update. This is also makes the code a
bit more symmetrical, since we disable and enable the Rx in the same
function.

In fact, at the pointer update time new frames should not appear,
because interrupt generation at this point should already be disabled.
The next patch should address this issue.

CC: Jiri Slaby <jirislaby@gmail.com>
CC: Nick Kossifidis <mickflemm@gmail.com>
CC: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Reported-by: Christophe Prevotaux <cprevotaux@nltinc.com>
Tested-by: Christophe Prevotaux <cprevotaux@nltinc.com>
Tested-by: Eric Bree <ebree@nltinc.com>
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
History 2015-03-13 15:11:45 +02:00
..
appletalk net/appletalk: LTPC needs virt_to_bus 2015-02-20 16:28:46 -05:00
arcnet net: Kill dev_rebuild_header 2015-03-02 16:43:41 -05:00
bonding bonding: implement bond_poll_controller() 2015-03-06 14:40:42 -05:00
caif caif: remove wrong dev_net_set() call 2015-01-29 14:20:02 -08:00
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-03-09 23:38:02 -04:00
cris eth_v10: remove unnecessary break after return 2014-07-20 21:29:49 -07:00
dsa net: dsa: mv88e6352: Add support for EEE 2015-03-07 22:34:10 -05:00
ethernet net/macb: Only adjust tx_clk on link change 2015-03-12 23:04:32 -04:00
fddi net: fddi: skfp: smt.c: Remove unused function 2015-01-02 16:36:07 -05:00
hamradio ax25: remove unneeded NULL test in ax_xmit() 2015-03-06 21:50:42 -05:00
hippi PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
hyperv hyperv: Implement netvsc_get_channels() ethool op 2015-02-28 16:51:36 -05:00
ieee802154 at86rf230: add warning if edge-triggered irq 2015-02-27 18:42:44 +01:00
ipvlan net: Kill dev_rebuild_header 2015-03-02 16:43:41 -05:00
irda irda: vlsi_ir: Replace timeval with ktime_t 2015-01-11 21:39:40 -05:00
phy net: phy: bcm7xxx: add alternate id for 7439 2015-03-09 23:57:54 -04:00
plip net: plip: slight optimization of addr compare 2013-12-31 16:48:33 -05:00
ppp net: Remove iocb argument from sendmsg and recvmsg 2015-03-02 13:06:31 -05:00
slip net: set name_assign_type in alloc_netdev() 2014-07-15 16:12:48 -07:00
team Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-03-09 23:38:02 -04:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-03-03 21:16:48 -05:00
vmxnet3 Driver: Vmxnet3: Copy TCP header to mapped frame for IPv6 packets 2015-03-01 23:03:42 -05:00
wan wan: cosa: replace current->state by set_current_state() 2015-02-22 15:24:10 -05:00
wimax kbuild: remove unnecessary "obj- := dummy.o" trick 2014-10-02 13:55:02 +02:00
wireless ath5k: channel change fix 2015-03-13 15:11:45 +02:00
xen-netback Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-03-09 23:38:02 -04:00
dummy.c dummy: use MODULE_VERSION 2014-12-09 21:51:06 -05:00
eql.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
ifb.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
Kconfig ipvlan: Fix text that talks about ip util support 2015-02-20 16:35:44 -05:00
LICENSE.SRC Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
loopback.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
macvlan.c net: Kill dev_rebuild_header 2015-03-02 16:43:41 -05:00
macvtap.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-03-03 21:16:48 -05:00
Makefile ipvlan: Initial check-in of the IPVLAN driver. 2014-11-24 15:29:18 -05:00
mdio.c mdio: unused ethtool functions 2013-12-26 13:29:35 -05:00
mii.c mii: Handle link state changes for forced modes in mii_check_media() 2015-01-19 15:43:42 -05:00
netconsole.c netconsole: Use eth_<foo>_addr instead of memset 2015-03-03 17:01:37 -05:00
nlmon.c net: nlmon: flag nlmon devs with LLTX/SG 2014-03-28 16:49:47 -04:00
ntb_netdev.c net: use ethtool_cmd_speed_set helper to set ethtool speed value 2014-06-06 16:24:07 -07:00
rionet.c net: get rid of SET_ETHTOOL_OPS 2014-05-13 17:43:20 -04:00
sb1000.c drivers/net/sb1000.c: delete double assignment 2010-10-27 12:23:20 -07:00
Space.c drivers: net: Include new header file in sbni.c 2013-12-19 18:51:20 -05:00
sungem_phy.c sungem: Fix global namespace pollution of phy accessors. 2014-08-27 23:07:12 -07:00
tun.c net: Remove iocb argument from sendmsg and recvmsg 2015-03-02 13:06:31 -05:00
veth.c veth: advertise link netns via netlink 2015-01-23 17:51:15 -08:00
virtio_net.c OK, this has the big virtio 1.0 implementation, as specified by OASIS. 2015-02-18 09:24:01 -08:00
vxlan.c vxlan: Don't set s_addr in vxlan_create_sock 2015-03-12 23:23:16 -04:00
xen-netfront.c xen-netfront: Use static attribute groups for sysfs entries 2015-02-05 00:31:12 -08:00