Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 380001 - wifi CRDA change request not processed by kernel / udev / crda
Summary: wifi CRDA change request not processed by kernel / udev / crda
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-20 20:01 UTC by Piergiorgio Beruto
Modified: 2011-10-13 15:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
kernel log (dmesg.log,36.47 KB, text/plain)
2011-08-20 20:01 UTC, Piergiorgio Beruto
Details
kernel config (kernel.config,53.47 KB, text/plain)
2011-08-20 20:02 UTC, Piergiorgio Beruto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piergiorgio Beruto 2011-08-20 20:01:13 UTC
When kernel invokes CRDA at boot to change wifi regulatory domain, the change request is queued but never processed.
This happens at the very first call when the wifi card is detected, the driver loaded (ath9k) and cfg80211 tries to set "world" regulatory domain (default).
Later on the country code is detected within the card onboard EEPROM but the change request is discarded as the previous one is still pending (see dmesg log).

Further change requests issued either by "wpa_supplicant", "hostapd" or "iw reg set XX" command are just rejected as the previous requests are still pending.

The only workaround is to remove the ath9k driver which is automatically loaded at boot and just modprobe it again once you can access the shell, then everything is fine (maybe removing the module aborts the frozen change request?)

I've tried with kernel builtin CRDA database but the result was the same.
I've tried compiling all drivers (cfg80211,mac80211,rfkill,ath9k) as kernel builtin but things got worse (can't change CRDA at all).

Reproducible: Always

Steps to Reproduce:
1. compile the kernel (3.0.3) (x86) with attached .config and atheros wifi card support
2. emerge crda (1.1.1)
3. boot the system
Actual Results:  
see attached dmesg log

Expected Results:  
CRDA change according to EEPROM/user command

I'm running a wifi router, based on Atheros 5008 PCI wireless card, with hostapd.
Please, see the attached dmesg.log

emerge --info:
Portage 2.1.10.11 (default/linux/x86/10.0/server, gcc-4.5.3, glibc-2.13-r4, 3.0.3-gentoo-cirith-ungol i686)
=================================================================
System uname: Linux-3.0.3-gentoo-cirith-ungol-i686-VIA_Eden_Processor_1200MHz-with-gentoo-2.0.3
Timestamp of tree: Fri, 19 Aug 2011 22:45:01 +0000
app-shells/bash:          4.2_p10
dev-lang/python:          2.7.2-r2, 3.2-r2
dev-util/cmake:           2.8.5-r2
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.8.3-r1
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.1-r1
sys-devel/binutils:       2.21.1
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo x-portage
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -mmmx -msse -msse2 -msse3 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/openvpn/easy-rsa"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -mmmx -msse -msse2 -msse3 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/  		http://mirror.muntinternet.net/pub/gentoo/ 		ftp://mirror.switch.ch/mirror/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_US"
MAKEOPTS="-j2"
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="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X acl acpi apm apng bash-completion berkdb branding bzip2 cairo cli colordiff cracklib crypt ctype cups cvs cxx dbus dri extensions fam fontconfig fortran gdbm gnutls gpm graphviz gtk iconv jpeg libnotify lm_sensors logrotate memlimit mercurial mmap mmx modules mudflap ncurses nls nptl nptlonly openmp padlock pam pcre pmu png posix readline samba server session snmp sockets sse sse2 ssl ssse3 startup-notification subversion svg sysfs syslog tcpd threads thunar tiff truetype unicode usb userlocales vim vim-pager vim-syntax vim-with-x vnc wifi wxwidgets x86 xfs xinetd xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 cgi cgid 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" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump active" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="via" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Piergiorgio Beruto 2011-08-20 20:01:50 UTC
Created attachment 284061 [details]
kernel log
Comment 2 Piergiorgio Beruto 2011-08-20 20:02:21 UTC
Created attachment 284063 [details]
kernel config
Comment 3 Piergiorgio Beruto 2011-08-20 20:03:59 UTC
Comment on attachment 284061 [details]
kernel log

