# 4.19 iwlwifi bug

## Mountain mystic

Hi guys, just wanted to see if anyone has this issue before posting it to upstream:

Connection is ok,  unable to reproduce.

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1774099 may be of intrest

```

[57823.560802] wlp3s0: send auth to 20:a6:cd:39:9a:b1 (try 1/3)

[57823.605982] wlp3s0: send auth to 20:a6:cd:39:9a:b1 (try 2/3)

[57823.660857] wlp3s0: send auth to 20:a6:cd:39:9a:b1 (try 3/3)

[57823.707466] wlp3s0: authentication with 20:a6:cd:39:9a:b1 timed out

[57826.542052] wlp3s0: authenticate with ac:a3:1e:85:94:22

[57826.546409] wlp3s0: send auth to ac:a3:1e:85:94:22 (try 1/3)

[57826.548809] wlp3s0: authenticated

[57826.549483] wlp3s0: associate with ac:a3:1e:85:94:22 (try 1/3)

[57826.630473] wlp3s0: RX AssocResp from ac:a3:1e:85:94:22 (capab=0x431 status=0 aid=74)

[57826.631552] wlp3s0: associated

[57831.788373] BUG: scheduling while atomic: irq/45-iwlwifi/97/0x00000400

[57831.788381] CPU: 2 PID: 97 Comm: irq/45-iwlwifi Tainted: G                T 4.19.0-gentoo #1

[57831.788383] Hardware name: LENOVO 20AQ005TUS/20AQ005TUS, BIOS GJET86WW (2.36 ) 12/04/2015

[57831.788385] Call Trace:

[57831.788401]  dump_stack+0x46/0x5b

[57831.788410]  __schedule_bug+0x41/0x60

[57831.788418]  __schedule+0x532/0x6d0

[57831.788428]  ? lock_timer_base+0x99/0x160

[57831.788433]  schedule+0x23/0x70

[57831.788439]  schedule_timeout+0x16b/0x400

[57831.788445]  ? collect_expired_timers+0xe0/0xe0

[57831.788452]  iwl_trans_pcie_send_hcmd+0x2b3/0x480

[57831.788461]  ? __wake_up_common_lock+0xb0/0xb0

[57831.788468]  iwl_trans_send_cmd+0x84/0x100

[57831.788475]  iwl_mvm_send_cmd+0x1e/0x70

[57831.788481]  iwl_mvm_send_lq_cmd+0x75/0xa0

[57831.788487]  ? iwl_mvm_rs_rate_init+0x7d2/0x1010

[57831.788491]  iwl_mvm_rs_rate_init+0x7d2/0x1010

[57831.788496]  iwl_mvm_rs_tx_status+0x13e/0x2350

[57831.788504]  ? dma_pte_clear_level+0x184/0x370

[57831.788512]  rate_control_tx_status+0x99/0xa0

[57831.788518]  __ieee80211_tx_status+0x289/0x950

[57831.788525]  ? del_timer+0x4d/0x70

[57831.788529]  ieee80211_tx_status+0x7c/0xc0

[57831.788536]  iwl_mvm_rx_tx_cmd+0x304/0x7a0

[57831.788542]  ? iwl_pcie_gen2_tx_init+0x120/0x120

[57831.788546]  iwl_pcie_rx_handle+0x264/0x9b0

[57831.788553]  ? __switch_to_asm+0x40/0x70

[57831.788557]  iwl_pcie_irq_handler+0x1a1/0x7a0

[57831.788564]  ? irq_forced_thread_fn+0x60/0x60

[57831.788569]  irq_thread_fn+0x1c/0x50

[57831.788575]  irq_thread+0xee/0x190

[57831.788580]  ? wake_threads_waitq+0x30/0x30

[57831.788585]  ? irq_thread_dtor+0x90/0x90

[57831.788591]  kthread+0x109/0x120

[57831.788597]  ? __kthread_create_on_node+0x180/0x180

[57831.788602]  ret_from_fork+0x35/0x40

[57831.788651] NOHZ: local_softirq_pending 82

[57831.788934] NOHZ: local_softirq_pending 82

[57831.789196] NOHZ: local_softirq_pending 82

[57833.798461] iwlwifi 0000:03:00.0: Error sending LQ_CMD: time out after 2000ms.

[57833.798466] iwlwifi 0000:03:00.0: Current CMD queue read_ptr 26 write_ptr 27

[57833.798723] iwlwifi 0000:03:00.0: Loaded firmware version: 17.3216344376.0

[57833.798727] iwlwifi 0000:03:00.0: 0x00000000 | ADVANCED_SYSASSERT          

[57833.798729] iwlwifi 0000:03:00.0: 0x00000000 | trm_hw_status0

[57833.798732] iwlwifi 0000:03:00.0: 0x00000000 | trm_hw_status1

[57833.798735] iwlwifi 0000:03:00.0: 0x00000B30 | branchlink2

[57833.798738] iwlwifi 0000:03:00.0: 0x000164C0 | interruptlink1

[57833.798741] iwlwifi 0000:03:00.0: 0x000001DA | interruptlink2

[57833.798743] iwlwifi 0000:03:00.0: 0x00000000 | data1

[57833.798746] iwlwifi 0000:03:00.0: 0x00000080 | data2

[57833.798749] iwlwifi 0000:03:00.0: 0x07030000 | data3

[57833.798751] iwlwifi 0000:03:00.0: 0x12C06AD8 | beacon time

[57833.798754] iwlwifi 0000:03:00.0: 0x80BA46E0 | tsf low

[57833.798756] iwlwifi 0000:03:00.0: 0x00000000 | tsf hi

[57833.798759] iwlwifi 0000:03:00.0: 0x00000000 | time gp1

[57833.798761] iwlwifi 0000:03:00.0: 0x76C532A2 | time gp2

[57833.798764] iwlwifi 0000:03:00.0: 0x00000000 | uCode revision type

[57833.798766] iwlwifi 0000:03:00.0: 0x00000011 | uCode version major

[57833.798769] iwlwifi 0000:03:00.0: 0xBFB58538 | uCode version minor

[57833.798772] iwlwifi 0000:03:00.0: 0x00000144 | hw version

[57833.798774] iwlwifi 0000:03:00.0: 0x40489204 | board version

[57833.798777] iwlwifi 0000:03:00.0: 0x001A014E | hcmd

[57833.798779] iwlwifi 0000:03:00.0: 0x24022000 | isr0

[57833.798782] iwlwifi 0000:03:00.0: 0x00800000 | isr1

[57833.798784] iwlwifi 0000:03:00.0: 0x00000002 | isr2

[57833.798787] iwlwifi 0000:03:00.0: 0x404170C0 | isr3

[57833.798789] iwlwifi 0000:03:00.0: 0x00000000 | isr4

[57833.798792] iwlwifi 0000:03:00.0: 0x00800110 | last cmd Id

[57833.798794] iwlwifi 0000:03:00.0: 0x00000000 | wait_event

[57833.798797] iwlwifi 0000:03:00.0: 0x00000AC8 | l2p_control

[57833.798800] iwlwifi 0000:03:00.0: 0x00010030 | l2p_duration

[57833.798802] iwlwifi 0000:03:00.0: 0x000000BF | l2p_mhvalid

[57833.798805] iwlwifi 0000:03:00.0: 0x0000002E | l2p_addr_match

[57833.798808] iwlwifi 0000:03:00.0: 0x00000005 | lmpm_pmg_sel

[57833.798811] iwlwifi 0000:03:00.0: 0x15041745 | timestamp

[57833.798813] iwlwifi 0000:03:00.0: 0x0034B0C0 | flow_handler

[57833.798817] ieee80211 phy0: Hardware restart was requested

[57833.798852] WARNING: CPU: 2 PID: 97 at kernel/softirq.c:168 __local_bh_enable_ip+0x3d/0x80

[57833.798857] CPU: 2 PID: 97 Comm: irq/45-iwlwifi Tainted: G        W       T 4.19.0-gentoo #1

[57833.798859] Hardware name: LENOVO 20AQ005TUS/20AQ005TUS, BIOS GJET86WW (2.36 ) 12/04/2015

[57833.798863] RIP: 0010:__local_bh_enable_ip+0x3d/0x80

[57833.798867] Code: 5c b1 69 83 ee 01 89 f3 f7 db 70 44 65 01 1d fa 5b b1 69 65 8b 05 f3 5b b1 69 a9 00 ff 1f 00 74 0d 65 ff 0d e5 5b b1 69 5b c3 <0f> 0b eb ce 65 66 8b 05 07 fe b1 69 66 85 c0 74 e6 65 8b 05 cb 5b

[57833.798869] RSP: 0018:ffff9d3c424bbe50 EFLAGS: 00010206

[57833.798873] RAX: 000000007ffffe00 RBX: ffff9c02ac690018 RCX: 00000000000000ff

[57833.798876] RDX: 0000000000000000 RSI: 0000000000000200 RDI: ffffffff96b1f835

[57833.798878] RBP: ffff9c02ac698ff4 R08: ffff9c02ac7e6000 R09: 0000000000000002

[57833.798880] R10: 00000000000ffac5 R11: 0000000000169c1d R12: 0000000080000008

[57833.798882] R13: 0000000080000000 R14: 0000000080000000 R15: 0000000000000000

[57833.798886] FS:  0000000000000000(0000) GS:ffff9c02b2500000(0000) knlGS:0000000000000000

[57833.798888] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033

[57833.798891] CR2: 00002cdedd7f0020 CR3: 0000000173c0a004 CR4: 00000000001606e0

[57833.798892] Call Trace:

[57833.798900]  iwl_pcie_irq_handler+0x1b2/0x7a0

[57833.798906]  ? irq_forced_thread_fn+0x60/0x60

[57833.798910]  irq_thread_fn+0x1c/0x50

[57833.798914]  irq_thread+0xee/0x190

[57833.798919]  ? wake_threads_waitq+0x30/0x30

[57833.798922]  ? irq_thread_dtor+0x90/0x90

[57833.798927]  kthread+0x109/0x120

[57833.798931]  ? __kthread_create_on_node+0x180/0x180

[57833.798937]  ret_from_fork+0x35/0x40

[57833.798940] ---[ end trace c0f54cf9cf1e1296 ]---

[57833.798944] BUG: scheduling while atomic: irq/45-iwlwifi/97/0x7ffffc00

[57833.798948] CPU: 2 PID: 97 Comm: irq/45-iwlwifi Tainted: G        W       T 4.19.0-gentoo #1

[57833.798949] Hardware name: LENOVO 20AQ005TUS/20AQ005TUS, BIOS GJET86WW (2.36 ) 12/04/2015

[57833.798950] Call Trace:

[57833.798957]  dump_stack+0x46/0x5b

[57833.798962]  __schedule_bug+0x41/0x60

[57833.798965]  __schedule+0x532/0x6d0

[57833.798969]  ? irq_forced_thread_fn+0x60/0x60

[57833.798972]  schedule+0x23/0x70

[57833.798975]  irq_thread+0x9e/0x190

[57833.798979]  ? wake_threads_waitq+0x30/0x30

[57833.798982]  ? irq_thread_dtor+0x90/0x90

[57833.798985]  kthread+0x109/0x120

[57833.798989]  ? __kthread_create_on_node+0x180/0x180

[57833.798993]  ret_from_fork+0x35/0x40

[57833.799109] iwlwifi 0000:03:00.0: Microcode SW error detected.  Restarting 0x92000000.

[57833.799155] iwlwifi 0000:03:00.0: HCMD_ACTIVE already clear for command LQ_CMD

```

----------

## bunder

I've seen "scheduling while atomic" before on zfs, I wonder if iwlwifi needs a similar fix...

https://github.com/zfsonlinux/zfs/pull/8150

I haven't seen this message though from iwlwifi.  5 seconds after associating you might still be in the dhcp phase, so I'm not sure what kind of traffic you would be passing at that time.

----------

## Mountain mystic

I honestly have no idea. I built this system on JFS as a test.  

Could this be related?

```
[23882.302038] wlp3s0: cannot understand ECSA IE operating class, 0, ignoring

[23882.909375] iwlwifi 0000:03:00.0: No beacon heard and the time event is over already...

[23882.909432] wlp3s0: Connection to AP 20:a6:cd:39:c1:01 lost

[23884.917635] iwlwifi 0000:03:00.0: fail to flush all tx fifo queues Q 5

[23884.918471] iwlwifi 0000:03:00.0: Queue 5 is active on fifo 3 and stuck for 10000 ms. SW [12, 13] HW [12, 13] FH TRB=0x08030500c

```

Edit: Did some googling

----------

