[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFBinCBUJHWb+VpLdqDh49RSX9oMPjCxU1hzzqsCL31ouG=zmw@mail.gmail.com>
Date: Fri, 7 Jan 2022 22:44:13 +0100
From: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
To: Pkshih <pkshih@...ltek.com>
Cc: "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
"tony0620emma@...il.com" <tony0620emma@...il.com>,
"kvalo@...eaurora.org" <kvalo@...eaurora.org>,
"johannes@...solutions.net" <johannes@...solutions.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Neo Jou <neojou@...il.com>,
Jernej Skrabec <jernej.skrabec@...il.com>
Subject: Re: [PATCH 3/9] rtw88: Move rtw_update_sta_info() out of rtw_ra_mask_info_update_iter()
Hi Ping-Ke,
On Fri, Jan 7, 2022 at 9:42 AM Pkshih <pkshih@...ltek.com> wrote:
[...]
>
> > @@ -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]).
> 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
Powered by blists - more mailing lists