# iwl4965 - after reboot claims there is no firmware

## Johnny_Bit

Hello,

Today just afterreboot my wifi card stopped working, the light does not go up, neither does connection.

dmesg | grep iwl says request for firmware file 'iwlwifi-4965-2.ucode failed

however file is present in /lib64/firmware, linux-firmware emerged (and re-emerged just now)

kernel haven't been changed in recent days, just standard every-week update. Only suspicius ilem on genlop -l is new udev-199, but as to what is going on, I have no idea...

----------

## RiJo

I'm experiencing the same problem since system upgrade. Both before upgrading kernel and after (to v3.8.4). 

It seems like my iwl4965 firmware cannot be loaded properly, and my network device wlan0 is not created.

dmesg:

```
[   61.408155] iwl4965 0000:03:00.0: request for firmware file 'iwlwifi-4965-2.ucode' failed.

[   61.408163] iwl4965 0000:03:00.0: no suitable firmware found!
```

Note: the file '/lib/firmware/iwlwifi-4965-2.ucode' exists in the filesystem.

I read somewhere to re-emerge 'sys-kernel/linux-firmware', but this package wasn't installed in my system. When I tried to emerge it, I received the following message:

```
# emerge --oneshot linux-firmware

Calculating dependencies... done!

[ebuild  N     ] sys-kernel/linux-firmware-20130113  USE="-savedconfig"

[blocks B      ] sys-firmware/iwl4965-ucode ("sys-firmware/iwl4965-ucode" is blocking sys-kernel/linux-firmware-20130113)

 * Error: The above package list contains packages which cannot be

 * installed at the same time on the same system.

  (sys-kernel/linux-firmware-20130113::gentoo, ebuild scheduled for merge) pulled in by

    linux-firmware

  (sys-firmware/iwl4965-ucode-228.61.2.24::gentoo, installed) pulled in by

    sys-firmware/iwl4965-ucode required by @selected

For more information about Blocked Packages, please refer to the following

section of the Gentoo Linux x86 Handbook (architecture is irrelevant):

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#blocked
```

I commented out 'sys-firmware/iwl4965-ucode' from '/var/lib/portage/world' and emerged again. The package 'sys-firmware/iwl4965-ucode' was then unmerged and 'sys-kernel/linux-firmware' emerged instead:

```
# emerge --oneshot linux-firmware

Calculating dependencies... done!

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) sys-kernel/linux-firmware-20130113

>>> Downloading 'http://ftp.df.lth.se/pub/gentoo/distfiles/linux-firmware-20130113.tar.xz'

--2013-03-28 07:35:20--  http://ftp.df.lth.se/pub/gentoo/distfiles/linux-firmware-20130113.tar.xz

Resolving ftp.df.lth.se... 194.47.250.18

Connecting to ftp.df.lth.se|194.47.250.18|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 18590492 (18M) [text/plain]

Saving to: '/usr/portage/distfiles/linux-firmware-20130113.tar.xz'

100%[======================================>] 18 590 492   759KB/s   in 24s

2013-03-28 07:35:43 (765 KB/s) - '/usr/portage/distfiles/linux-firmware-20130113.tar.xz' saved [18590492/18590492]

 * linux-firmware-20130113.tar.xz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                                                [ ok ]

>>> Unpacking source...

>>> Unpacking linux-firmware-20130113.tar.xz to /var/tmp/portage/sys-kernel/linux-firmware-20130113/work

>>> Source unpacked in /var/tmp/portage/sys-kernel/linux-firmware-20130113/work

>>> Preparing source in /var/tmp/portage/sys-kernel/linux-firmware-20130113/work/linux-firmware-20130113 ...

>>> Source prepared.

>>> Configuring source in /var/tmp/portage/sys-kernel/linux-firmware-20130113/work/linux-firmware-20130113 ...

>>> Source configured.

>>> Compiling source in /var/tmp/portage/sys-kernel/linux-firmware-20130113/work/linux-firmware-20130113 ...

make -j3

make: Nothing to be done for `all'.

