# Can't get p54usb + hostapd to work on kernels >= 2.6.31

## Ant P.

If I use 2.6.31 (even vanilla), I end up with a kernel panic when something else connects to hostapd. Doing a search on google it looks like I'm the only one having this problem (or maybe the only one using the hardware like this?), so I'm thinking maybe I screwed something up. It works fine in 2.6.30.x though.

Does anyone else here use this setup and have it working in .31? Am I going crazy?

----------

## alex.blackbit

hi,

i have similar problems with a p54pci.

there were some problems on .30 too.

i am currently investigating this. if i find out something useful, i'll get back to you.

please give me some info on your environment:

emerge --info

uname -a

 /etc/conf.d/net

grep -Ev "(#|^$) /etc/hostapd/hostapd.conf

are your p54common and p54usb in the kernel or as modules ?

which firmware image do you use ?

----------

## Ant P.

Here you go:

emerge --info

```
Portage 2.1.6.13 (default/linux/amd64/2008.0/no-multilib, gcc-4.4.1, glibc-2.10.1-r0, 2.6.30-gentoo-r7 x86_64)

=================================================================

System uname: Linux-2.6.30-gentoo-r7-x86_64-Intel-R-_Atom-TM-_CPU_230_@_1.60GHz-with-gentoo-2.0.1

Timestamp of tree: Sat, 03 Oct 2009 18:45:01 +0000

distcc 3.1 x86_64-pc-linux-gnu [enabled]

app-shells/bash:     4.0_p33

dev-lang/python:     2.6.3, 3.1.1-r1

sys-apps/baselayout: 2.0.1

sys-apps/openrc:     0.4.3-r3

sys-apps/sandbox:    2.1

sys-devel/autoconf:  2.63-r1

sys-devel/automake:  1.10.2, 1.11

sys-devel/binutils:  2.19.1-r1

sys-devel/gcc-config: 1.4.1

sys-devel/libtool:   2.2.6a

virtual/os-headers:  2.6.30-r1

ACCEPT_KEYWORDS="amd64 ~amd64"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-O2 -march=core2 -mtune=generic -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /var/bind"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/eselect/postgresql /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-O2 -march=core2 -mtune=generic -pipe"

DISTDIR="/var/portage/distfiles/"

FEATURES="distcc distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://mirror.qubenet.net/mirror/gentoo/ http://mirror.ovh.net/gentoo-distfiles/"

LDFLAGS="-Wl,-O1,--sort-common,--hash-style=gnu,--as-needed"

MAKEOPTS="-j3"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/var/portage/repos/gentoo/"

PORTDIR_OVERLAY="/home/ant/public/git/ebuilds"

SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"

USE="aac acl alsa amd64 avahi bash-completion bzip2 cdparanoia cli cracklib crypt cups dbus dri faad fam fastcgi flac fortran iconv ipv6 isdnlog lame libnl lzma mmap mmx modules mp3 mudflap ncurses nls nptl nptlonly ogg openmp pch pcre perl php pic pppd python readline reflection replaygain session speex spl sqlite sse sse2 ssl ssse3 sysfs tcpd threads unicode vim-syntax vorbis xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
```

uname -a

```
Linux bls 2.6.30-gentoo-r7 #3 SMP Mon Sep 28 23:10:56 BST 2009 x86_64 Intel(R) Atom(TM) CPU 230 @ 1.60GHz GenuineIntel GNU/Linux
```

/etc/conf.d/net

```
config_eth0="null"

config_wlan0="null"

modules_wlan0="!iwconfig !wpa_supplicant"

channel_wlan0="1"

bridge_br0="eth0 wlan0"

config_br0="192.168.0.5/24"

routes_br0="default via 192.168.0.1"

dns_servers="127.0.0.1"
```

grep -Ev "(#|^$)" /etc/hostapd/hostapd.conf 

```
interface=wlan0

bridge=br0

driver=nl80211

logger_syslog=-1

logger_syslog_level=2

logger_stdout=-1

logger_stdout_level=2

dump_file=/tmp/hostapd.dump

ctrl_interface=/var/run/hostapd

ctrl_interface_group=0

ssid=SkyBase

country_code=GB

ieee80211d=1

hw_mode=g

channel=1

beacon_int=333

dtim_period=2

max_num_sta=255

rts_threshold=2347

fragm_threshold=2346

macaddr_acl=0

auth_algs=3

ignore_broadcast_ssid=0

wme_enabled=1

wme_ac_bk_cwmin=4

wme_ac_bk_cwmax=10

wme_ac_bk_aifs=7

wme_ac_bk_txop_limit=0

wme_ac_bk_acm=0

wme_ac_be_aifs=3

wme_ac_be_cwmin=4

wme_ac_be_cwmax=10

wme_ac_be_txop_limit=0

wme_ac_be_acm=0

wme_ac_vi_aifs=2

wme_ac_vi_cwmin=3

wme_ac_vi_cwmax=4

wme_ac_vi_txop_limit=94

wme_ac_vi_acm=0

wme_ac_vo_aifs=2

wme_ac_vo_cwmin=2

wme_ac_vo_cwmax=3

wme_ac_vo_txop_limit=47

wme_ac_vo_acm=0

wep_default_key=0

wep_key0="12345"

eapol_key_index_workaround=0

eap_server=0

own_ip_addr=127.0.0.1
```

lsmod | grep p54

```
p54usb                 15800  0 

p54common              24140  1 p54usb
```

ls -l /lib/firmware/

```
-rw-r--r-- 1 root root   29736 Dec  6  2008 2.13.24.0.lm87.arm

lrwxrwxrwx 1 root root      18 Jul  5 17:08 isl3887usb_bare -> 2.13.24.0.lm87.arm
```

I also reported the crash in #285860 a few days back...

----------

## alex.blackbit

just for reference, here is my kernel warning:

```
Oct 04 20:19:37 [kernel] ------------[ cut here ]------------

Oct 04 20:19:37 [kernel] WARNING: at net/mac80211/tx.c:1325 ieee80211_tx+0x106/0x1e0()

Oct 04 20:19:37 [kernel] Hardware name: Deskpro EP/SB Series

Oct 04 20:19:37 [kernel] tx refused but queue active

Oct 04 20:19:37 [kernel] Modules linked in: p54pci p54common

Oct 04 20:19:37 [kernel] Pid: 0, comm: swapper Tainted: G        W  2.6.31-gentoo-r1-blackbit #1

Oct 04 20:19:37 [kernel] Call Trace:

Oct 04 20:19:37 [kernel]  [<c102735d>] warn_slowpath_common+0x6d/0xa0

Oct 04 20:19:37 [kernel]  [<c143bda6>] ? ieee80211_tx+0x106/0x1e0

                - Last output repeated twice -

Oct 04 20:19:37 [kernel]  [<c10273d6>] warn_slowpath_fmt+0x26/0x30

Oct 04 20:19:37 [kernel]  [<c143bda6>] ieee80211_tx+0x106/0x1e0

Oct 04 20:19:37 [kernel]  [<c143bfc5>] ieee80211_tx_pending+0x145/0x2b0

Oct 04 20:19:37 [kernel]  [<c102b212>] tasklet_action+0x62/0x70

Oct 04 20:19:37 [kernel]  [<c102b74b>] __do_softirq+0x6b/0xf0

Oct 04 20:19:37 [kernel]  [<c1056836>] ? handle_IRQ_event+0x36/0xc0

Oct 04 20:19:37 [kernel]  [<c102b7fd>] do_softirq+0x2d/0x40

Oct 04 20:19:37 [kernel]  [<c102b925>] irq_exit+0x55/0x60

Oct 04 20:19:37 [kernel]  [<c10046c3>] do_IRQ+0x43/0xb0

Oct 04 20:19:37 [kernel]  [<c103fdd1>] ? getnstimeofday+0x51/0x100

Oct 04 20:19:37 [kernel]  [<c10031c9>] common_interrupt+0x29/0x30

Oct 04 20:19:37 [kernel]  [<c103007b>] ? block_all_signals+0x3b/0x50

Oct 04 20:19:37 [kernel]  [<c1247a8e>] ? acpi_idle_enter_simple+0x11b/0x148

Oct 04 20:19:37 [kernel]  [<c12fc12e>] cpuidle_idle_call+0x6e/0xc0

Oct 04 20:19:37 [kernel]  [<c1001ca4>] cpu_idle+0x34/0x60

Oct 04 20:19:37 [kernel]  [<c144569d>] rest_init+0x4d/0x60

Oct 04 20:19:37 [kernel]  [<c15d9659>] start_kernel+0x22f/0x235

Oct 04 20:19:37 [kernel]  [<c15d9247>] ? unknown_bootoption+0x0/0x1ad

Oct 04 20:19:37 [kernel]  [<c15d903f>] __init_begin+0x3f/0x41

Oct 04 20:19:37 [kernel] ---[ end trace 14f1d57a154f80ad ]---
```

this happened 42 times, then the machine rebooted.

Ant_P, could you please post the relevant part of your logs ?

----------

## Ant P.

Yep, I get a bunch of those too. They seem to show up a few at a time spaced a few seconds apart, depending on network load:

```
Oct 04 20:46:47 [kernel] [  326.530761] ------------[ cut here ]------------

Oct 04 20:46:47 [kernel] [  326.535506] WARNING: at net/mac80211/tx.c:1325 ieee80211_tx+0x204/0x240()

Oct 04 20:46:47 [kernel] [  326.540237] Hardware name:  

Oct 04 20:46:47 [kernel] [  326.544953] tx refused but queue active

Oct 04 20:46:47 [kernel] [  326.545044] Modules linked in: ipt_REJECT xt_tcpudp iptable_filter ip_tables ip6table_filter xt_mark xt_MARK ip6_tables x_tables p54usb sr_mod p54common cdrom [last unloaded: microcode]

Oct 04 20:46:47 [kernel] [  326.554948] Pid: 0, comm: swapper Tainted: G        W  2.6.31-zen2-02708-g53a5ab1 #26

Oct 04 20:46:47 [kernel] [  326.560062] Call Trace:

Oct 04 20:46:47 [kernel] [  326.565128]  <IRQ>  [<ffffffff81034773>] warn_slowpath_common+0x88/0xb6

Oct 04 20:46:47 [kernel] [  326.570278]  [<ffffffff81034824>] warn_slowpath_fmt+0x4b/0x61

Oct 04 20:46:47 [kernel] [  326.575403]  [<ffffffff81368fde>] ieee80211_tx+0x204/0x240

Oct 04 20:46:47 [kernel] [  326.580522]  [<ffffffff813691be>] ieee80211_tx_pending+0x1a4/0x28f

Oct 04 20:46:47 [kernel] [  326.585477]  [<ffffffff8104e95f>] ? ktime_get_ts+0x5c/0x79

Oct 04 20:46:47 [kernel] [  326.590238]  [<ffffffff810395be>] tasklet_action+0x7e/0xe0

Oct 04 20:46:47 [kernel] [  326.594966]  [<ffffffff8103a1ec>] __do_softirq+0xa5/0x151

Oct 04 20:46:47 [kernel] [  326.599640]  [<ffffffff8101f236>] ? apic_write+0x24/0x3a

Oct 04 20:46:47 [kernel] [  326.604281]  [<ffffffff81020c19>] ? ack_apic_level+0x4f/0xfc

Oct 04 20:46:47 [kernel] [  326.608914]  [<ffffffff8100cd3c>] call_softirq+0x1c/0x28

Oct 04 20:46:47 [kernel] [  326.613601]  [<ffffffff8100edab>] do_softirq+0x43/0x98

Oct 04 20:46:47 [kernel] [  326.618238]  [<ffffffff81039e6b>] irq_exit+0x52/0xa3

Oct 04 20:46:47 [kernel] [  326.622860]  [<ffffffff8100e466>] do_IRQ+0xb3/0xe0

Oct 04 20:46:47 [kernel] [  326.627467]  [<ffffffff8100c5d3>] ret_from_intr+0x0/0xa

Oct 04 20:46:47 [kernel] [  326.632083]  <EOI>  [<ffffffff810139ca>] ? mwait_idle+0x81/0x9a

Oct 04 20:46:47 [kernel] [  326.636756]  [<ffffffff8100af4c>] ? enter_idle+0x33/0x49

Oct 04 20:46:47 [kernel] [  326.641427]  [<ffffffff8100b00c>] ? cpu_idle+0xaa/0xed

Oct 04 20:46:47 [kernel] [  326.646083]  [<ffffffff8136ea60>] ? rest_init+0x74/0x8a

Oct 04 20:46:47 [kernel] [  326.650754]  [<ffffffff81525a5c>] ? start_kernel+0x308/0x329

Oct 04 20:46:47 [kernel] [  326.655454]  [<ffffffff81524ea1>] ? x86_64_start_reservations+0x91/0xac

Oct 04 20:46:47 [kernel] [  326.660173]  [<ffffffff81524fad>] ? x86_64_start_kernel+0xf1/0x10c

Oct 04 20:46:47 [kernel] [  326.664838] ---[ end trace 132585a7ff37ff2e ]---
```

What really annoys me is this machine is supposed to have a watchdog on the ICH7 chipset, but (thanks to these crashes) I found out it doesn't actually work :(

----------

## Ant P.

I managed to log it crashing this time (by mounting everything -o sync) and got a slightly different error. This is the second to last before the box dies, the last is another one of the above but there's a gap of about half a minute between them...

