2014-02-17 23:57:59

by Ben Greear

[permalink] [raw]
Subject: lockdep warning (needs annotation)

I started seeing this today after synch-ing with upstream
ath10k tree.

Firmware is modified, and there are some patches to ath10k in my
tree, but probably nothing that affects this.


INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 1 PID: 213 Comm: kworker/u8:2 Tainted: G C 3.14.0-rc2-wl-ath+ #11
Hardware name: To be filled by O.E.M. To be filled by O.E.M./HURONRIVER, BIOS 4.6.5 05/02/2012
Workqueue: phy0 ieee80211_iface_work [mac80211]
0000000000000000 ffff88020fd777e8 ffffffff815d0007 0000000000000006
0000000000000000 ffff88020fd77868 ffffffff810fb81e ffff88020fd77818
ffffffff00000000 ffff880200000001 0000000000000002 0000000000000000
Call Trace:
[<ffffffff815d0007>] dump_stack+0x4e/0x71
[<ffffffff810fb81e>] register_lock_class+0x11a/0x2f0
[<ffffffff810fcc2b>] __lock_acquire+0xe0/0xe48
[<ffffffff815d7592>] ? _raw_spin_unlock_irq+0x28/0x42
[<ffffffff810fc966>] ? mark_lock+0x2d/0x212
[<ffffffff810fc966>] ? mark_lock+0x2d/0x212
[<ffffffff810fdd9f>] lock_acquire+0x82/0x9d
[<ffffffff810d6abe>] ? queue_delayed_work_on+0x85/0x85
[<ffffffff810d6b07>] flush_work+0x49/0x289
[<ffffffff810d6abe>] ? queue_delayed_work_on+0x85/0x85
[<ffffffff810fc966>] ? mark_lock+0x2d/0x212
[<ffffffff810fe0a8>] ? mark_held_locks+0x71/0x99
[<ffffffff810d8758>] ? __cancel_work_timer+0x89/0xbf
[<ffffffff810d8769>] __cancel_work_timer+0x9a/0xbf
[<ffffffff810d87a9>] cancel_work_sync+0xb/0xd
[<ffffffffa0515b4b>] ath10k_sta_state+0x4b/0x48e [ath10k_core]
[<ffffffffa030dbaa>] drv_sta_state+0x87/0x17b [mac80211]
[<ffffffffa030f632>] __sta_info_destroy_part2+0xca/0x2a0 [mac80211]
[<ffffffffa030f9b5>] __sta_info_destroy+0x25/0x2f [mac80211]
[<ffffffffa030fb19>] sta_info_destroy_addr+0x39/0x59 [mac80211]
[<ffffffffa0331eb0>] ieee80211_destroy_auth_data+0x31/0xbc [mac80211]
[<ffffffffa0335382>] ieee80211_sta_work+0x16b/0xbe6 [mac80211]
[<ffffffff810fe0a8>] ? mark_held_locks+0x71/0x99
[<ffffffff815d75ec>] ? _raw_spin_unlock_irqrestore+0x40/0x5e
[<ffffffff810fe215>] ? trace_hardirqs_on_caller+0x145/0x1a1
[<ffffffff815d75f4>] ? _raw_spin_unlock_irqrestore+0x48/0x5e
[<ffffffffa0319c4a>] ieee80211_iface_work+0x2a3/0x2c6 [mac80211]
[<ffffffff810d7eb9>] process_one_work+0x1d7/0x2fc
[<ffffffff810d7e4f>] ? process_one_work+0x16d/0x2fc
[<ffffffff810d518c>] ? spin_lock_irq+0x9/0xb
[<ffffffff810d83b1>] worker_thread+0x12e/0x1fb
[<ffffffff810d8283>] ? rescuer_thread+0x27b/0x27b
[<ffffffff810dd70d>] kthread+0xc4/0xcc
[<ffffffff810dd649>] ? __kthread_parkme+0x5c/0x5c
[<ffffffff815dc40c>] ret_from_fork+0x7c/0xb0
[<ffffffff810dd649>] ? __kthread_parkme+0x5c/0x5c

Thanks,
Ben

--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com



2014-02-19 19:48:08

by Ben Greear

[permalink] [raw]
Subject: Re: [PATCH] ath10k: fix sta_rc_update for non-ap iftype

On 02/18/2014 11:33 PM, Michal Kazior wrote:
> The arsta structure wasn't initialized for
> non-ap interfaces. This should fix related
> warnings/crashes.
>
> Reported-By: Ben Greear <[email protected]>
> Signed-off-by: Michal Kazior <[email protected]>
> ---
> Ben, does this fix the lockdep splat for you?

This does appear to fix it.

Thanks,
Ben

--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com


2014-02-18 07:16:31

by Michal Kazior

[permalink] [raw]
Subject: Re: lockdep warning (needs annotation)

