mt7601u: remove warning when avg_rssi is zero
Subsystems (2)
PATCH 1/1 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.
--- drivers/net/wireless/mediatek/mt7601u/phy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt7601u/phy.c +4 -2
@@ -985,13 +985,15 @@ static void mt7601u_agc_tune(struct mt7601u_dev *dev)*/ spin_lock_bh (&dev->con_mon_lock); avg_rssi =ewma_rssi_read (&dev->avg_rssi); -WARN_ON_ONCE (avg_rssi ==0 ); +spin_unlock_bh (&dev->con_mon_lock); +if (avg_rssi ==0 ) +return ; + avg_rssi = -avg_rssi;if (avg_rssi <=-70 ) val -=0x20 ;else if (avg_rssi <=-60 ) val -=0x10 ; -spin_unlock_bh (&dev->con_mon_lock);if (val !=mt7601u_bbp_rr (dev,66 ))mt7601u_bbp_wr (dev,66 , val);
Signature · 1 line
1.9.3
Quoted 5 lines · Stanislaw Gruszka
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 b305a6ab0247 ("mt7601u: use EWMA to calculate avg_rssi")
The patch is quite obvious, but still had to be tested, at least out of principle. And unsurprisingly, no Earth-shattering kaboom.
Quoted 30 lines
Reported-by Adam Borowski <[email protected]>Signed-off-by Stanislaw Gruszka <[email protected]>--- drivers/net/wireless/mediatek/mt7601u/phy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/net/wireless/mediatek/mt7601u/phy.c +4
-2@@ -985,13 +985,15 @@ static void mt7601u_agc_tune(struct mt7601u_dev *dev)*/ spin_lock_bh (&dev->con_mon_lock); avg_rssi =ewma_rssi_read (&dev->avg_rssi); -WARN_ON_ONCE (avg_rssi ==0 ); +spin_unlock_bh (&dev->con_mon_lock); +if (avg_rssi ==0 ) +return ; + avg_rssi = -avg_rssi;if (avg_rssi <=-70 ) val -=0x20 ;else if (avg_rssi <=-60 ) val -=0x10 ; -spin_unlock_bh (&dev->con_mon_lock);if (val !=mt7601u_bbp_rr (dev,66 ))mt7601u_bbp_wr (dev,66 , val);Signature · 1 line
1.9.3
Meow!
Signature · 4 lines
⢀⣴⠾⠻⢶⣦⠀ I've read an article about how lively happy music boosts ⣾⠁⢰⠒⠀⣿⡁ productivity. You can read it, too, you just need the ⢿⡄⠘⠷⠚⠋⠀ right music while doing so. I recommend Skepticism ⠈⠳⣄⠀⠀⠀⠀ (funeral doom metal).
Quoted 7 lines · Stanislaw Gruszka
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 b305a6ab0247 ("mt7601u: use EWMA to calculate avg_rssi")Reported-by Adam Borowski <[email protected]>Signed-off-by Stanislaw Gruszka <[email protected]>
Quoted 8 lines · Stanislaw Gruszka
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 b305a6ab0247 ("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]>
As the first release for b305a6ab0247 was v4.18-rc1, I'll queue this to 4.18.
Signature · 3 lines
https://patchwork.kernel.org/patch/10455479/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 8 lines · Stanislaw Gruszka
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 b305a6ab0247 ("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]>
Patch applied to wireless-drivers.git, thanks.
92963318a255 mt7601u: remove warning when avg_rssi is zero
Signature · 3 lines
https://patchwork.kernel.org/patch/10455479/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches