Search Linux Wireless

Re: [PATCH] mt76: mt7915: simplify mt7915_mac_sta_poll routine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Drop unnecessary lock around sta_poll_list list in mt7915_mac_sta_poll
> routine.
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx>

Hi Felix,

please let's drop this patch, as we discussed, there is a race on
list_del_init(&msta->poll_list).

Regards,
Lorenzo

> ---
>  drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> index b3168dd3baed..cde98b86e2bb 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> @@ -117,23 +117,15 @@ static void mt7915_mac_sta_poll(struct mt7915_dev *dev)
>  
>  	rcu_read_lock();
>  
> -	while (true) {
> +	while (!list_empty(&sta_poll_list)) {
>  		bool clear = false;
>  		u32 addr;
> -		u16 idx;
>  
> -		spin_lock_bh(&dev->sta_poll_lock);
> -		if (list_empty(&sta_poll_list)) {
> -			spin_unlock_bh(&dev->sta_poll_lock);
> -			break;
> -		}
>  		msta = list_first_entry(&sta_poll_list,
>  					struct mt7915_sta, poll_list);
>  		list_del_init(&msta->poll_list);
> -		spin_unlock_bh(&dev->sta_poll_lock);
>  
> -		idx = msta->wcid.idx;
> -		addr = mt7915_mac_wtbl_lmac_addr(dev, idx) + 20 * 4;
> +		addr = mt7915_mac_wtbl_lmac_addr(dev, msta->wcid.idx) + 20 * 4;
>  
>  		for (i = 0; i < IEEE80211_NUM_ACS; i++) {
>  			u32 tx_last = msta->airtime_ac[i];
> @@ -152,7 +144,7 @@ static void mt7915_mac_sta_poll(struct mt7915_dev *dev)
>  		}
>  
>  		if (clear) {
> -			mt7915_mac_wtbl_update(dev, idx,
> +			mt7915_mac_wtbl_update(dev, msta->wcid.idx,
>  					       MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
>  			memset(msta->airtime_ac, 0, sizeof(msta->airtime_ac));
>  		}
> -- 
> 2.29.2
> 

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux