Skip to content

Commit 9296331

Browse files
Stanislaw GruszkaKalle Valo
authored andcommitted
mt7601u: remove warning when avg_rssi is zero
It turned out that we can run calibration without already received frames with RSSI data. In such case just don't update AGC register and don't print the warning. Fixes: b305a6a ("mt7601u: use EWMA to calculate avg_rssi") Reported-by: Adam Borowski <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]> Acked-by: Jakub Kicinski <[email protected]> Signed-off-by: Kalle Valo <[email protected]>
1 parent f8c095f commit 9296331

File tree

1 file changed

+4
-2
lines changed
  • drivers/net/wireless/mediatek/mt7601u

1 file changed

+4
-2
lines changed

drivers/net/wireless/mediatek/mt7601u/phy.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,13 +986,15 @@ static void mt7601u_agc_tune(struct mt7601u_dev *dev)
986986
*/
987987
spin_lock_bh(&dev->con_mon_lock);
988988
avg_rssi = ewma_rssi_read(&dev->avg_rssi);
989-
WARN_ON_ONCE(avg_rssi == 0);
989+
spin_unlock_bh(&dev->con_mon_lock);
990+
if (avg_rssi == 0)
991+
return;
992+
990993
avg_rssi = -avg_rssi;
991994
if (avg_rssi <= -70)
992995
val -= 0x20;
993996
else if (avg_rssi <= -60)
994997
val -= 0x10;
995-
spin_unlock_bh(&dev->con_mon_lock);
996998

997999
if (val != mt7601u_bbp_rr(dev, 66))
9981000
mt7601u_bbp_wr(dev, 66, val);

0 commit comments

Comments
 (0)