Disconnecting randomly from WiFi

We are using JetPack 3.3 with TX1 with custom carrier board.
And this disconnect randomly from WiFi.

Our first try was restarting NM and activate WiFi connection by running below commands when disconnected.

# systemctl restart NetworkManager
# nmcli device wifi connect $ssid password $psk ifname wlan0

But this sometimes not work. The message of these commands result was like this.

Note: The ESSID and BSSID is replaced for xxxxxxxxxxx and xx:xx:xx:xx:xx:xx.

Passwords or encryption keys are required to access the wireless network 'xxxxxxxxxxx'.
Warning: password for '802-11-wireless-security.psk' not given in 'passwd-file' and nmcli cannot ask without '--ask' option.
Error: Connection activation failed.

And at the same time, below message was appeared on dmesg.

[17982.145655] WLC_E_IF: NO_IF set, event Ignored
[17982.181402] CFGP2P-ERROR) wl_cfgp2p_del_p2p_disc_if : P2P interface unregistered
[17982.633042] IPVS: Creating netns size=1424 id=5
[17982.832295] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[17983.065304] CFGP2P-ERROR) wl_cfgp2p_add_p2p_disc_if : P2P interface registered
[17983.107606] WLC_E_IF: NO_IF set, event Ignored
[17986.369079] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_LINK
[17986.375991] CFG80211-ERROR) wl_notify_connect_status : link down if wlan0 may call cfg80211_disconnected. event : 16, reason=2 from xx:xx:xx:xx:xx:xx
[17986.396429] CFG80211-ERROR) wl_cfg80211_connect : Connectting withxx:xx:xx:xx:xx:xx channel (44) ssid "xxxxxxxxxxx", len (11)
[17986.396429] 
[17986.442346] CFG80211-ERROR) wl_notify_connect_status : wl_bss_connect_done succeeded with xx:xx:xx:xx:xx:xx
[17986.469199] ------------[ cut here ]------------
[17986.473815] WARNING: at /home/user/work/jetpack3.3/Linux_for_Tegra/sources_merge/kernel/kernel-4.4/net/wireless/sme.c:714
[17986.484747] Modules linked in: v4l2loopback(O) bcmdhd bluedroid_pm
[17986.490944] 
[17986.492431] CPU: 3 PID: 15977 Comm: kworker/u8:2 Tainted: G        W  O    4.4.38 #69
[17986.500244] Hardware name: jetson_tx1 (DT)
[17986.504336] Workqueue: cfg80211 cfg80211_event_work
[17986.509208] task: ffffffc0caed0000 ti: ffffffc00f9c0000 task.ti: ffffffc00f9c0000
[17986.516675] PC is at __cfg80211_connect_result+0x260/0x2f8
[17986.522146] LR is at __cfg80211_connect_result+0x1a8/0x2f8
[17986.527617] pc : [<ffffffc000b0a300>] lr : [<ffffffc000b0a248>] pstate: 40000145
[17986.534996] sp : ffffffc00f9c3c50
[17986.538300] x29: ffffffc00f9c3c60 x28: 000000000000007f 
[17986.543612] x27: 0000000000000001 x26: 0000000000000083 
[17986.548924] x25: ffffffc00a8d1648 x24: ffffffc00a8d16c7 
[17986.554238] x23: ffffffc00a8d1618 x22: ffffffc0f4fe9000 
[17986.559552] x21: 0000000000000000 x20: 0000000000000000 
[17986.564863] x19: ffffffc0f4e9e000 x18: 0000007f59ed2ea0 
[17986.570174] x17: 0000007faac2f1d8 x16: 0000000000000001 
[17986.575485] x15: 0000000000000002 x14: 1004087f00000000 
[17986.580798] x13: 0000000000000000 x12: 0000000000000028 
[17986.586109] x11: 0101010101010101 x10: 0000000000000001 
[17986.591420] x9 : 0000000000000010 x8 : ffffffbffc09ca30 
[17986.596731] x7 : ffffffc0ffe9d718 x6 : 0000000000000002 
[17986.602042] x5 : 00000000fffffffe x4 : 0000000000000000 
[17986.607354] x3 : ffffffc0014e1700 x2 : ffffffc00f9c3ba0 
[17986.612665] x1 : 0000000000000000 x0 : 0000000000000000 
[17986.617977] 
[17986.619626] ---[ end trace 396e2c88a5b8d7ed ]---
[17986.624232] Call trace:
[17986.626672] [<ffffffc000b0a300>] __cfg80211_connect_result+0x260/0x2f8
[17986.633186] [<ffffffc000ae227c>] cfg80211_process_wdev_events+0xe8/0x1a8
[17986.639872] [<ffffffc000ae2388>] cfg80211_process_rdev_events+0x4c/0x68
[17986.646471] [<ffffffc000adce10>] cfg80211_event_work+0x1c/0x28
[17986.652292] [<ffffffc0000ba7c0>] process_one_work+0x234/0x45c
[17986.658024] [<ffffffc0000bac30>] worker_thread+0x248/0x428
[17986.663497] [<ffffffc0000c0888>] kthread+0xf8/0x100
[17986.668362] [<ffffffc0000847a0>] ret_from_fork+0x10/0x30
[17986.674427] CFG80211-ERROR) wl_bss_connect_done : Report connect result - connection succeeded
[17986.682163] cfg80211: World regulatory domain updated:
[17986.682167] cfg80211:  DFS Master region: unset
[17986.682167] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[17986.682171] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[17986.682173] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[17986.682175] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[17986.682177] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[17986.682180] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[17986.682182] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[17986.682184] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[17986.682186] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[17986.692267] cfg80211: World regulatory domain updated:
[17986.692272] cfg80211:  DFS Master region: unset
[17986.692272] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[17986.692276] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[17986.692278] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[17986.692280] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[17986.692283] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[17986.692285] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[17986.692287] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[17986.692289] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[17986.692291] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[17986.862039] CFG80211-ERROR) wl_notify_connect_status : wl_bss_connect_done succeeded with xx:xx:xx:xx:xx:xx
[17996.310766] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_LINK
[17996.319542] CFG80211-ERROR) wl_notify_connect_status : link down if wlan0 may call cfg80211_disconnected. event : 16, reason=2 from xx:xx:xx:xx:xx:xx
[17996.356961] CFG80211-ERROR) wl_cfg80211_connect : Connectting withxx:xx:xx:xx:xx:xx channel (44) ssid "xxxxxxxxxxx", len (11)
[17996.356961] 
[17996.403479] CFG80211-ERROR) wl_notify_connect_status : wl_bss_connect_done succeeded with xx:xx:xx:xx:xx:xx
[17996.437347] cfg80211: World regulatory domain updated:
[17996.441545] CFG80211-ERROR) wl_bss_connect_done : Report connect result - connection succeeded
[17996.473225] cfg80211:  DFS Master region: unset
[17996.483706] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[17996.486477] CFG80211-ERROR) wl_notify_connect_status : wl_bss_connect_done succeeded with xx:xx:xx:xx:xx:xx
[17996.541154] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[17996.562291] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[17996.584053] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[17996.602803] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[17996.626020] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[17996.646009] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[17996.670880] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[17996.698026] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[17996.737049] ------------[ cut here ]------------
[17996.741669] WARNING: at /home/user/work/jetpack3.3/Linux_for_Tegra/sources_merge/kernel/kernel-4.4/net/wireless/sme.c:714
[17996.752603] Modules linked in: v4l2loopback(O) bcmdhd bluedroid_pm
[17996.758802] 
[17996.760292] CPU: 3 PID: 22935 Comm: kworker/u8:4 Tainted: G        W  O    4.4.38 #69
[17996.768104] Hardware name: jetson_tx1 (DT)
[17996.772196] Workqueue: cfg80211 cfg80211_event_work
[17996.777069] task: ffffffc061221900 ti: ffffffc06ea74000 task.ti: ffffffc06ea74000
[17996.784538] PC is at __cfg80211_connect_result+0x260/0x2f8
[17996.790014] LR is at __cfg80211_connect_result+0x1a8/0x2f8
[17996.795492] pc : [<ffffffc000b0a300>] lr : [<ffffffc000b0a248>] pstate: 40000145
[17996.802871] sp : ffffffc06ea77c50
[17996.806177] x29: ffffffc06ea77c60 x28: 000000000000007f 
[17996.811492] x27: 0000000000000001 x26: 0000000000000083 
[17996.816809] x25: ffffffc08ad2fa48 x24: ffffffc08ad2fac7 
[17996.822124] x23: ffffffc08ad2fa18 x22: ffffffc0f4fe9000 
[17996.827438] x21: 0000000000000000 x20: 0000000000000000 
[17996.832753] x19: ffffffc0f4e9e000 x18: 0000000000000000 
[17996.838067] x17: 0000007f4c049ea0 x16: 0000000000001151 
[17996.843380] x15: 000000000000187e x14: 1004087f00000000 
[17996.848695] x13: 0000000000000000 x12: 0000000000000028 
[17996.854009] x11: 0101010101010101 x10: 0000000000000001 
[17996.859322] x9 : 0000000000000010 x8 : ffffffbffc09ca30 
[17996.864637] x7 : 4e7c8caccbe20001 x6 : 0000000000000002 
[17996.869954] x5 : 00000000fffffffe x4 : 0000000000000000 
[17996.875269] x3 : ffffffc0014e1700 x2 : ffffffc06ea77ba0 
[17996.880586] x1 : 0000000000000000 x0 : 0000000000000000 
[17996.885901] 
[17996.887757] ---[ end trace 396e2c88a5b8d7ee ]---
[17996.892372] Call trace:
[17996.894827] [<ffffffc000b0a300>] __cfg80211_connect_result+0x260/0x2f8
[17996.901343] [<ffffffc000ae227c>] cfg80211_process_wdev_events+0xe8/0x1a8
[17996.908037] [<ffffffc000ae2388>] cfg80211_process_rdev_events+0x4c/0x68
[17996.914643] [<ffffffc000adce10>] cfg80211_event_work+0x1c/0x28
[17996.920471] [<ffffffc0000ba7c0>] process_one_work+0x234/0x45c
[17996.926208] [<ffffffc0000bac30>] worker_thread+0x248/0x428
[17996.931687] [<ffffffc0000c0888>] kthread+0xf8/0x100
[17996.936561] [<ffffffc0000847a0>] ret_from_fork+0x10/0x30
[17996.957331] cfg80211: World regulatory domain updated:
[17996.964804] cfg80211:  DFS Master region: unset
[17996.972771] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[17996.993306] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[17997.003430] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[17997.011507] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[17997.019719] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[17997.029402] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[17997.060017] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[17997.070083] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[17997.078133] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)