```
[ 1463.538499] ------------[ cut here ]------------

[ 1463.543341] WARNING: at net/mac80211/tx.c:1325 ieee80211_tx+0x204/0x240()

[ 1463.547934] Hardware name:

[ 1463.552504] tx refused but queue active

[ 1463.552581] Modules linked in: ipt_REJECT xt_tcpudp iptable_filter ip_tables ip6table_filter xt_mark xt_MARK ip6_tables x_tables p54usb sr_mod p54common cdrom [last unloaded: microcode]

[ 1463.562159] Pid: 0, comm: swapper Tainted: G        W  2.6.31-zen2-02708-g53a5ab1 #26

[ 1463.567124] Call Trace:

[ 1463.572040]  <IRQ>  [<ffffffff81034773>] warn_slowpath_common+0x88/0xb6

[ 1463.577046]  [<ffffffff81034824>] warn_slowpath_fmt+0x4b/0x61

[ 1463.582019]  [<ffffffff81368fde>] ieee80211_tx+0x204/0x240

[ 1463.586999]  [<ffffffff81369c01>] ieee80211_master_start_xmit+0x28c/0x2cb

[ 1463.591839]  [<ffffffff812b527d>] dev_hard_start_xmit+0x22b/0x2da

[ 1463.596501]  [<ffffffff812c59ab>] __qdisc_run+0xf7/0x218

[ 1463.601134]  [<ffffffff812b569c>] dev_queue_xmit+0x232/0x352

[ 1463.605737]  [<ffffffff81369946>] ieee80211_subif_start_xmit+0x496/0x4c5

[ 1463.610360]  [<ffffffff812b527d>] dev_hard_start_xmit+0x22b/0x2da

[ 1463.614979]  [<ffffffff812c59ab>] __qdisc_run+0xf7/0x218

[ 1463.619638]  [<ffffffff812b569c>] dev_queue_xmit+0x232/0x352

[ 1463.624277]  [<ffffffff81340045>] br_dev_queue_push_xmit+0x6b/0x88

[ 1463.628941]  [<ffffffff81340107>] br_forward_finish+0x42/0x5d

[ 1463.633586]  [<ffffffff813401ad>] __br_forward+0x8b/0xa6

[ 1463.638238]  [<ffffffff813401f4>] br_forward+0x2c/0x4c

[ 1463.642872]  [<ffffffff81340f72>] br_handle_frame_finish+0x128/0x162

[ 1463.647541]  [<ffffffff8134114b>] br_handle_frame+0x19f/0x1d0

[ 1463.652184]  [<ffffffff812b42f3>] netif_receive_skb+0x1eb/0x2b7

[ 1463.656868]  [<ffffffff8122ea30>] rtl8169_rx_interrupt+0x303/0x3e5

[ 1463.661551]  [<ffffffff81231786>] rtl8169_poll+0x43/0x1ba

[ 1463.666249]  [<ffffffff812b4b73>] net_rx_action+0x7c/0x159

[ 1463.670900]  [<ffffffff8103a1ec>] __do_softirq+0xa5/0x151

[ 1463.675536]  [<ffffffff8101f236>] ? apic_write+0x24/0x3a

[ 1463.680157]  [<ffffffff81020c19>] ? ack_apic_level+0x4f/0xfc

[ 1463.684804]  [<ffffffff8100cd3c>] call_softirq+0x1c/0x28

[ 1463.689432]  [<ffffffff8100edab>] do_softirq+0x43/0x98

[ 1463.694051]  [<ffffffff81039e6b>] irq_exit+0x52/0xa3

[ 1463.698654]  [<ffffffff8100e466>] do_IRQ+0xb3/0xe0

[ 1463.703229]  [<ffffffff8100c5d3>] ret_from_intr+0x0/0xa

[ 1463.707784]  <EOI>  [<ffffffff810139ca>] ? mwait_idle+0x81/0x9a

[ 1463.712374]  [<ffffffff8100af4c>] ? enter_idle+0x33/0x49

[ 1463.716920]  [<ffffffff8100b00c>] ? cpu_idle+0xaa/0xed

[ 1463.721458]  [<ffffffff8136ea60>] ? rest_init+0x74/0x8a

[ 1463.725832]  [<ffffffff81525a5c>] ? start_kernel+0x308/0x329

[ 1463.730056]  [<ffffffff81524ea1>] ? x86_64_start_reservations+0x91/0xac

[ 1463.734247]  [<ffffffff81524fad>] ? x86_64_start_kernel+0xf1/0x10c

[ 1463.738395] ---[ end trace 132585a7ff37ff4b ]---
```

----------

## alex.blackbit

sorry, i didn't find the time to post a bug report on LKML about that.

did you already try vanilla-sources-2.6.31.3 or something equivalent ?

that should be done before.

----------

## alex.blackbit

it seems the problem is already known and worked on, kernel bug #13725.

i think we can not make any meaningful comments.

----------

## alex.blackbit

as it seems there is a fix in linux-next...

it would be nice to know which commit fixed the problem...

----------

## Ant P.

linux-next seems to work as well as 2.6.30 did. I think I'll hang on to this kernel until .32 final is released.

----------

## alex.blackbit

Ant_P,

i just tried out gentoo-sources-2.6.31-r3 (vanilla-sources-2.6.31.4). same error.

----------

## Ant P.

With any luck, it'll be in the next release of gentoo-sources.

----------

## alex.blackbit

i am running gentoo-sources-2.6.32 on my firewall now.

no problems since boot, 3 days ago.

----------

