Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 217992

Summary: sys-apps/openrc - txpower incorrectly set for iwl3945
Product: Gentoo Linux Reporter: Koy Rehme <koyrehme.bugs>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: ben.vighy, darkside, geekounet, ingmar, mattsch, mh, pacho, roy
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: 2.6.26 kernel config with iwl3945

Description Koy Rehme 2008-04-16 18:02:40 UTC
Restarting the wireless service (/etc/conf.d/net.wlan0) fails with the following error:

 *   Wireless radio has been killed for interface wlan0

Investigation shows that the problem lies with /lib/rc/net/iwconfig.sh in sys-apps/openrc-0.2.2 (and previous packages providing this file).

To save battery power, the transmitter on the wireless card is disabled (iwconfig wlan0 txpower off).  When bringing the service back up, however, the transmitter is not correctly enabled (see line 602 in iwconfig.sh): "auto" is an invalid option for this card.  Since the transmitter is left off, the test on line 723 fails (appropriately).


Reproducible: Always

Steps to Reproduce:
1. /etc/init.d/net.wlan0 start
2. /etc/init.d/net.wlan0 stop
3. /etc/init.d/net.wlan0 start

Actual Results:  
Error message:
 *   Wireless radio has been killed for interface wlan0
txpower is left off
Service fails to start

Expected Results:  
txpower is restored
Service starts appropriately

A workaround is to run the following before restarting the service:
/sbin/iwconfig wlan0 txpower on
Some have also reported that unloading/loading the kernel module also fixes this -- I can't confirm, but I think that might have the same effect.  Rebooting also works for some, but we shouldn't seriously accept that as a solution, right?

I am no expert on this, but I see two possible solutions:
1) Make txpower auto work
2) Perform a txpower on as well as txpower auto

The first would solve this specific case and may be the preferred solution.  However, the second would be a more general solution, in case not all cards support the auto setting.

---------------
/etc/conf.d/net
---------------
(empty)

-------------
emerge --info
-------------
Portage 2.1.5_rc4 (default-linux/x86/2007.0, gcc-4.2.3, glibc-2.7-r2, 2.6.24-gentoo-r5 i686)
=================================================================
System uname: 2.6.24-gentoo-r5 i686 Genuine Intel(R) CPU T2250 @ 1.73GHz
Timestamp of tree: Wed, 16 Apr 2008 16:19:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.5
dev-lang/python:     2.5.1-r5
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.62
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.24
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=pentium-m -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O3 -march=pentium-m -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp://ftp.rhnet.is/pub/gentoo/"
LDFLAGS=""
LINGUAS="en_US en pt_BR"
MAKEOPTS="-j3 -s"
PKGDIR="/usr/portage/packages"
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/overlays/koy"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="3dnow X aac acl acpi aim alsa arts avi bash-completion berkdb bitmap-fonts browserplugin cdr cli cracklib crypt ctype cups dri dvd emacs firefox fortran gdbm gpm iconv ipv6 isdnlog java jpeg kde midi mmx mp3 mpeg mplayer mudflap ncurses nls nptl nptlonly nsplugin nvidia opengl openmp oss pam pcre pdf pdflib perl png pni pppd python qt3 quicktime readline realmedia reflection session spl sse sse2 ssl tcpd threads timidity truetype truetype-fonts type1-fonts unicode x86 xcomposite xorg xscreensaver xvmc 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 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 synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US en pt_BR" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Nicola 2008-05-02 15:03:20 UTC
experienced the same here on a 4965AGN, i think using the same driver (iwlwifi).

i simply unloaded and reloaded the module.

i can confirm it behaves the same way even using the baselayout-1. It started to behave like this since when the iwlwifi was merged with the kernel tree.

(with wpa_supplicant/iwlwifi and openrc i can't connect, but roy marple should be already thinking about it, well i hope :-D)

Portage 2.1.4.4 (default-linux/amd64/2007.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-tuxonice-r1 x86_64)
=================================================================
System uname: 2.6.25-tuxonice-r1 x86_64 Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz
Timestamp of tree: Thu, 01 May 2008 17:30:01 +0000
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.4
dev-lang/python:     2.4.4-r9
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=nocona -fomit-frame-pointer -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=nocona -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS=" ftp://ftp.unina.it/pub/linux/distributions/gentoo"
LANG="it_IT.UTF-8"
LC_ALL="it_IT.UTF-8"
LINGUAS="it en_GB"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
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/portage/local/layman/desktop-effects /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 amrnb amrwb ao bash-completion berkdb cairo cli cracklib crypt css cups dbus dri dv dvd dvdr dvdread encode exif ffmpeg flac fortran gdbm gif gpm gtk hal iconv imlib ipv6 java jpeg kdehiddenvisibility lm_sensors mad midi mikmod mmx mmxext mozsvg mp3 mpeg mudflap musepack mysql ncurses nls nptl nptlonly nsplugin offensive ogg opengl openmp oss pam pcre pdf perl png python rdesktop readline reflection rtc samba sdl session smp spell spl sse sse2 ssl ssse3 subversion svg tcpd tetex theora threads truetype unicode v4l v4l2 vim vorbis wxwindows x264 xcb xcomposite xine xml xorg xosd xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter 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" CAMERAS="canon" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="it en_GB" USERLAND="GNU" VIDEO_CARDS="fglrx v4l"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 2 Michael Heyse 2008-05-17 09:41:19 UTC
Same here, and the problem is also present in /lib/rc/net/wpa_supplicant.sh.
Comment 3 Roy Marples 2008-05-27 10:48:11 UTC
The correct fix would be in the driver then :)

