Bug 15591 - ar9170usb crash/freeze in monitor mode
Summary: ar9170usb crash/freeze in monitor mode
Status: RESOLVED OBSOLETE
Alias: None
Product: Networking
Classification: Unclassified
Component: Wireless (show other bugs)
Hardware: All Linux
: P1 high
Assignee: Christian Lamparter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-20 20:37 UTC by Christian Mehlis
Modified: 2012-07-05 16:20 UTC (History)
4 users (show)

See Also:
Kernel Version: 2.6.32
Subsystem:
Regression: No
Bisected commit-id:


Attachments
The syslog in karmic before the system freezes (5.04 KB, text/plain)
2010-03-20 20:37 UTC, Christian Mehlis
Details
could fix ar9170_rx crash (483 bytes, patch)
2010-03-22 17:42 UTC, Christian Lamparter
Details | Diff

Description Christian Mehlis 2010-03-20 20:37:15 UTC
Created attachment 25624 [details]
The syslog in karmic before the system freezes

I have the 
AVM FRITZ!WLAN USB Stick N  	
USB Vendor 0x057c  	
USB Produc t0x8401

If I enter monitor mode with "airmon" and begin listen "airodump",my whole system (ubuntu lucid and karmic) freeze. no chance to reboot, only pressing the hardwarebutton helps.

kernel: 2.6.32 ubuntu lucid with wireless-backports
        and 2.6.31 karmic with wireless-backports

i will observe this thread, ask for more useful infos;)

Christian
Comment 1 Christian Mehlis 2010-03-20 21:29:05 UTC
I think this belogs to the Networkmanager, it does:
Mar 20 21:25:52 infrared wpa_supplicant[948]: CTRL-EVENT-SCAN-RESULTS 
once a minute, the freeze is always in this time slot.

steps to reproduce:

$ su

#create mon0 dev
$ airmon-ng start wlan0

#listen on mon0
$ airodump-ng -i mon0

now wait some seconds, freeze
Comment 2 Christian Lamparter 2010-03-22 14:02:19 UTC
... nothing is happening... It's still scanning after 30 min.

If your system gets unresponsive enable the nmi_watchdog
and setup a kernel message logger on one of your serial ports.
This way you should be able to capture the whole crash/oops/panic.
Comment 3 Christian Mehlis 2010-03-22 17:15:11 UTC
to reproduce:
start gnome
start networkmanager, connect to a wifi
kill gdm
change to terminal
bring the interface down
bring the interface in monitor mode
bring the interface up
dump packages (airodump -i <interface> --band a)
should crash on band g too

i can reproduce it on my machine and on a friends pc

apport send the report to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/544318

the output from watchdog i had no time to write it all down:

kernel BUG at /build/buildd/linux-2.6.32/net/code/skbuff.c:127!
invalid opcode: 00 [#1] SMP
last sysfs file: /sys/device/LNXSYSTM:00/LNXSYBUS:00/PNP00A08:00/device:21/PNP0C09:00/PNP0C0A:00/power_supply/BAT1/charge_full
Modules linked in: [...]
Pid : 0, comm: swapper Not tainted (2.6.32-16-generic-pae #25-Ubuntu) NC10
EIP: 0060:[<c04ef19

i got a .crash file too but after processing apport it's changed from 8 mb to 32 mb, down't know what has changed in the file....
Comment 4 Christian Mehlis 2010-03-22 17:18:22 UTC
oh,
i made the test with pae kernel and ubuntu generic and ubuntu generic with backport-modules
always the same freeze

the freeze-output had a stack trace ar9170_rx seems to make the trouble....
Comment 5 Christian Lamparter 2010-03-22 17:42:24 UTC
Created attachment 25643 [details]
could fix ar9170_rx crash
Comment 6 Christian Mehlis 2010-03-22 17:51:28 UTC
hups, link is:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/544318/+index

$ grep skbuff.c .
Found in ./VmCore

see attachments in the launchpad bug report, i hope this helps...

i hope you can reproduce the bug
Comment 7 Christian Mehlis 2010-03-22 21:06:32 UTC
do you think it is a good idea to change the size from
AR9170_MAX_RX_BUFFER_SIZE 8192
to 65535 and not using the constant MAX_UNSIGNED_SHORT?

i think the freeze comes from a buffer witch is too small, like you do, but is the right size simply the max size?

how do i can test your fix?
i am a newbie in kernel development...i got the wireless-testing tree.

so what steps can i do after the patching?
Comment 8 Christian Lamparter 2010-03-22 22:00:33 UTC
> do you think it is a good idea to change the size from
> AR9170_MAX_RX_BUFFER_SIZE 8192
> to 65535 and not using the constant MAX_UNSIGNED_SHORT?
no and maybe no.

It is set to AMPDU MAGIC size, which is 0xffff or 64Kb
(as in ampdu factor size) and should be a MAGIC.

---

You don't need wireless-testing tree for this patch.
Any recent source (kernel, or compat-wireless) will do too.

compat-wireless is probably the easiest. All you have to do
is to apply the changes and run make.
Comment 9 Christian Mehlis 2010-03-23 16:27:14 UTC
i have tested your fix, now the system don't freeze!
but after the same time, the freeze occurs, the device no longer gets packets from the air....and just a reboot brings it up again.
Comment 10 Christian Lamparter 2010-03-23 16:48:06 UTC
reboot?

as in system reboot, or unplug/replug?

In case you meant system reboot:
can you confirm that usb port and the whole usb subsystem died too?

If it's just unplug/replug, then you're sort of screwed..
Atheros is aware of this problem, but so far: no fix.
Also AR9170 is being replaced by AR9271 + next gen,
so chances are you wasted your money on a overpriced product.
Comment 11 Christian Mehlis 2010-03-23 18:07:25 UTC
> reboot?
> as in system reboot, or unplug/replug?
replug of the stick, that helps..

> If it's just unplug/replug, then you're sort of screwed..
> Atheros is aware of this problem, but so far: no fix.
hm, ok

your fix is so far better than a system freeze, so i prefer no packets instead of a crash;)

will the fix go in the main kernel?
it is better than nothing...
Comment 12 Christian Mehlis 2010-06-29 08:13:10 UTC
Savvas Radevic <vicedar@gmail.com> wrote:

>I saw this in your logs: "cfg80211:
>Regulatory domain changed to country: DE"
>Is your router's wireless configuration (channel restrictions) set to
>"DE" (Germany)?

In my home configuration it is not.
In the university wifi it is set to DE.

The patch from Christian fixed this bug.
I see not connection to regulatory because it crashed @home and @university.

Note You need to log in before you can comment on or make changes to this bug.