[PATCH] mt76: mt7915: update station's airtime and gi from event

Felix Fietkau nbd at nbd.name
Thu Nov 25 11:00:02 PST 2021


On 2021-11-25 19:56, Ryder Lee wrote:
> On Thu, 2021-11-25 at 17:13 +0800, MeiChia Chiu wrote:
>> From: MeiChia Chiu <meichia.chiu at mediatek.com>
> 
> Should be [RFC].
> 
>> To avoid race condition in firmware,
>> if firmware support airtime and gi event,
>> driver update station's airtime and gi from event.
>> 
>> Reviewed-by: Evelyn Tsai <evelyn.tsai at mediatek.com>
>> Reviewed-by: Ryder Lee <ryder.lee at mediatek.com>
>> Co-developed-by: Sujuan Chen <sujuan.chen at mediatek.com>
>> Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
>> Signed-off-by: MeiChia Chiu <meichia.chiu at mediatek.com>
>> 
>> ---
>>  .../net/wireless/mediatek/mt76/mt7915/init.c   |   2 +
>>  .../net/wireless/mediatek/mt76/mt7915/mac.c    |  35 ++++++++----
>>  .../net/wireless/mediatek/mt76/mt7915/mcu.c    | 138
>> ++++++++++++++++++++++++++++++++++++++++++++++++
>>  .../net/wireless/mediatek/mt76/mt7915/mcu.h    |  28 ++++++++++
>>  .../net/wireless/mediatek/mt76/mt7915/mt7915.h |  11 ++++
>>  5 files changed, 204 insertions(+), 10 deletions(-)
>> 
>> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
>> b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
>> index 4b56358d..a5f6d25d 100644
>> --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
>> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
>> @@ -960,6 +960,8 @@ int mt7915_register_device(struct mt7915_dev
>> *dev)
>>  	if (ret)
>>  		return ret;
>>  
>> +	dev->fw_ver = mt76_rr(dev, MT_SWDEF(0x7c));
>> +
>>  	return mt7915_init_debugfs(&dev->phy);
>>  }
>>  
>> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
>> b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
>> index 1041d88f..b2e20251 100644
>> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
>> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
>> @@ -1433,7 +1433,8 @@ mt7915_mac_tx_free(struct mt7915_dev *dev,
>> struct sk_buff *skb)
>>  		mt7915_txwi_free(dev, txwi, sta, &free_list);
>>  	}
>>  
>> -	mt7915_mac_sta_poll(dev);
>> +	if (!mt7915_firmware_offload(dev))
>> +		mt7915_mac_sta_poll(dev);
> 
> @ Sujuan, can you double check if MCU_EXT_EVENT_TXRX_AIR_TIME works for
> all firmware versions? Maybe we can use this single event directly if
> everyone agrees with this change.
> 
> I'd suggest adding some persuasive testing datas into the commit
> message to help reviewers make adjudgement.
How often is this event sent? I think the effectiveness of airtime 
fairness after this change needs to be carefully verified.

- Felix



More information about the Linux-mediatek mailing list