2017-05-03 10:04:50

by Arend Van Spriel

[permalink] [raw]
Subject: when to use wdev_lock()

Hi Johannes,

I bumped into use of wdev_lock() again with 802.1X 4-way-hs offload
stuff. So for .set_pmk() and .del_pmk() it takes wdev_lock(). Is there a
rule of thumb when this lock is needed. What is it protecting in general
and in the case of pmk configuration.

Regards,
Arend


2017-05-17 13:16:00

by Johannes Berg

[permalink] [raw]
Subject: Re: when to use wdev_lock()

Hi Arend,

Sorry for the long delay.

> I bumped into use of wdev_lock() again with 802.1X 4-way-hs offload 
> stuff. So for .set_pmk() and .del_pmk() it takes wdev_lock(). Is
> there a  rule of thumb when this lock is needed. What is it
> protecting in general  and in the case of pmk configuration.

No, unfortunately it's not very well defined.

One thing that drove this is that mac80211 (and perhaps some full-mac
drivers) uses the same lock to prevent races between their own and
cfg80211's state. So some of the locking is driven by that as well.

I think it may have been done here just for consistency with other
calls.

johannes