>>> Source compiled.

>>> Test phase [not enabled]: sys-kernel/linux-firmware-20130113

>>> Install linux-firmware-20130113 into /var/tmp/portage/sys-kernel/linux-firmware-20130113/image/ category sys-kernel

 * Your configuration for sys-kernel/linux-firmware-20130113 has been saved in

 * /etc/portage/savedconfig/sys-kernel/linux-firmware-20130113 for your editing pleasure.

 * You can edit these files by hand and remerge this package with

 * USE=savedconfig to customise the configuration.

 * You can rename this file/directory to one of the following for

 * its configuration to apply to multiple versions:

 * ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/

 * [${CTARGET}|${CHOST}|""]/${CATEGORY}/[${PF}|${P}|${PN}]

>>> Completed installing linux-firmware-20130113 into /var/tmp/portage/sys-kernel/linux-firmware-20130113/image/

>>> Installing (1 of 1) sys-kernel/linux-firmware-20130113

 * Removing /usr/share/doc

 * If you are only interested in particular firmware files, edit the saved

 * configfile and remove those that you do not want.

>>> Uninstalling sys-firmware/iwl4965-ucode-228.61.2.24

 sys-firmware/iwl4965-ucode

    selected: 228.61.2.24

   protected: none

     omitted: none

All selected packages: sys-firmware/iwl4965-ucode-228.61.2.24

>>> 'Selected' packages are slated for removal.

>>> 'Protected' and 'omitted' packages will not be removed.

>>> Unmerging sys-firmware/iwl4965-ucode-228.61.2.24...

 * Messages for package sys-kernel/linux-firmware-20130113:

 * Your configuration for sys-kernel/linux-firmware-20130113 has been saved in

 * /etc/portage/savedconfig/sys-kernel/linux-firmware-20130113 for your editing pleasure.

 * You can edit these files by hand and remerge this package with

 * USE=savedconfig to customise the configuration.

 * You can rename this file/directory to one of the following for

 * its configuration to apply to multiple versions:

 * ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/

 * [${CTARGET}|${CHOST}|""]/${CATEGORY}/[${PF}|${P}|${PN}]

 * If you are only interested in particular firmware files, edit the saved

 * configfile and remove those that you do not want.

>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
```

Note: the file '/lib/firmware/iwlwifi-4965-2.ucode' still exists in the filesystem. 

Still the same problem as before. Anyone with suggestions of what to try/do?

Edit: packages I upgraded:

```
dev-python/python-exec-0.3.1

sys-libs/timezone-data-2013b

dev-libs/libffi-3.0.13

dev-libs/libaio-0.3.109-r4

sys-fs/dosfstools-3.0.16

net-wireless/wireless-regdb-20130213

media-libs/libdvdcss-1.2.13

dev-libs/gmp-5.1.1

sys-apps/sandbox-2.6-r1

dev-libs/mpfr-3.1.2

media-libs/libjpeg-turbo-1.2.90

net-libs/libtirpc-0.2.3

app-crypt/p11-kit-0.17.4

dev-lang/perl-5.16.3

sys-kernel/linux-headers-3.8

sys-apps/keyutils-1.5.5

dev-libs/openssl-1.0.1e

app-misc/ca-certificates-20130119

dev-qt/qtcore-4.8.4-r5

dev-qt/qtscript-4.8.4

x11-base/xorg-drivers-1.14

sys-process/procps-3.3.6

app-shells/bash-4.2_p45

sys-devel/bc-1.06.95-r1

x11-proto/xproto-7.0.23-r2

x11-proto/xextproto-7.2.1-r1

x11-proto/inputproto-2.3

x11-proto/kbproto-1.0.6-r1

dev-libs/libpthread-stubs-0.3-r1

x11-proto/xf86bigfontproto-1.2.0-r1

media-libs/alsa-lib-1.0.26-r1

x11-proto/renderproto-0.11.1-r1

net-misc/curl-7.29.0-r1

