From: <yhchuang@realtek.com>
To: <kvalo@codeaurora.org>
Cc: <linux-wireless@vger.kernel.org>
Subject: [PATCH 04/11] rtw88: 8822c: add rf write protection when switching channel
Date: Wed, 12 Jun 2019 14:45:10 +0800 [thread overview]
Message-ID: <1560321917-17751-5-git-send-email-yhchuang@realtek.com> (raw)
In-Reply-To: <1560321917-17751-1-git-send-email-yhchuang@realtek.com>
From: Chien-Hsun Liao <ben.liao@realtek.com>
Collision of writing rf registers could occur if the driver writes
rf registers by direct write while the hardware is writing other rf
registers by pi write simultaneously.
Hardware pi write can be triggered by rf calibrations sometimes, so
the driver can not always write rf registers by direct write
protection. Direct write protection can make sure that there is no
hardware pi write during the direct write.
According to some experiments, if we add direct write protection
when switching channel, the performance of rf calibration will not
be affected.
Signed-off-by: Chien-Hsun Liao <ben.liao@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
drivers/net/wireless/realtek/rtw88/phy.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/phy.c b/drivers/net/wireless/realtek/rtw88/phy.c
index 4381b36..580f310 100644
--- a/drivers/net/wireless/realtek/rtw88/phy.c
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
@@ -596,14 +596,19 @@ bool rtw_phy_write_rf_reg(struct rtw_dev *rtwdev, enum rtw_rf_path rf_path,
direct_addr = base_addr[rf_path] + (addr << 2);
mask &= RFREG_MASK;
- rtw_write32_mask(rtwdev, REG_RSV_CTRL, BITS_RFC_DIRECT, DISABLE_PI);
- rtw_write32_mask(rtwdev, REG_WLRF1, BITS_RFC_DIRECT, DISABLE_PI);
+ if (addr == RF_CFGCH) {
+ rtw_write32_mask(rtwdev, REG_RSV_CTRL, BITS_RFC_DIRECT, DISABLE_PI);
+ rtw_write32_mask(rtwdev, REG_WLRF1, BITS_RFC_DIRECT, DISABLE_PI);
+ }
+
rtw_write32_mask(rtwdev, direct_addr, mask, data);
udelay(1);
- rtw_write32_mask(rtwdev, REG_RSV_CTRL, BITS_RFC_DIRECT, ENABLE_PI);
- rtw_write32_mask(rtwdev, REG_WLRF1, BITS_RFC_DIRECT, ENABLE_PI);
+ if (addr == RF_CFGCH) {
+ rtw_write32_mask(rtwdev, REG_RSV_CTRL, BITS_RFC_DIRECT, ENABLE_PI);
+ rtw_write32_mask(rtwdev, REG_WLRF1, BITS_RFC_DIRECT, ENABLE_PI);
+ }
return true;
}
--
2.7.4
next prev parent reply other threads:[~2019-06-12 6:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-12 6:45 [PATCH 00/11] rtw88: regular driver upgrade with minor changes yhchuang
2019-06-12 6:45 ` [PATCH 01/11] rtw88: add fast xmit support yhchuang
2019-06-12 6:45 ` [PATCH 02/11] rtw88: add support for random mac scan yhchuang
2019-06-12 6:45 ` [PATCH 03/11] rtw88: add beacon function setting yhchuang
2019-06-12 6:45 ` yhchuang [this message]
2019-06-12 6:45 ` [PATCH 05/11] rtw88: 8822c: update channel and bandwidth BB setting yhchuang
2019-06-12 6:45 ` [PATCH 06/11] rtw88: 8822c: disable rx clock gating before counter reset yhchuang
2019-06-12 6:45 ` [PATCH 07/11] rtw88: 8822c: use more accurate ofdm fa counting yhchuang
2019-06-12 7:42 ` Kalle Valo
2019-06-12 6:45 ` [PATCH 08/11] rtw88: power on again if it was already on yhchuang
2019-06-12 6:45 ` [PATCH 09/11] rtw88: restore DACK results to save time yhchuang
2019-06-12 6:45 ` [PATCH 10/11] rtw88: rsvd page should go though management queue yhchuang
2019-06-12 6:45 ` [PATCH 11/11] rtw88: fix typo rtw_writ16_set yhchuang
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=1560321917-17751-5-git-send-email-yhchuang@realtek.com \
--to=yhchuang@realtek.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
/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