OpenRC is doing the correct thing with iwconfig - check the iwconfig man page.
Comment 4 Alex Zorach 2008-05-29 15:28:23 UTC
I am having this problem too.  I would like to add that the workaround given does not work for me.  For some reason when I run:

/sbin/iwconfig wlan0 txpower on

my laptop's screen fades to white and I cannot use the computer (although the computer does not crash, and I'm able to switch to a console, log on as root, and halt or reboot).

In the interim I'd be grateful for either another workaround, or some insight into how to troubleshoot the problem I'm having.
Comment 5 enrico 2008-05-30 08:00:14 UTC
(In reply to comment #3)
> The correct fix would be in the driver then :)
> 
> OpenRC is doing the correct thing with iwconfig - check the iwconfig man page.
> 

My iwconfig man page says this: <<In addition, 'on' and 'off' enable and disable the radio, and 'auto' and 'fixed' enable and disable power control (if those features are available).>>

So if you perform an "off", then the "on" should be sent back! 
The 'auto' parameter selects an automatic power control algorithm, but if you powered down the transmitter with 'off', only 'on' can bring it back up!

Even if it was a problem with the driver (but it isn't according to the manual) it makes user happy to add that temporary workaround.
Comment 6 Alex Zorach 2008-06-10 00:59:39 UTC
I keep trying to replicate the problem I am having and it comes out differently each time.  In general it does something very scary.  A couple times my system has become unstable and locked up...it makes me nervous to keep playing with it.
Comment 7 Matthew Schultz 2008-07-23 21:39:11 UTC
(In reply to comment #3)
> The correct fix would be in the driver then :)
> 
> OpenRC is doing the correct thing with iwconfig - check the iwconfig man page.
> 

I don't think this a driver problem.  I'm using 2.6.26 with openrc 0.2.5 and restarting wlan0 never works.  In order to get it to work, I have to stop wlan0 and then run "iwconfig wlan0 txpower on" or "iwconfig wlan0 txpower auto" and then start wlan0.  If I don't run that iwconfig command, it attempts to acquire an address through dhcp but never gets one.  

Commands to successfully restart wlan0:
/etc/init.d/wlan0 stop
iwconfig wlan0 txpower on
/etc/init.d/wlan0 start

It seems to me that openrc isn't configuring the wireless interface properly if I have to run this iwconfig command every time I restart.  

I have also noticed other behavior when rebooting.  It seems to bring up the wireless interface properly mostly every time on boot so I think it's a problem with stopping the interface.
Comment 8 Matthew Schultz 2008-07-23 21:39:32 UTC
emerge --info:

Portage 2.1.4.4 (default/linux/x86/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.26-gentoo i686)
=================================================================
System uname: 2.6.26-gentoo i686 Genuine Intel(R) CPU T2300 @ 1.66GHz
Timestamp of tree: Wed, 23 Jul 2008 13:15:01 +0000
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.4.4-r13, 2.5.2-r5
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.5
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://portage.home http://lug.mtu.edu/gentoo/ http://gentoo.netnitco.net "
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en ru"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
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/portage"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/sajinet /usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi adns ads alsa apache2 async audiofile automount avi bcmath bdf berkdb bzip2 calendar caps cddb cdparanoia cdr cjk clamav cli cpudetection cracklib crypt ctype cups curl curlwrappers dbus directfb dri dts dvb dvd dvdnav dvdread encode exif fam fbcon ffmpeg flac foomaticdb fortran ftp gd gdbm gif glib gmp gnutls gpm gtk gtk2 hal hash iconv imagemagick imap imlib innodb ipv6 isdnlog java javascript jpeg jpeg2k json kde kipi kson lcms ldap ldap-sasl live logrotate lzo mad matroska mcal mhash midi mime mjpeg mmap mmx mmxext mng mp2 mp3 mp4 mpeg msession msn mssql mudflap mysql mysqli ncurses network nls nptl nptlonly nsplugin nss nvidia offensive ogg openal opengl openmp osc oss pam pch pcntl pcre pdf pdo perl php png posix ppds pppd python qt3 qt3support qt4 quicktime readline reflection rtc samba sasl sdl seamonkey session simplexml snmp soap sockets spell spl sqlite sse ssl subversion suexec suhosin svg swat syslog tcpd theora threads tidy tiff tokenizer transcode truetype unicode usb v4l v4l2 vcd vorbis wddx win32codecs winbind wxwindows x264 x86 xforms xine xml xorg xpm xsl xv xvid zip zlib" ALSA_CARDS="hda-intel ens1371" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse vmmouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en ru" USERLAND="GNU" VIDEO_CARDS="i810 fbdev vesa vmware"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 9 Matthew Schultz 2008-07-23 21:40:43 UTC
Created attachment 161218 [details]
2.6.26 kernel config with iwl3945
Comment 10 Matthew Schultz 2008-07-23 21:49:48 UTC
/lib/rc/net/iwconfig.sh is probably not turning txpower back on if you shutdown down wlan0 and start it back up again.
Comment 11 Matthew Schultz 2008-07-23 21:56:38 UTC
Problem is usually spelled with an "l"

/lib/rc/net/iwconfig.sh:

eerror "Looks like there was a probem loading the firmware for ${IFACE}"
Comment 12 Roy Marples 2008-07-24 19:02:50 UTC
(In reply to comment #10)
> /lib/rc/net/iwconfig.sh is probably not turning txpower back on if you shutdown
> down wlan0 and start it back up again.

The git version should be.
Comment 13 Roy Marples 2008-07-24 19:03:06 UTC
(In reply to comment #11)
> Problem is usually spelled with an "l"

Fixed, thanks
Comment 14 Matthew Schultz 2008-07-28 22:21:08 UTC
(In reply to comment #12)
> (In reply to comment #10)
> > /lib/rc/net/iwconfig.sh is probably not turning txpower back on if you shutdown
> > down wlan0 and start it back up again.
> 
> The git version should be.
> 

Ok I just upgraded to the latest GIT version today.  When it boots, I don't start wlan0.  I then stop eth0 and then start wlan0.  It starts.  Then I stop wlan0 and then attempt to start it again and it does not start.  Every subsequent stop/start does not start wlan0 properly (it doesn't obtain a dhcp address even though it says txpower is on).  I tried to test several of the scripts but I couldn't find the problem.  Here's what works every time for me on every stop/start:  If I add: iwconfig wlan0 txpower on right after start() in net.lo, it works every single time (tested 10 times).  If I take that out right there, it never connects on several stop/starts.  Perhaps the problem is the interface is being brought up before txpower is set causing it to not connect and grab an addres through dhcp?
Comment 15 Matthew Schultz 2008-07-31 15:12:02 UTC
(In reply to comment #14)
> (In reply to comment #12)
> > (In reply to comment #10)
> > > /lib/rc/net/iwconfig.sh is probably not turning txpower back on if you shutdown
> > > down wlan0 and start it back up again.
> > 
> > The git version should be.
> > 
> 
> Ok I just upgraded to the latest GIT version today.  When it boots, I don't
> start wlan0.  I then stop eth0 and then start wlan0.  It starts.  Then I stop
> wlan0 and then attempt to start it again and it does not start.  Every
> subsequent stop/start does not start wlan0 properly (it doesn't obtain a dhcp
> address even though it says txpower is on).  I tried to test several of the
> scripts but I couldn't find the problem.  Here's what works every time for me
> on every stop/start:  If I add: iwconfig wlan0 txpower on right after start()
> in net.lo, it works every single time (tested 10 times).  If I take that out
> right there, it never connects on several stop/starts.  Perhaps the problem is
> the interface is being brought up before txpower is set causing it to not
> connect and grab an addres through dhcp?
> 


I found that if I add this in /etc/conf.d/net, wlan0 comes up every time:


#Wireless will not work unless it is powered on before the interface is brought up
preup (){
        if [[ ${IFACE} == "wlan0" ]]; then
                iwconfig wlan0 txpower on
        fi
        return 0
}
Comment 16 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-12-19 18:06:48 UTC
There is a couple things going on in this bug.

1) Kernel/driver issues not related to openrc
2) Misc fixes that were applied to openrc months ago.

Hence, closing bug. It would be best for *new* bugs to be opened against 0.5.3 since this bug is out of date and quite hard to read. Thanks.