x11-proto/damageproto-1.2.1-r1

x11-proto/videoproto-2.3.1-r1

x11-proto/recordproto-1.14.2-r1

x11-proto/randrproto-1.4.0-r1

x11-proto/scrnsaverproto-1.2.2-r1

x11-proto/xf86vidmodeproto-2.3.1-r1

dev-libs/icu-50.1.2

x11-proto/compositeproto-0.4.2-r1

x11-proto/xineramaproto-1.2.1-r1

dev-libs/nspr-4.9.5-r2

x11-proto/xf86dgaproto-2.1-r2

x11-misc/util-macros-1.17

dev-libs/mini-xml-2.7-r1

x11-libs/libICE-1.0.8-r1

x11-libs/libXau-1.0.7-r1

x11-libs/libXdmcp-1.1.1-r1

x11-proto/fixesproto-5.0-r1

dev-libs/nss-3.14.3

x11-libs/libSM-1.2.1-r1

app-admin/apache-tools-2.4.4-r1

www-servers/apache-2.4.4-r3

dev-lang/python-2.7.3-r3

dev-libs/libxml2-2.9.0-r2

x11-proto/xcb-proto-1.8-r2

net-libs/neon-0.29.6-r5

dev-lang/python-3.2.3-r2

dev-python/numpy-1.7.0

dev-python/paver-1.2.0

dev-python/urwid-1.1.1-r1

dev-python/m2crypto-0.21.1-r1

sys-devel/binutils-2.23.2

sys-libs/e2fsprogs-libs-1.42.7

sys-apps/attr-2.4.46-r2

dev-libs/libgpg-error-1.11

dev-vcs/subversion-1.7.8

media-libs/libexif-0.6.21-r1

sys-fs/e2fsprogs-1.42.7

dev-libs/libgcrypt-1.5.1

x11-misc/shared-mime-info-1.1

dev-libs/libassuan-2.1.0

net-fs/nfs-utils-1.2.7

sys-apps/coreutils-8.21

dev-libs/libxslt-1.1.28-r1

net-libs/gnutls-3.1.9-r1

x11-libs/libxcb-1.9-r1

sys-apps/kmod-12-r1

app-text/asciidoc-8.6.8-r1

x11-libs/libX11-1.5.0-r1

sys-devel/gcc-4.7.2-r1

x11-libs/libXext-1.3.1-r1

x11-libs/libXt-1.1.3-r1

media-libs/freetype-2.4.11-r2

x11-libs/libXrender-0.9.7-r1

x11-libs/libXfixes-5.0-r1

media-gfx/graphite2-1.2.1

net-libs/libproxy-0.4.11

x11-libs/libXmu-1.1.1-r1

app-admin/python-updater-0.11

x11-libs/libXpm-3.5.10-r1

x11-libs/libXi-1.7

x11-libs/libXcursor-1.1.13-r1

x11-libs/libXdamage-1.1.4-r1

x11-libs/libXrandr-1.4.0-r1

x11-libs/libXcomposite-0.4.4-r1

x11-libs/libXv-1.0.7-r1

x11-libs/libXScrnSaver-1.2.2-r1

x11-libs/libXxf86vm-1.1.2-r1

sci-libs/fftw-3.3.3-r2

app-portage/gentoolkit-0.3.0.7-r2

x11-libs/libXaw-1.0.11-r2

x11-libs/libXtst-1.2.1-r1

dev-libs/dbus-glib-0.100.2

net-libs/libsoup-2.40.3

sys-apps/groff-1.22.2

media-gfx/feh-2.9.1-r1

dev-vcs/git-1.8.1.5

sys-apps/man-pages-3.50

sys-libs/pam-1.1.6-r4

sys-apps/busybox-1.21.0

virtual/mta-1

media-video/ffmpeg-1.0.6

app-admin/sudo-1.8.6_p7

sys-fs/udev-199

virtual/udev-197-r2

sys-fs/udev-init-scripts-25

sys-apps/hwids-20130326.1

x11-libs/libpciaccess-0.13.1-r1

sys-kernel/gentoo-sources-3.8.4

media-libs/fontconfig-2.10.2-r1

x11-libs/libXft-2.3.1-r1

media-sound/rosegarden-13.02

sci-visualization/gnuplot-4.6.2-r1

x11-libs/cairo-1.12.12-r1

media-libs/harfbuzz-0.9.12

app-text/poppler-0.22.2-r2

x11-libs/gtk+-2.24.17

www-plugins/adobe-flash-11.2.202.275

app-editors/scite-3.2.5

www-client/firefox-bin-19.0.2

app-crypt/gcr-3.6.2

net-libs/libnice-0.1.4

media-plugins/gst-plugins-libnice-0.1.4

net-im/pidgin-2.10.7-r1

gnome-base/gnome-keyring-3.6.2

dev-db/mysql-5.5.30

app-admin/eselect-php-0.7.0

dev-lang/php-5.5.0_beta1-r3

x11-base/xorg-server-1.14.0

x11-drivers/xf86-input-evdev-2.7.3-r1

x11-drivers/xf86-video-intel-2.21.4

media-libs/mesa-9.1.1

x11-drivers/xf86-input-synaptics-1.6.3
```

----------

## cruzki123

I am having the same problem. Yesterday I update the system and after reboot I have no longer have the firmware loaded. The only suspicius packages is udev but unfortunately downgrading have no effect  :Sad: 

----------

## Johnny_Bit

OK,

I've  got something: If You actually have file where it should be:

I had Iwlwifi loaded as a part of kernel (so - no module). What I noticed was that boot time after reboot got dramatically up, (something like a 2 minutes to boot core 2 duo is shitty) and it hanged only around "Processing udev events" or something similar.

As a last resort in order to be able to see what is going on I switched iwl to module:

```
CONFIG_IWL4965=m
```

after reboot (which was very fast, around same time as it took before problems with wifi) everything went smooth and without problems.

I had to go to work, so no time to analyze, but net works.

TL;DR: switch IWL4965 from built-in to module. should help.

----------

## Anon-E-moose

The problems might have to do with the swap from "/" to "/usr" 

You might check and see if there are some old rules being left around or that they are in the right place.

Good luck

----------

## cruzki123

I have another solution. Just put the firmware file inside the kernel.

----------

## RiJo

 *Anon-E-moose wrote:*   

> The problems might have to do with the swap from "/" to "/usr" 
> 
> You might check and see if there are some old rules being left around or that they are in the right place.
> 
> Good luck

 

Which swap? Are the firmware-files moved to /usr/lib/firmware? When did they change this?

Another note: I am using an monolith compiled kernel (no dynamic module loading). Don't know if it matters, but that's the case..

----------

## Johnny_Bit

 *cruzki123 wrote:*   

> I have another solution. Just put the firmware file inside the kernel.

 

I run various linux boxes (gentoo only from 2005) and still can't do that... can You throw a link for some super easy tut on how to do this?

----------

## Anon-E-moose

Perusing the udev-199 ebuild, they added a "firmware-loader" USE flag. 

You might make sure that that is being set during emerge.

It does trigger adding 

```
--with-firmware-path="/lib/firmware/updates:/lib/firmware"
```

 to the compile.

----------

## Gusar

kernels 3.7 and up can load firmware themselves, so you only need the firmware-loader flag for udev if you're using an older kernel.

As for compiling firmware into the kernel, the first result when googling for "compile firmware into kernel" is this: https://forums.gentoo.org/viewtopic-t-916540-start-0.html

----------

## RiJo

 *Anon-E-moose wrote:*   

> Perusing the udev-199 ebuild, they added a "firmware-loader" USE flag.

 

Tested rebuilding udev with that USE flag, but still same issue..

----------

## RiJo

 *cruzki123 wrote:*   

> I have another solution. Just put the firmware file inside the kernel.

 

This worked for me! I'm currently writing this through wlan0..

I added following to my kernel .config:

```
CONFIG_EXTRA_FIRMWARE="iwlwifi-4965-2.ucode"

CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"
```

Maybe a bug report should be posted on this topic? There seems to be a problem for the kernel (udev?) to locate the firmware-file inside /lib/firmware.

----------

## Anon-E-moose

 *RiJo wrote:*   

>  *Anon-E-moose wrote:*   Perusing the udev-199 ebuild, they added a "firmware-loader" USE flag. 
> 
> Tested rebuilding udev with that USE flag, but still same issue..

 

Looks like it's a problem with udev itself  https://bugs.gentoo.org/show_bug.cgi?id=463604

----------

## Gusar

There is no bug here. If you don't have modules, the driver will load before the filesystem (where the firmware resides) is mounted, so of course it won't find the firmware. Some drivers are capable of fetching firmware at a later time, but a lot want to do it when they load. So either build the driver as a module, or compile firmware into the kernel. This is unrelated to udev.

----------

## RiJo

 *Gusar wrote:*   

> There is no bug here. If you don't have modules, the driver will load before the filesystem (where the firmware resides) is mounted, so of course it won't find the firmware.

 

But it has always been working with my configuration until last upgrade(?). Something must have been altered (or bug introduced).

I'm currently experiencing another problem now. My wlan0 dies after a short while, with the following result (looking into this at the moment):

```
# sudo ifconfig wlan0 up

SIOCSIFFLAGS: Operation not possible due to RF-kill
```

Never seen this before..

Edit: seems like my shortcut on the keyboard finally works with setting soft rfkill on/off. Hopefully I can now save some battery time  :Smile:  OT: Is it possible to set how the kernel puts my wifi in soft rfkill mode (like inactive time or similar)?

----------

## Anon-E-moose

 *Gusar wrote:*   

> There is no bug here. If you don't have modules, the driver will load before the filesystem (where the firmware resides) is mounted, so of course it won't find the firmware. Some drivers are capable of fetching firmware at a later time, but a lot want to do it when they load. So either build the driver as a module, or compile firmware into the kernel. This is unrelated to udev.

 

 :Rolling Eyes: 

https://bugs.freedesktop.org/show_bug.cgi?id=62864

----------

## Gusar

 *Anon-E-moose wrote:*   

>  
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=62864

 

And how does that relate to what I said? A built-in driver can't load firmware from an umounted filesystem, this happens before udev even starts. That bug only concerns module loading, not built-in drivers. And even that only on older kernels, like I said, 3.7+ can load firmware on their own. Though maybe the kernel is nowadays smart enough to delay driver loading until userspace is ready - if the kernel fails to load firmware, it'll wait for userspace and rely on udev to handle it. If that's really the case, then the requirement to compile firmware into the kernel for built-in drivers is a thing of the past. But this would be recent development, because it was common advice to say "if the driver is in the kernel, the firmware needs to be to", as can be witnessed by all the threads about people needing help getting radeon graphics running.

----------

## Anon-E-moose

 *Gusar wrote:*   

>  *Anon-E-moose wrote:*    
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=62864 
> 
> And how does that relate to what I said?

 

 This is unrelated to udev.

It most certainly was related to udev. 

1. The only thing the 1st two people had done was update *ta da* udev and it magically quit working.

2. /lib/firmware is mounted because it is on root, 

which gets mounted before things like network cards get initialized, 

at least it's been that way for a very long time.

The bug report spells it out, clear and simple for those that can read. 

They made a mistake so that the firmware loading code was NEVER being executed, no matter whether a filesystem was there or not.

Geez   :Rolling Eyes: 

Edit to add: I've posted the bug report for those who will take the time to read it

as it looks like the snafu got fixed. For the others, have a great day/night.

----------

## RiJo

But my problem occurred without upgrading the kernel (not yet built and exchanged) nor the firmware (no new version). And if I interpret dmesg correctly, it seems like my filesystem is mounted before the firmware is loaded.

I'm not an expert in this area, I just want to help out to find what causing the problem..

----------

## Gusar

 *Anon-E-moose wrote:*   

> which gets mounted before things like network cards get initialized,

 

Not if the driver is built-in. Built-in drivers load when the kernel does, which is *before* mounting filesystems.

 *Anon-E-moose wrote:*   

> They made a mistake so that the firmware loading code was NEVER being executed, no matter whether a filesystem was there or not.

 

The bug is about udev. Udev has no effect on anything that happens before the filesystem is mounted. Because, well, that's where udev resides.

Notice how RiJo got his card running by compiling firmware into the kernel? How can that be, when he still has a broken udev? Simple, kernel's firmware loading is *unrelated* to udev. Udev only comes into play if the kernel's firmware loading fails.

@RiJo: You have no modules. Which means the kernel failed to load firmware and relied on udev to do it. But you have udev-199, which is broken. So what you now did is take udev out of the equation - by compiling firmware into the kernel.Last edited by Gusar on Thu Mar 28, 2013 7:36 pm; edited 1 time in total

----------

## RiJo

 *Gusar wrote:*   

> @RiJo: You have no modules. Which means the kernel failed to load firmware and relied on udev to do it. But you have udev-199, which is broken. So what you now did is take udev out of the equation - by compiling firmware into the kernel.

 

Ok, thanks! So the way I currently solved it (adding firmware into the kernel) is the proper way in my case?

----------

## Gusar

 *RiJo wrote:*   

> Ok, thanks! So the way I currently solved it (adding firmware into the kernel) is the proper way in my case?

 

Yes, adding firmware for your hardware into the kernel is a perfectly valid thing to do. A lot of people do this, mostly users of the radeon driver.

----------

## RiJo

@Gusar: thank you!

Seems like there's a new version of udev (udev-199-r1) live now. Don't know if it solves the problem, anyone tried?

----------

## AgBr

I have to chime in with some other aspect. 

```
>>> Failed to install sys-kernel/linux-firmware-20120924, Log file:

