From: "Luka Gejak" <luka.gejak@linux.dev>
To: "Hungyu Lin" <dennylin0707@gmail.com>, pkshih@realtek.com
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
rtl8821cerfe2@gmail.com, straube.linux@gmail.com,
"Hungyu Lin" <dennylin0707@gmail.com>
Subject: Re: [PATCH] wifi: rtw88: 8723b: avoid converting RX SNR twice
Date: Sat, 10 Oct 2026 06:17:06 +0000 [thread overview]
Message-ID: <0b059e24d8c9b870b3db90d2f001a293896753d8@linux.dev> (raw)
In-Reply-To: <20261010013249.35584-1-dennylin0707@gmail.com>
October 10, 2026 at 3:32 AM, "Hungyu Lin" <dennylin0707@gmail.com> 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@gmail.com>
> ---
> 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
prev parent reply other threads:[~2026-10-10 6:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-10 1:32 Hungyu Lin
2026-10-10 6:17 ` Luka Gejak [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0b059e24d8c9b870b3db90d2f001a293896753d8@linux.dev \
--to=luka.gejak@linux.dev \
--cc=dennylin0707@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=pkshih@realtek.com \
--cc=rtl8821cerfe2@gmail.com \
--cc=straube.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®