openwrt / openwrt/mt76

kernel lock debugging reports suspicious RCU usage

Open
#523 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
888
Forks
436
PR merge metrics
No merged PRs in 30d

Description

On MT7622 running in station mode, I'm seeing this on association with AP:

[  121.868215] wlan1: authenticated
[  121.876029] wlan1: associate with xx:xx:xx:xx:xx:xx (try 1/3)
[  121.898810] wlan1: RX AssocResp from xx:xx:xx:xx:xx:xx (capab=0x411 status=0 aid=5)
[  121.909127] 
[  121.910811] =============================
[  121.914972] WARNING: suspicious RCU usage
[  121.919193] 5.10.28 #0 Tainted: G S               
[  121.924072] -----------------------------
[  121.928170] target-aarch64_cortex-a53_musl/linux-mediatek_mt7622/mt76-2021-04-11-bf45b30d/mt7615/main.c:675 suspicious rcu_dereference_check() usage!
[  121.941659] 
[  121.941659] other info that might help us debug this:
[  121.941659] 
[  121.949770] 
[  121.949770] rcu_scheduler_active = 2, debug_locks = 1
[  121.956382] 4 locks held by kworker/u4:3/260:
[  121.960830]  #0: ffffff8003e00d38 ((wq_completion)phy1){+.+.}-{0:0}, at: process_one_work+0x1f8/0x6a8
[  121.970249]  #1: ffffffc011f4bdd8 ((work_completion)(&sdata->work)){+.+.}-{0:0}, at: process_one_work+0x1f8/0x6a8
[  121.980679]  #2: ffffff8006590c40 (&wdev->mtx){+.+.}-{3:3}, at: ieee80211_sta_rx_queued_mgmt+0x3c/0x7b0 [mac80211]
[  121.991429]  #3: ffffff8006199d10 (&local->sta_mtx){+.+.}-{3:3}, at: cleanup_module+0x91c/0x22cc [mac80211]
[  122.001459] 
[  122.001459] stack backtrace:
[  122.005917] CPU: 1 PID: 260 Comm: kworker/u4:3 Tainted: G S                5.10.28 #0
[  122.013759] Hardware name: Bananapi BPI-R64 (DT)
[  122.018448] Workqueue: phy1 ieee80211_ibss_leave [mac80211]
[  122.024039] Call trace:
[  122.026499]  dump_backtrace+0x0/0x1a8
[  122.030167]  show_stack+0x14/0x20
[  122.033490]  dump_stack+0xec/0x134
[  122.036897]  lockdep_rcu_suspicious+0xcc/0xdc
[  122.041269]  mt7615_mac_sta_remove+0xbc8/0x1ce8 [mt7615_common]
[  122.047234]  drv_sta_state+0x400/0xbc8 [mac80211]
[  122.051980]  sta_info_move_state+0x1a0/0x2c8 [mac80211]
[  122.057243]  cleanup_module+0xad8/0x22cc [mac80211]
[  122.062158]  ieee80211_recalc_ps_vif+0x1c7c/0x1d20 [mac80211]
[  122.067941]  ieee80211_sta_rx_queued_mgmt+0x2b8/0x7b0 [mac80211]
[  122.073984]  ieee80211_ibss_leave+0xc2c/0x1b78 [mac80211]
[  122.079390]  process_one_work+0x2a0/0x6a8
[  122.083405]  worker_thread+0x40/0x430
[  122.087074]  kthread+0x138/0x140
[  122.090308]  ret_from_fork+0x10/0x18
[  122.095848] wlan1: associated

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with main.c:675 and the mt7615_mac_sta_remove() call in the provided trace. Reproduce association on an MT7622 in station mode and inspect the surrounding RCU and lock context. Done means the suspicious RCU warning no longer appears during association without regressing the connection.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.