>>>  '/var/tmp/portage/sys-kernel/linux-firmware-20120924/temp/build.log'

>>> Extracting info

 * Package:    sys-kernel/linux-firmware-20120924

 * Repository: gentoo

 * USE:        x86 abi_x86_32 kernel_linux consolekit elibc_glibc policykit userland_GNU

 * FEATURES:   sandbox

>>> Extracting sys-kernel/linux-firmware-20120924

 * This package will overwrite one or more files that may belong to other

 * packages (see list below).

 * 

 * Detected file collision(s):

 * 

 *      /lib/firmware/mts_edge.fw

 *      /lib/firmware/whiteheat.fw

 *      /lib/firmware/mts_cdma.fw

 *      /lib/firmware/ti_3410.fw

 *      /lib/firmware/whiteheat_loader.fw

 *      /lib/firmware/atmsar11.fw

 

[dacapo]

```

As it seems, these files belong to

```

build-server / # equery belongs /lib/firmware/mts_edge.fw

 * Searching for /lib/firmware/mts_edge.fw ... 

sys-kernel/gentoo-sources-3.7.10 (/lib/firmware/mts_edge.fw)

sys-kernel/linux-firmware-20120924 (/lib/firmware/mts_edge.fw)

```

Unfortunately the one I am interested in, iwlwifi-4965-2.ucode, does not exist in sys-kernel/sources-gentoo. It only belongs to sys-kernel/linux-firmware which supplies, as can be seen above, the other files too.

The notebook which I try to get running gets installed from binary packages only. These get built on a dedicated server inside a chroot environment for that matter. The build and installation there is running fine. The installation of the binary package fails. What is going on here?

----------

## Punchcutter

I thought I would report my successful conclusion to this problem (although I am not OP), on my laptop with iwlwifi-4965 NIC.

Running udev-200 with USE="firmware-loader" on gentoo-sources kernel 3.5.7 and firmware managed by

linux-firmware package. Udev properly finds it on the filesystem (in /lib/firmware). Wlan working fine.

----------