On 18 February 2014 00:57, Ben Greear <[email protected]> wrote:
> I started seeing this today after synch-ing with upstream
> ath10k tree.
>
> Firmware is modified, and there are some patches to ath10k in my
> tree, but probably nothing that affects this.
>
>
> INFO: trying to register non-static key.
> the code is fine but needs lockdep annotation.
> turning off the locking correctness validator.
> CPU: 1 PID: 213 Comm: kworker/u8:2 Tainted: G C 3.14.0-rc2-wl-ath+ #11
> Hardware name: To be filled by O.E.M. To be filled by O.E.M./HURONRIVER, BIOS 4.6.5 05/02/2012
> Workqueue: phy0 ieee80211_iface_work [mac80211]
> 0000000000000000 ffff88020fd777e8 ffffffff815d0007 0000000000000006
> 0000000000000000 ffff88020fd77868 ffffffff810fb81e ffff88020fd77818
> ffffffff00000000 ffff880200000001 0000000000000002 0000000000000000
> Call Trace:
> [<ffffffff815d0007>] dump_stack+0x4e/0x71
> [<ffffffff810fb81e>] register_lock_class+0x11a/0x2f0
> [<ffffffff810fcc2b>] __lock_acquire+0xe0/0xe48
> [<ffffffff815d7592>] ? _raw_spin_unlock_irq+0x28/0x42
> [<ffffffff810fc966>] ? mark_lock+0x2d/0x212
> [<ffffffff810fc966>] ? mark_lock+0x2d/0x212
> [<ffffffff810fdd9f>] lock_acquire+0x82/0x9d
> [<ffffffff810d6abe>] ? queue_delayed_work_on+0x85/0x85
> [<ffffffff810d6b07>] flush_work+0x49/0x289
> [<ffffffff810d6abe>] ? queue_delayed_work_on+0x85/0x85
> [<ffffffff810fc966>] ? mark_lock+0x2d/0x212
> [<ffffffff810fe0a8>] ? mark_held_locks+0x71/0x99
> [<ffffffff810d8758>] ? __cancel_work_timer+0x89/0xbf
> [<ffffffff810d8769>] __cancel_work_timer+0x9a/0xbf
> [<ffffffff810d87a9>] cancel_work_sync+0xb/0xd
> [<ffffffffa0515b4b>] ath10k_sta_state+0x4b/0x48e [ath10k_core]
> [<ffffffffa030dbaa>] drv_sta_state+0x87/0x17b [mac80211]
> [<ffffffffa030f632>] __sta_info_destroy_part2+0xca/0x2a0 [mac80211]
> [<ffffffffa030f9b5>] __sta_info_destroy+0x25/0x2f [mac80211]
> [<ffffffffa030fb19>] sta_info_destroy_addr+0x39/0x59 [mac80211]
> [<ffffffffa0331eb0>] ieee80211_destroy_auth_data+0x31/0xbc [mac80211]
> [<ffffffffa0335382>] ieee80211_sta_work+0x16b/0xbe6 [mac80211]
> [<ffffffff810fe0a8>] ? mark_held_locks+0x71/0x99
> [<ffffffff815d75ec>] ? _raw_spin_unlock_irqrestore+0x40/0x5e
> [<ffffffff810fe215>] ? trace_hardirqs_on_caller+0x145/0x1a1
> [<ffffffff815d75f4>] ? _raw_spin_unlock_irqrestore+0x48/0x5e
> [<ffffffffa0319c4a>] ieee80211_iface_work+0x2a3/0x2c6 [mac80211]
> [<ffffffff810d7eb9>] process_one_work+0x1d7/0x2fc
> [<ffffffff810d7e4f>] ? process_one_work+0x16d/0x2fc
> [<ffffffff810d518c>] ? spin_lock_irq+0x9/0xb
> [<ffffffff810d83b1>] worker_thread+0x12e/0x1fb
> [<ffffffff810d8283>] ? rescuer_thread+0x27b/0x27b
> [<ffffffff810dd70d>] kthread+0xc4/0xcc
> [<ffffffff810dd649>] ? __kthread_parkme+0x5c/0x5c
> [<ffffffff815dc40c>] ret_from_fork+0x7c/0xb0
> [<ffffffff810dd649>] ? __kthread_parkme+0x5c/0x5c

Oops! I think this is my fault.. I'll look into this. Thanks!


MichaƂ

2014-02-19 07:39:14

by Michal Kazior

[permalink] [raw]
Subject: [PATCH] ath10k: fix sta_rc_update for non-ap iftype

The arsta structure wasn't initialized for
non-ap interfaces. This should fix related
warnings/crashes.

Reported-By: Ben Greear <[email protected]>
Signed-off-by: Michal Kazior <[email protected]>
---
Ben, does this fix the lockdep splat for you?


drivers/net/wireless/ath/ath10k/mac.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 94a70a9..9cb3eae 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3207,6 +3207,13 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
int max_num_peers;
int ret = 0;

+ if (old_state == IEEE80211_STA_NOTEXIST &&
+ new_state == IEEE80211_STA_NONE) {
+ memset(arsta, 0, sizeof(*arsta));
+ arsta->arvif = arvif;
+ INIT_WORK(&arsta->update_wk, ath10k_sta_rc_update_wk);
+ }
+
/* cancel must be done outside the mutex to avoid deadlock */
if ((old_state == IEEE80211_STA_NONE &&
new_state == IEEE80211_STA_NOTEXIST))
@@ -3236,10 +3243,6 @@ static int ath10k_sta_state(struct ieee80211_hw *hw,
"mac vdev %d peer create %pM (new sta) num_peers %d\n",
arvif->vdev_id, sta->addr, ar->num_peers);

- memset(arsta, 0, sizeof(*arsta));
- arsta->arvif = arvif;
- INIT_WORK(&arsta->update_wk, ath10k_sta_rc_update_wk);
-
ret = ath10k_peer_create(ar, arvif->vdev_id, sta->addr);
if (ret)
ath10k_warn("Failed to add peer %pM for vdev %d when adding a new sta: %i\n",
--
1.8.5.3


2014-02-26 16:40:07

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath10k: fix sta_rc_update for non-ap iftype

Michal Kazior <[email protected]> writes:

> The arsta structure wasn't initialized for
> non-ap interfaces. This should fix related
> warnings/crashes.
>
> Reported-By: Ben Greear <[email protected]>
> Signed-off-by: Michal Kazior <[email protected]>

Thanks, applied.

--
Kalle Valo