# [solved]iwlwifi driver not working (fails to run init ucode)

## Barnoid

After an upgrade of my system, wifi stopped working. From the error messages and the driver code, it seems the initialization of the ucode fails. I have tried different ucodes (.7, .8, .9) and also reverted to the previously installed packages with not much success. Then, to run the latest driver & firmware I have unmasked gentoo-sources and am now running 3.14.4, but the error persists.

Here is what I get in the kernel log when I enable WiFi through nm-applet:

```
May 22 17:56:58 localhost NetworkManager[1893]: <info> (wlp2s0): bringing up device.

May 22 17:56:58 localhost kernel: iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S

May 22 17:56:58 localhost kernel: iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S

May 22 17:56:58 localhost kernel: iwlwifi 0000:02:00.0: Failed to run INIT ucode: 1

May 22 17:56:58 localhost kernel: ------------[ cut here ]------------

May 22 17:56:58 localhost kernel: WARNING: CPU: 1 PID: 1893 at drivers/net/wireless/iwlwifi/mvm/fw.c:368 iwl_mvm_up+0x2a9/0x2e0()

May 22 17:56:58 localhost kernel: Modules linked in:

May 22 17:56:58 localhost kernel: CPU: 1 PID: 1893 Comm: NetworkManager Not tainted 3.14.4-gentoo #3

May 22 17:56:58 localhost kernel: Hardware name: Dell Inc. XPS13 9333/0GFTRT, BIOS A01 11/11/2013

May 22 17:56:58 localhost kernel: 0000000000000000 0000000000000009 ffffffff816d79f2 0000000000000000

May 22 17:56:58 localhost kernel: ffffffff810657d6 00000000ffffff7c ffff88021561f7a8 0000000000000001

May 22 17:56:58 localhost kernel: 0000000000000000 0000000000000000 ffffffff81454859 0000000000000000

May 22 17:56:58 localhost kernel: Call Trace:

May 22 17:56:58 localhost kernel: [<ffffffff816d79f2>] ? dump_stack+0x41/0x51

May 22 17:56:58 localhost kernel: [<ffffffff810657d6>] ? warn_slowpath_common+0x86/0xb0

May 22 17:56:58 localhost kernel: [<ffffffff81454859>] ? iwl_mvm_up+0x2a9/0x2e0

May 22 17:56:58 localhost kernel: [<ffffffff815e74d4>] ? inetdev_event+0x34/0x4e0

May 22 17:56:58 localhost kernel: [<ffffffff81456c39>] ? iwl_mvm_mac_start+0xc9/0xf0

May 22 17:56:58 localhost kernel: [<ffffffff81699a72>] ? ieee80211_do_open+0x292/0xd40

May 22 17:56:58 localhost kernel: [<ffffffff81089be5>] ? notifier_call_chain+0x45/0x60

May 22 17:56:58 localhost kernel: [<ffffffff81590626>] ? __dev_open+0x86/0xe0

May 22 17:56:58 localhost kernel: [<ffffffff81590905>] ? __dev_change_flags+0xa5/0x190

May 22 17:56:58 localhost kernel: [<ffffffff81590a29>] ? dev_change_flags+0x29/0x70

May 22 17:56:58 localhost kernel: [<ffffffff8159dad2>] ? do_setlink+0x332/0x940

May 22 17:56:58 localhost kernel: [<ffffffff8159f0e4>] ? rtnl_newlink+0x4b4/0x6e0

May 22 17:56:58 localhost kernel: [<ffffffff8159ed3a>] ? rtnl_newlink+0x10a/0x6e0

May 22 17:56:58 localhost kernel: [<ffffffff8159ea7f>] ? rtnetlink_rcv_msg+0x9f/0x250

May 22 17:56:58 localhost kernel: [<ffffffff8159c720>] ? rtnl_fill_ifinfo+0xa80/0xa80

May 22 17:56:58 localhost kernel: [<ffffffff81153ee5>] ? __kmalloc_track_caller+0x125/0x1a0

May 22 17:56:58 localhost kernel: [<ffffffff8159e9e0>] ? __rtnl_unlock+0x10/0x10

May 22 17:56:58 localhost kernel: [<ffffffff815ae419>] ? netlink_rcv_skb+0xa9/0xc0

May 22 17:56:58 localhost kernel: [<ffffffff8159d648>] ? rtnetlink_rcv+0x18/0x20

May 22 17:56:58 localhost kernel: [<ffffffff815adccd>] ? netlink_unicast+0x17d/0x210

May 22 17:56:58 localhost kernel: [<ffffffff815ae160>] ? netlink_sendmsg+0x340/0x400

May 22 17:56:58 localhost kernel: [<ffffffff81574a82>] ? sock_sendmsg+0x62/0x90

May 22 17:56:58 localhost kernel: [<ffffffff81577120>] ? move_addr_to_kernel+0x50/0xa0

May 22 17:56:58 localhost kernel: [<ffffffff81583ae9>] ? verify_iovec+0x49/0xc0

May 22 17:56:58 localhost kernel: [<ffffffff81574ed4>] ? ___sys_sendmsg+0x384/0x390

May 22 17:56:58 localhost kernel: [<ffffffff81606968>] ? unix_find_other+0xe8/0x210

May 22 17:56:58 localhost kernel: [<ffffffff811773ec>] ? __fget_light+0x1c/0x60

May 22 17:56:58 localhost kernel: [<ffffffff815746c9>] ? sockfd_lookup_light+0x19/0x80

May 22 17:56:58 localhost kernel: [<ffffffff8157784d>] ? SyS_connect+0xad/0xb0

May 22 17:56:58 localhost kernel: [<ffffffff81577f44>] ? __sys_sendmsg+0x44/0x80

May 22 17:56:58 localhost kernel: [<ffffffff816de962>] ? system_call_fastpath+0x16/0x1b

May 22 17:56:58 localhost kernel: ---[ end trace 6793229010716961 ]---
```

I have patched the kernel as indicated here to run the latest firmware (23.214.9). The firmware is loaded correctly:

```
xps13 linux # uname -a

Linux xps13 3.14.4-gentoo #3 SMP Thu May 22 17:54:31 CEST 2014 x86_64 Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz GenuineIntel GNU/Linux

xps13 linux # ls -l /lib/firmware/

total 1992

-rw-r--r-- 1 root root 682892 Dec 11 01:45 iwlwifi-7260-7.ucode

-rw-r--r-- 1 root root 674628 May 16 08:55 iwlwifi-7260-8.ucode

-rw-r--r-- 1 root root 679380 May 22 17:51 iwlwifi-7260-9.ucode

xps13 linux # lspci -v | grep -A 14 7260 

02:00.0 Network controller: Intel Corporation Wireless 7260 (rev 6b)

   Subsystem: Intel Corporation Dual Band Wireless-AC 7260

   Flags: bus master, fast devsel, latency 0, IRQ 58

   Memory at f0400000 (64-bit, non-prefetchable) [size=8K]

   Capabilities: [c8] Power Management version 3

   Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+

   Capabilities: [40] Express Endpoint, MSI 00

   Capabilities: [100] Advanced Error Reporting

   Capabilities: [140] Device Serial Number 5c-51-4f-ff-ff-7d-1e-c3

   Capabilities: [14c] Latency Tolerance Reporting

   Capabilities: [154] Vendor Specific Information: ID=cafe Rev=1 Len=014 <?>

   Kernel driver in use: iwlwifi

xps13 linux # dmesg | grep iwlwifi

[    2.613752] iwlwifi 0000:02:00.0: irq 58 for MSI/MSI-X

[    2.613858] iwlwifi 0000:02:00.0: Direct firmware load failed with error -2

[    2.613899] iwlwifi 0000:02:00.0: Falling back to user helper

[    4.354019] iwlwifi 0000:02:00.0: loaded firmware version 23.214.9.0 op_mode iwlmvm

[    4.354028] iwlwifi 0000:02:00.0: Detected Intel(R) Dual Band Wireless AC 7260, REV=0x144

[    4.354102] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S

[    4.354603] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S

xps13 linux #
```

The dump above is triggered at line 368 in drivers/net/wireless/iwlwifi/mvm/fw.c:

```
        /*

         * If we haven't completed the run of the init ucode during

         * module loading, load init ucode now

         * (for example, if we were in RFKILL)

         */

        if (!mvm->init_ucode_complete) {

                ret = iwl_run_init_mvm_ucode(mvm, false);

                if (ret && !iwlmvm_mod_params.init_dbg) {

                        IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", ret);

                        /* this can't happen */

--->                    if (WARN_ON(ret > 0))         <--- line 368

                                ret = -ERFKILL;

                        goto error;

                }

                ...
```

Apparently, this error should not happen at all.

Anyone else seeing this? Any ideas? Thanks.Last edited by Barnoid on Mon Jun 02, 2014 6:41 pm; edited 1 time in total

----------

## Pearlseattle

Hi

Maybe try to compile & load iwlwifi as a module - sounds weird but it wouldn't be the first time that problems arise because of some weird timing issues related to when the module resp. the firmware is loaded.

In my case I have a 7260 (in a Lenovo Yoga) and it seems to be working:

- Kernel gentoo-sources-3.14.2 (ok, for some reason now it's hard masked)

- iwlwifi running as a module

- firmware "iwlwifi-7260-8.ucode" (iwlwifi-7260-ucode-22.24.8.0.tar)

- I have blacklisted the modules iwlwifi & iwlmvm in "/etc/modprobe.d/blacklist.conf" and have added in "/etc/conf.d/modules" the following:

```
modules="fuse rfkill thinkpad_acpi iwlwifi kvm-intel"

module_iwlwifi_args="11n_disable=1 bt_coex_active=0 debug=0 fw_restart=0 led_mode=3 power_level=5 power_save=1 swcrypto=1 wd_disable=1"
```

- I am using "wicd"

Other general infos:

```
# uname -a 

Linux yoga 3.14.2-gentoo #5 SMP PREEMPT Tue May 27 00:23:33 CEST 2014 x86_64 Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz GenuineIntel GNU/Linux

# ls -l /lib/firmware/ 

total 672

-rw-r--r-- 1 root root 679780 May 15 20:23 iwlwifi-7260-8.ucode

# lspci -v | grep -A 14 7260 

04:00.0 Network controller: Intel Corporation Wireless 7260 (rev 83)

   Subsystem: Intel Corporation Dual Band Wireless-AC 7260

   Flags: bus master, fast devsel, latency 0, IRQ 61

   Memory at f0500000 (64-bit, non-prefetchable) [size=8K]

   Capabilities: [c8] Power Management version 3

   Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+

   Capabilities: [40] Express Endpoint, MSI 00

   Capabilities: [100] Advanced Error Reporting

   Capabilities: [140] Device Serial Number ac-7b-a1-ab-cd-4c-8b-2d

   Capabilities: [14c] Latency Tolerance Reporting

   Capabilities: [154] Vendor Specific Information: ID=cafe Rev=1 Len=014 <?>

   Kernel driver in use: iwlwifi

   Kernel modules: iwlwifi      

# dmesg | grep iwlwifi 

[    4.847529] iwlwifi 0000:04:00.0: irq 61 for MSI/MSI-X

[    4.849103] iwlwifi 0000:04:00.0: Direct firmware load failed with error -2

[    4.849112] iwlwifi 0000:04:00.0: Falling back to user helper

[    4.853824] iwlwifi 0000:04:00.0: loaded firmware version 22.24.8.0 op_mode iwlmvm

[    4.867022] iwlwifi 0000:04:00.0: Detected Intel(R) Dual Band Wireless AC 7260, REV=0x144

[    4.867104] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S

[    4.867348] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S

[    5.053163] iwlwifi 0000:04:00.0: Led disabled

[    6.507143] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S

[    6.507438] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S

[   15.763433] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S

[   15.763676] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S

[   15.802068] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S

[   15.802313] iwlwifi 0000:04:00.0: L1 Enabled; Disabling L0S
```

----------

## Barnoid

@Pearlseattle: thanks for the tip. I have tried to load the module manually but with no success.

However, with the newest (at the time of this writing unstable) nm-applet (0.9.8.10-r1) the problem went away. It seems that this was a bug introduced in 0.9.8.8-r2 and got fixed in 0.9.8.10. I am not sure why the downgrade didn't work but too lazy to investigate any further. 

For anyone else seeing this: avoid nm-applet-0.9.8.8-r2.

----------

## Pearlseattle

Eeehhhh, congratulations!   :Very Happy: 

----------