I've marked with "<<<<<<<<<<<" my comments within the kernel log
Comment 4 Mike Pagano gentoo-dev 2011-09-02 22:36:56 UTC
Can you try passing in the country code via the parameter ath_pci countrycode=XX
Comment 5 Piergiorgio Beruto 2011-09-04 10:20:21 UTC
Hello,
the official ath9k driver seems to lack such module parameter:
modinfo (all ath*.ko driver) output:

filename:       ath9k.ko
license:        Dual BSD/GPL
description:    Support for Atheros 802.11n wireless LAN cards.
author:         Atheros Communications
alias:          pci:v0000168Cd00000032sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000030sv*sd*bc*sc*i*
alias:          pci:v0000168Cd0000002Esv*sd*bc*sc*i*
alias:          pci:v0000168Cd0000002Dsv*sd*bc*sc*i*
alias:          pci:v0000168Cd0000002Csv*sd*bc*sc*i*
alias:          pci:v0000168Cd0000002Bsv*sd*bc*sc*i*
alias:          pci:v0000168Cd0000002Asv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000029sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000027sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000024sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000023sv*sd*bc*sc*i*
depends:        ath9k_hw,mac80211,ath9k_common,ath,cfg80211
vermagic:       3.0.3-gentoo-cirith-ungol preempt mod_unload VIAC7
parm:           debug:Debugging mask (uint)
parm:           nohwcrypt:Disable hardware encryption (int)
parm:           blink:Enable LED blink on activity (int)
parm:           btcoex_enable:Enable wifi-BT coexistence (int)
filename:       ath9k_common.ko
license:        Dual BSD/GPL
description:    Shared library for Atheros wireless 802.11n LAN cards.
author:         Atheros Communications
depends:        ath9k_hw
vermagic:       3.0.3-gentoo-cirith-ungol preempt mod_unload VIAC7
filename:       ath9k_hw.ko
license:        Dual BSD/GPL
description:    Support for Atheros 802.11n wireless LAN cards.
author:         Atheros Communications
depends:        ath
vermagic:       3.0.3-gentoo-cirith-ungol preempt mod_unload VIAC7
parm:           force_new_ani:Force new ANI for AR5008, AR9001, AR9002 (int)
filename:       ath.ko
license:        Dual BSD/GPL
description:    Shared library for Atheros wireless LAN cards.
author:         Atheros Communications
depends:
vermagic:       3.0.3-gentoo-cirith-ungol preempt mod_unload VIAC7

Maybe you're confused by the madwifi proprietary driver?
Nevertheless, I've found a similar parameter in cfg80211.ko driver (ieee80211_regdom)

filename:       cfg80211.ko
description:    wireless configuration support
license:        GPL
author:         Johannes Berg
depends:        rfkill
vermagic:       3.0.3-gentoo-cirith-ungol preempt mod_unload VIAC7
parm:           ieee80211_regdom:IEEE 802.11 regulatory domain code (charp)
parm:           cfg80211_disable_40mhz_24ghz:Disable 40MHz support in the 2.4GHz band (bool)

I've tried setting this one but besides loosing some of the channels I can use, it didn't fix the problem.

Would it be possible that CRDA is called too early at boot when my root filesystem is not available yet? I'm suggesting this because I'm booting with initramfs (genkernel made) which I require for booting from raid/lvm partitions.

I've tried a similar kernel config (different machine) on another PC with the same atheros card and a similar setup but without raid/lvm (--> no initramfs) and everything seems to work perfectly without using the workaround.

I could try and verify this in two ways:
1) trying to force the kernel NOT to load the modules automatically (don't know how though, maybe I have to mess-up with udev?) and modprobing them later on.
2) emerging the CRDA userspace package into the initramfs image somehow

Assuming this is the problem, I think the kernel should be prepared to the possibility that CRDA is not present/working in userspace and maybe dequeue the request after some time or when something else happen instead of getting the queue stuck forever.

Moreover genkernel could be modified to include support for CRDA along with raid/lvm and splashutils which are already supported (If the problem i confirmed I could try and work on this)
Comment 6 Mike Pagano gentoo-dev 2011-09-14 18:19:11 UTC
This is the ath9k driver from the kernel? If so, can you test with a development kernel, the latest being git-sources-3.1_rc6 as of this writing.