Re: [PATCH] wifi: rtw88: 8723b: avoid converting RX SNR twice

From: Luka Gejak

Date: Sat Oct 10 2026 - 02:17:19 EST


October 10, 2026 at 3:32 AM, "Hungyu Lin" <dennylin0707@xxxxxxxxx> wrote:


>
> rtw8723b_query_phy_status_ofdm() already divides the PHY SNR report by
> two when filling pkt_stat->rx_snr. Shifting it again when copying it to
> dm_info->rx_snr halves the value shown in diagnostics and used for the
> average SNR.
>
> Copy the converted value directly.
>
> Fixes: d726c70ce082 ("wifi: rtw88: 8723b: add the RTL8723B chip driver")
> Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
> ---
> drivers/net/wireless/realtek/rtw88/rtw8723b.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8723b.c b/drivers/net/wireless/realtek/rtw88/rtw8723b.c
> index 8bb9c03d769c..197add7cc110 100644
> --- a/drivers/net/wireless/realtek/rtw88/rtw8723b.c
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8723b.c
> @@ -1291,7 +1291,7 @@ static void rtw8723b_query_phy_status_ofdm(struct rtw_dev *rtwdev, void *phy_raw
>
> dm_info->curr_rx_rate = pkt_stat->rate;
> dm_info->rssi[RF_PATH_A] = pkt_stat->rssi;
> - dm_info->rx_snr[RF_PATH_A] = pkt_stat->rx_snr[RF_PATH_A] >> 1;
> + dm_info->rx_snr[RF_PATH_A] = pkt_stat->rx_snr[RF_PATH_A];
> dm_info->cfo_tail[RF_PATH_A] = (pkt_stat->cfo_tail[RF_PATH_A] * 5) >> 1;
>
> val_s8 = (s8)pkt_stat->rx_evm[RF_PATH_A];
>

For consistency, please do it the other way round: drop the /2 when
filling pkt_stat->rx_snr and keep the shift on the dm_info line.
rtw8723d.c, rtw8822b.c, rtw8822c.c and rtw8814a.c all store the raw report
and shift it once.

Also, rtw8703b.c has the same double conversion in query_phy_status_ofdm().
That one is upstream, so a patch for it would be welcome.

Best regards,
Luka Gejak