Our second try is applying this patch and replace bcmdhd module.
https://devtalk.nvidia.com/default/topic/1047138/jetson-tx1/wifi-disconnect-problem-on-jetpack-3-3/post/5314700/#5314700

But after this try, sometimes occurs Kernel Oops at boot.
So we think this not true solution.

[    9.456315] Dongle Host Driver, version 1.201.82 (r)
[    9.456315] Compiled in drivers/net/wireless/bcmdhd on Sep  2 2019 at 11:52:09
[    9.474849] wl_android_wifi_on in
[    9.478958] wifi_platform_set_power = 1
[    9.649384] tegradc tegradc.1: blank - powerdown
[    9.755992] mmc1: queuing unknown CIS tuple 0x80 (5 bytes)
[    9.834285] sdhci-tegra sdhci-tegra.1: Tuning already done, restoring the best tap value : 47
[    9.843690] F1 signature read @0x18000000=0x17214354
[    9.853815] F1 signature OK, socitype:0x1 chip:0x4354 rev:0x1 pkg:0x2
[    9.861056] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000
[    9.927091] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[    9.996251] dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)
[   10.002860] wifi_platform_get_mac_addr
[   10.008250] Firmware up: op_mode=0x0005, MAC=00:04:4b:be:fd:85
[   10.020072] dhd_preinit_ioctls pspretend_threshold for HostAPD failed  -23
[   10.032604] Firmware version = wl0: Dec 12 2017 15:09:35 version 7.35.221.34 (r679642) FWID 01-8f1f4763
[   10.045435] dhd_interworking_enable: failed to set WNM info, ret=-23
[   10.052047] tegra_sysfs_on
[   10.105586] Unable to handle kernel paging request at virtual address d503201fd65f0540
[   10.113674] pgd = ffffffc078a2a000
[   10.117221] [d503201fd65f0540] *pgd=0000000000000000, *pud=0000000000000000
[   10.124400] Internal error: Oops: 96000044 [#1] PREEMPT SMP
[   10.129961] Modules linked in: bcmdhd bluedroid_pm
[   10.134764] CPU: 1 PID: 726 Comm: NetworkManager Not tainted 4.4.38 #69
[   10.141362] Hardware name: jetson_tx1 (DT)
[   10.145448] task: ffffffc0f1211900 ti: ffffffc0f0264000 task.ti: ffffffc0f0264000
[   10.152920] PC is at cfg80211_mgd_wext_connect+0x74/0x148
[   10.158307] LR is at cfg80211_mgd_wext_connect+0x1c/0x148
[   10.163692] pc : [<ffffffc000b22ca0>] lr : [<ffffffc000b22c48>] pstate: a0000145
[   10.171070] sp : ffffffc0f02675f0
[   10.174375] x29: ffffffc0f02675f0 x28: 0000000000000000 
[   10.179690] x27: 0000000000000000 x26: ffffffc07cf4ae10 
[   10.185003] x25: ffffffbffc09ac58 x24: ffffffc0f0267a88 
[   10.190316] x23: ffffffc0f46f5e48 x22: ffffffc07b874000 
[   10.195629] x21: ffffffc07a6e0000 x20: ffffffc07a6e02c0 
[   10.200943] x19: ffffffc0f46f5e00 x18: ffffffc000bbecd8 
[   10.206256] x17: 000000000000000e x16: 0000000000000007 
[   10.211568] x15: 0000000000000001 x14: 0000000000000000 
[   10.216881] x13: 0000000000000000 x12: 0000000000000000 
[   10.222194] x11: 0000000000000000 x10: 0000000000000000 
[   10.227508] x9 : 0000000000000000 x8 : 0000000000000000 
[   10.232822] x7 : ffffffc0f01a7b18 x6 : ffffffc0efd56a88 
[   10.238134] x5 : ffffffc000fafbb8 x4 : ffffffc0f02675c0 
[   10.243446] x3 : 0000000000000000 x2 : ffffffbffc09b268 
[   10.248760] x1 : d503201fd65f03c0 x0 : 00000000ffffffff 
[   10.254073] 
[   10.255558] Process NetworkManager (pid: 726, stack limit = 0xffffffc0f0264020)
[   10.262851] Call trace:
[   10.265291] [<ffffffc000b22ca0>] cfg80211_mgd_wext_connect+0x74/0x148
[   10.271720] [<ffffffc000adee78>] cfg80211_netdev_notifier_call+0x27c/0x564
[   10.278582] [<ffffffc0000c1380>] notifier_call_chain+0x48/0x88
[   10.284401] [<ffffffc0000c1478>] raw_notifier_call_chain+0x14/0x1c
[   10.290569] [<ffffffc000966a30>] call_netdevice_notifiers_info+0x5c/0x6c
[   10.297256] [<ffffffc00096f0a4>] __dev_notify_flags+0x4c/0x9c
[   10.302989] [<ffffffc00096f7e8>] dev_change_flags+0x48/0x5c
[   10.308549] [<ffffffc00097e560>] do_setlink+0x2b4/0x900
[   10.313761] [<ffffffc00097f014>] rtnl_newlink+0x37c/0x6cc
[   10.319147] [<ffffffc00097f580>] rtnetlink_rcv_msg+0x1b8/0x1f8
[   10.324966] [<ffffffc0009a0b28>] netlink_rcv_skb+0x80/0xe8
[   10.330438] [<ffffffc00097f3b8>] rtnetlink_rcv+0x2c/0x3c
[   10.335738] [<ffffffc0009a048c>] netlink_unicast+0x130/0x20c
[   10.341384] [<ffffffc0009a08e0>] netlink_sendmsg+0x2c8/0x354
[   10.347031] [<ffffffc00094fc6c>] sock_sendmsg+0x38/0x50
[   10.352245] [<ffffffc000951054>] ___sys_sendmsg+0x224/0x248
[   10.357804] [<ffffffc000951e6c>] __sys_sendmsg+0x40/0x70
[   10.363103] [<ffffffc000951eac>] SyS_sendmsg+0x10/0x20
[   10.368231] [<ffffffc0000847f0>] el0_svc_naked+0x24/0x28
[   10.373698] ---[ end trace 4ef00a8e7db388f3 ]---
[   23.939272] l4tbr0: port 2(usb1) entered forwarding state

What is the true solution of disconnect problem?

Hi n.tazawa,

Would you mind moving to rel-28.3 and rel-32.2.1 to test the wifi functionality?
If it still gets such problem, please let me know.