Thread (14 messages) 14 messages, 2 authors, 2022-01-07

Re: [PATCH 3/9] rtw88: Move rtw_update_sta_info() out of rtw_ra_mask_info_update_iter()

From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Date: 2022-01-07 21:44:28
Also in: linux-wireless, lkml

Hi Ping-Ke,

On Fri, Jan 7, 2022 at 9:42 AM Pkshih [off-list ref] wrote:
[...]
quoted
@@ -699,11 +702,20 @@ static void rtw_ra_mask_info_update(struct rtw_dev *rtwdev,
                                  const struct cfg80211_bitrate_mask *mask)
 {
      struct rtw_iter_bitrate_mask_data br_data;
+     unsigned int i;
+
+     mutex_lock(&rtwdev->mutex);
I think this lock is used to protect br_data.si[i], right?
Correct, I chose this lock because it's also used in
rtw_ops_sta_remove() and rtw_ops_sta_add() (which could modify the
data in br_data.si[i]).
quoted hunk ↗ jump to hunk
And, I prefer to move mutex lock to caller, like:
@@ -734,7 +734,9 @@ static int rtw_ops_set_bitrate_mask(struct ieee80211_hw *hw,
 {
        struct rtw_dev *rtwdev = hw->priv;

+       mutex_lock(&rtwdev->mutex);
        rtw_ra_mask_info_update(rtwdev, vif, mask);
+       mutex_unlock(&rtwdev->mutex);

        return 0;
 }
Thank you for this hint - if I do it like you suggest then the locking
will be consistent with other functions.
I'll send a v3 with this fixed.


Best regards,
Martin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help