linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] rtw88: 8723d: follow up fixes
@ 2020-05-18  8:14 yhchuang
  2020-05-18  8:14 ` [PATCH 1/3] rtw88: coex: 8723d: set antanna control owner yhchuang
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: yhchuang @ 2020-05-18  8:14 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, pkshih, kai.heng.feng

From: Yan-Hsuan Chuang <yhchuang@realtek.com>

The RTL8723DE devices have been tested by Canonical for the coex
and basic wifi functions. And they have reported some issues for
RTL8723DE. Fix them accordingly.

Ping-Ke Shih (3):
  rtw88: coex: 8723d: set antanna control owner
  rtw88: coex: 8723d: handle BT inquiry cases
  rtw88: fix EAPOL 4-way failure by finish IQK earlier

 drivers/net/wireless/realtek/rtw88/coex.c     | 21 ++++++++++++++-----
 drivers/net/wireless/realtek/rtw88/mac80211.c |  3 +--
 drivers/net/wireless/realtek/rtw88/main.c     | 16 ++++++++++++++
 drivers/net/wireless/realtek/rtw88/main.h     |  4 ++++
 drivers/net/wireless/realtek/rtw88/rtw8723d.c | 10 +++++++--
 drivers/net/wireless/realtek/rtw88/rtw8723d.h |  1 +
 6 files changed, 46 insertions(+), 9 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] rtw88: coex: 8723d: set antanna control owner
  2020-05-18  8:14 [PATCH 0/3] rtw88: 8723d: follow up fixes yhchuang
@ 2020-05-18  8:14 ` yhchuang
  2020-05-18  8:14 ` [PATCH 2/3] rtw88: coex: 8723d: handle BT inquiry cases yhchuang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: yhchuang @ 2020-05-18  8:14 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, pkshih, kai.heng.feng

From: Ping-Ke Shih <pkshih@realtek.com>

Without setting antenna control owner, the WiFi could be disconnected if
the BT has traffic. Because the antenna is switched to BT side for its
traffic, and the WiFi will have no chance to transfer data. Set control
owner to prevent WiFi disconnect issue.

Fixes: f5df1a8b4376 ("rtw88: 8723d: Add 8723DE to Kconfig and Makefile")
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/coex.c     | 12 ++++++++++--
 drivers/net/wireless/realtek/rtw88/main.h     |  1 +
 drivers/net/wireless/realtek/rtw88/rtw8723d.c |  5 +++++
 drivers/net/wireless/realtek/rtw88/rtw8723d.h |  1 +
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/coex.c b/drivers/net/wireless/realtek/rtw88/coex.c
index 567372fb4e12..5391516616b3 100644
--- a/drivers/net/wireless/realtek/rtw88/coex.c
+++ b/drivers/net/wireless/realtek/rtw88/coex.c
@@ -748,10 +748,18 @@ void rtw_coex_write_indirect_reg(struct rtw_dev *rtwdev, u16 addr,
 
 static void rtw_coex_coex_ctrl_owner(struct rtw_dev *rtwdev, bool wifi_control)
 {
-	if (wifi_control)
+	struct rtw_chip_info *chip = rtwdev->chip;
+	const struct rtw_hw_reg *btg_reg = chip->btg_reg;
+
+	if (wifi_control) {
 		rtw_write32_set(rtwdev, REG_SYS_SDIO_CTRL, BIT_LTE_MUX_CTRL_PATH);
-	else
+		if (btg_reg)
+			rtw_write8_set(rtwdev, btg_reg->addr, btg_reg->mask);
+	} else {
 		rtw_write32_clr(rtwdev, REG_SYS_SDIO_CTRL, BIT_LTE_MUX_CTRL_PATH);
+		if (btg_reg)
+			rtw_write8_clr(rtwdev, btg_reg->addr, btg_reg->mask);
+	}
 }
 
 static void rtw_coex_set_gnt_bt(struct rtw_dev *rtwdev, u8 state)
diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h
index c9156b9b532c..e62a4bceac94 100644
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -1177,6 +1177,7 @@ struct rtw_chip_info {
 	const struct coex_rf_para *wl_rf_para_tx;
 	const struct coex_rf_para *wl_rf_para_rx;
 	const struct coex_5g_afh_map *afh_5g;
+	const struct rtw_hw_reg *btg_reg;
 	const struct rtw_reg_domain *coex_info_hw_regs;
 };
 
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8723d.c b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
index b517af417e0e..671e2c9b20ea 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
@@ -2067,6 +2067,10 @@ static const u8 wl_rssi_step_8723d[] = {60, 50, 44, 30};
 static const u8 bt_rssi_step_8723d[] = {30, 30, 30, 30};
 static const struct coex_5g_afh_map afh_5g_8723d[] = { {0, 0, 0} };
 
+static const struct rtw_hw_reg btg_reg_8723d = {
+	.addr = REG_BTG_SEL, .mask = BIT_MASK_BTG_WL,
+};
+
 /* wl_tx_dec_power, bt_tx_dec_power, wl_rx_gain, bt_rx_lna_constrain */
 static const struct coex_rf_para rf_para_tx_8723d[] = {
 	{0, 0, false, 7},  /* for normal */
@@ -2733,6 +2737,7 @@ struct rtw_chip_info rtw8723d_hw_spec = {
 	.bt_afh_span_bw40 = 0x30,
 	.afh_5g_num = ARRAY_SIZE(afh_5g_8723d),
 	.afh_5g = afh_5g_8723d,
+	.btg_reg = &btg_reg_8723d,
 
 	.coex_info_hw_regs_num = ARRAY_SIZE(coex_info_hw_regs_8723d),
 	.coex_info_hw_regs = coex_info_hw_regs_8723d,
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8723d.h b/drivers/net/wireless/realtek/rtw88/rtw8723d.h
index 31b8ed9ee652..7894d321cd7e 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.h
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.h
@@ -145,6 +145,7 @@ static inline s32 iqk_mult(s32 x, s32 y, s32 *ext)
 
 #define REG_GPIO_INTM		0x0048
 #define REG_BTG_SEL		0x0067
+#define BIT_MASK_BTG_WL		BIT(7)
 #define REG_LTECOEX_PATH_CONTROL	0x0070
 #define REG_LTECOEX_CTRL	0x07c0
 #define REG_LTECOEX_WRITE_DATA	0x07c4
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] rtw88: coex: 8723d: handle BT inquiry cases
  2020-05-18  8:14 [PATCH 0/3] rtw88: 8723d: follow up fixes yhchuang
  2020-05-18  8:14 ` [PATCH 1/3] rtw88: coex: 8723d: set antanna control owner yhchuang
@ 2020-05-18  8:14 ` yhchuang
  2020-05-18  8:14 ` [PATCH 3/3] rtw88: fix EAPOL 4-way failure by finish IQK earlier yhchuang
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: yhchuang @ 2020-05-18  8:14 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, pkshih, kai.heng.feng

From: Ping-Ke Shih <pkshih@realtek.com>

Coex mechanism used to make BT have higher priority and more time to
transfer data when BT inquiry-page, which leads to poor WiFi performance.
Should take WiFi traffic into consideration. If the WiFi is having heavy
traffic, use another parameter to make sure WiFi has more chance to TX/RX,
while guarantee the priority of BT for inquiry. If the WiFi isn't busy
(connected or not), set proper parameter to fix originals.

Fixes: f5df1a8b4376 ("rtw88: 8723d: Add 8723DE to Kconfig and Makefile")
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/coex.c     | 9 ++++++---
 drivers/net/wireless/realtek/rtw88/rtw8723d.c | 5 +++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/coex.c b/drivers/net/wireless/realtek/rtw88/coex.c
index 5391516616b3..1a3d2c3af053 100644
--- a/drivers/net/wireless/realtek/rtw88/coex.c
+++ b/drivers/net/wireless/realtek/rtw88/coex.c
@@ -1351,12 +1351,15 @@ static void rtw_coex_action_bt_inquiry(struct rtw_dev *rtwdev)
 				tdma_case = 108;
 			else
 				tdma_case = 109;
+		} else if (coex_stat->wl_gl_busy) {
+			table_case = 114;
+			tdma_case = 121;
 		} else if (coex_stat->wl_connected) {
-			table_case = 101;
-			tdma_case = 110;
-		} else {
 			table_case = 100;
 			tdma_case = 100;
+		} else {
+			table_case = 101;
+			tdma_case = 100;
 		}
 	}
 
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8723d.c b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
index 671e2c9b20ea..3ad0aff91495 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c
@@ -2039,7 +2039,7 @@ static const struct coex_tdma_para tdma_sant_8723d[] = {
 
 /* Non-Shared-Antenna TDMA */
 static const struct coex_tdma_para tdma_nsant_8723d[] = {
-	{ {0x00, 0x00, 0x00, 0x40, 0x00} }, /* case-100 */
+	{ {0x00, 0x00, 0x00, 0x40, 0x01} }, /* case-100 */
 	{ {0x61, 0x45, 0x03, 0x11, 0x11} }, /* case-101 */
 	{ {0x61, 0x3a, 0x03, 0x11, 0x11} },
 	{ {0x61, 0x30, 0x03, 0x11, 0x11} },
@@ -2059,7 +2059,8 @@ static const struct coex_tdma_para tdma_nsant_8723d[] = {
 	{ {0x51, 0x3a, 0x03, 0x10, 0x50} },
 	{ {0x51, 0x30, 0x03, 0x10, 0x50} },
 	{ {0x51, 0x20, 0x03, 0x10, 0x50} },
-	{ {0x51, 0x10, 0x03, 0x10, 0x50} }
+	{ {0x51, 0x10, 0x03, 0x10, 0x50} }, /* case-120 */
+	{ {0x51, 0x08, 0x03, 0x10, 0x50} },
 };
 
 /* rssi in percentage % (dbm = % - 100) */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] rtw88: fix EAPOL 4-way failure by finish IQK earlier
  2020-05-18  8:14 [PATCH 0/3] rtw88: 8723d: follow up fixes yhchuang
  2020-05-18  8:14 ` [PATCH 1/3] rtw88: coex: 8723d: set antanna control owner yhchuang
  2020-05-18  8:14 ` [PATCH 2/3] rtw88: coex: 8723d: handle BT inquiry cases yhchuang
@ 2020-05-18  8:14 ` yhchuang
  2020-05-28 14:20   ` Sebastian Andrzej Siewior
  2020-05-22  2:14 ` [PATCH 0/3] rtw88: 8723d: follow up fixes You-Sheng Yang
  2020-05-28 14:21 ` Sebastian Andrzej Siewior
  4 siblings, 1 reply; 8+ messages in thread
From: yhchuang @ 2020-05-18  8:14 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, pkshih, kai.heng.feng

From: Ping-Ke Shih <pkshih@realtek.com>

If we connect to an AP with WPA2 security, the IQK and the
EAPOL 4-way handshake may be failed due to overlap, because
driver does IQK right after assoc success.

For 802.11n devices, they used to do IQK in driver that could
requires more than 100ms to finished. During IQK, any TX/RX
events are paused. So, if the EAPOL 4-way started before IQK
is finished, the 1/4 and 2/4 could be dropped, then the AP
will issue deauth with reason IEEE8021X_FAILED (23).

To resolve this, move IQK routine into managed TX prepare,
which is ieee80211_ops::mgd_prepare_tx() called before the
managed frames (auth/assoc) are sent. This can make sure IQK
is done before connection. While scanning, not to do IQK for
each channel because it would take too long.

For 802.11ac devices, they used to do IQK in firmware, and it
takes less time to finish it, so we do not see EAPOL 4-way
failure on them. But, it is still worth to move the IQK to
mgd_prepare_tx().

Fixes: f5df1a8b4376 ("rtw88: 8723d: Add 8723DE to Kconfig and Makefile")
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
 drivers/net/wireless/realtek/rtw88/mac80211.c |  3 +--
 drivers/net/wireless/realtek/rtw88/main.c     | 16 ++++++++++++++++
 drivers/net/wireless/realtek/rtw88/main.h     |  3 +++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c
index 98d2ac22f6f6..c412bc54efde 100644
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
@@ -341,13 +341,11 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw,
 	rtw_leave_lps_deep(rtwdev);
 
 	if (changed & BSS_CHANGED_ASSOC) {
-		struct rtw_chip_info *chip = rtwdev->chip;
 		enum rtw_net_type net_type;
 
 		if (conf->assoc) {
 			rtw_coex_connect_notify(rtwdev, COEX_ASSOCIATE_FINISH);
 			net_type = RTW_NET_MGD_LINKED;
-			chip->ops->phy_calibration(rtwdev);
 
 			rtwvif->aid = conf->aid;
 			rtw_fw_download_rsvd_page(rtwdev);
@@ -663,6 +661,7 @@ static void rtw_ops_mgd_prepare_tx(struct ieee80211_hw *hw,
 	mutex_lock(&rtwdev->mutex);
 	rtw_leave_lps_deep(rtwdev);
 	rtw_coex_connect_notify(rtwdev, COEX_ASSOCIATE_START);
+	rtw_chip_prepare_tx(rtwdev);
 	mutex_unlock(&rtwdev->mutex);
 }
 
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index f88a7d2370aa..d561968b67da 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -408,6 +408,22 @@ void rtw_set_channel(struct rtw_dev *rtwdev)
 	}
 
 	rtw_phy_set_tx_power_level(rtwdev, center_chan);
+
+	/* If set channel isn't for scanning, we'll do RF calibration once in
+	 * this channel while mgd_prepare_tx.
+	 */
+	if (!test_bit(RTW_FLAG_SCANNING, rtwdev->flags))
+		rtwdev->need_rfk = true;
+}
+
+void rtw_chip_prepare_tx(struct rtw_dev *rtwdev)
+{
+	struct rtw_chip_info *chip = rtwdev->chip;
+
+	if (rtwdev->need_rfk) {
+		rtwdev->need_rfk = false;
+		chip->ops->phy_calibration(rtwdev);
+	}
 }
 
 static void rtw_vif_write_addr(struct rtw_dev *rtwdev, u32 start, u8 *addr)
diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h
index e62a4bceac94..98cdec152053 100644
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -1723,6 +1723,8 @@ struct rtw_dev {
 	struct rtw_fw_state wow_fw;
 	struct rtw_wow_param wow;
 
+	bool need_rfk;
+
 	/* hci related data, must be last */
 	u8 priv[] __aligned(sizeof(void *));
 };
@@ -1796,6 +1798,7 @@ void rtw_restore_reg(struct rtw_dev *rtwdev,
 		     struct rtw_backup_info *bckp, u32 num);
 void rtw_desc_to_mcsrate(u16 rate, u8 *mcs, u8 *nss);
 void rtw_set_channel(struct rtw_dev *rtwdev);
+void rtw_chip_prepare_tx(struct rtw_dev *rtwdev);
 void rtw_vif_port_config(struct rtw_dev *rtwdev, struct rtw_vif *rtwvif,
 			 u32 config);
 void rtw_tx_report_purge_timer(struct timer_list *t);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] rtw88: 8723d: follow up fixes
  2020-05-18  8:14 [PATCH 0/3] rtw88: 8723d: follow up fixes yhchuang
                   ` (2 preceding siblings ...)
  2020-05-18  8:14 ` [PATCH 3/3] rtw88: fix EAPOL 4-way failure by finish IQK earlier yhchuang
@ 2020-05-22  2:14 ` You-Sheng Yang
  2020-05-28 14:21 ` Sebastian Andrzej Siewior
  4 siblings, 0 replies; 8+ messages in thread
From: You-Sheng Yang @ 2020-05-22  2:14 UTC (permalink / raw)
  To: yhchuang, kvalo; +Cc: linux-wireless, pkshih, kai.heng.feng


[-- Attachment #1.1: Type: text/plain, Size: 1303 bytes --]

This works for me by following verification steps:

1. pair with one Bluetooth headset,
2. connect to some WLAN
3. run `nmcli d disconnect $ifname`, `nmcli d connect $ifname`
interactively with time intervals for 100 runs.
4. wireless interface is still alive without that "deauthenticated
(Reason: 23=IEEE8021X_FAILED)" error.

Tested-by: You-Sheng Yang <vicamo.yang@canonical.com>

On 2020-05-18 16:14, yhchuang@realtek.com wrote:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> 
> The RTL8723DE devices have been tested by Canonical for the coex
> and basic wifi functions. And they have reported some issues for
> RTL8723DE. Fix them accordingly.
> 
> Ping-Ke Shih (3):
>   rtw88: coex: 8723d: set antanna control owner
>   rtw88: coex: 8723d: handle BT inquiry cases
>   rtw88: fix EAPOL 4-way failure by finish IQK earlier
> 
>  drivers/net/wireless/realtek/rtw88/coex.c     | 21 ++++++++++++++-----
>  drivers/net/wireless/realtek/rtw88/mac80211.c |  3 +--
>  drivers/net/wireless/realtek/rtw88/main.c     | 16 ++++++++++++++
>  drivers/net/wireless/realtek/rtw88/main.h     |  4 ++++
>  drivers/net/wireless/realtek/rtw88/rtw8723d.c | 10 +++++++--
>  drivers/net/wireless/realtek/rtw88/rtw8723d.h |  1 +
>  6 files changed, 46 insertions(+), 9 deletions(-)
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] rtw88: fix EAPOL 4-way failure by finish IQK earlier
  2020-05-18  8:14 ` [PATCH 3/3] rtw88: fix EAPOL 4-way failure by finish IQK earlier yhchuang
@ 2020-05-28 14:20   ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2020-05-28 14:20 UTC (permalink / raw)
  To: yhchuang; +Cc: kvalo, linux-wireless, pkshih, kai.heng.feng

On 2020-05-18 16:14:44 [+0800], yhchuang@realtek.com wrote:
> From: Ping-Ke Shih <pkshih@realtek.com>
> 
> If we connect to an AP with WPA2 security, the IQK and the
> EAPOL 4-way handshake may be failed due to overlap, because
> driver does IQK right after assoc success.

Connectig to an AP with WPA2 security may fail. The IQK and the EAPOL
4-way handshake may overlap because the driver does IQK right after
assoc success.

> For 802.11n devices, they used to do IQK in driver that could
> requires more than 100ms to finished. During IQK, any TX/RX
> events are paused. So, if the EAPOL 4-way started before IQK
> is finished, the 1/4 and 2/4 could be dropped, then the AP
> will issue deauth with reason IEEE8021X_FAILED (23).

For 802.11n devices the IQK is done in the driver and could
require more than 100ms to complete. During IQK any TX/RX
events are paused. So if the EAPOL 4-way handshake started before
IQK finished then the 1/4 and 2/4 part of the handshake could be dropped. 
The AP will then issue deauth with reason IEEE8021X_FAILED (23).

> To resolve this, move IQK routine into managed TX prepare,
> which is ieee80211_ops::mgd_prepare_tx() called before the
> managed frames (auth/assoc) are sent. This can make sure IQK
> is done before connection. While scanning, not to do IQK for
> each channel because it would take too long.

To resolve this move IQK routine into managed TX prepare
(ieee80211_ops::mgd_prepare_tx()). The callback is called
before the managed frames (auth/assoc) are sent. This will make
sure that IQK is completed before the handshake starts.
Don't do IQK during scanning because doing it each channel ill take
too long.

> For 802.11ac devices, they used to do IQK in firmware, and it
> takes less time to finish it, so we do not see EAPOL 4-way
> failure on them. But, it is still worth to move the IQK to
> mgd_prepare_tx().

The 802.11ac devices do IQK in firmware and it takes less time to
complete. Therefore we don't see a failure during the EAPOL 4-way
handshake. It is still worth IQK to ieee80211_ops::mgd_prepare_tx().

> Fixes: f5df1a8b4376 ("rtw88: 8723d: Add 8723DE to Kconfig and Makefile")
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
> ---
>  drivers/net/wireless/realtek/rtw88/mac80211.c |  3 +--
>  drivers/net/wireless/realtek/rtw88/main.c     | 16 ++++++++++++++++
>  drivers/net/wireless/realtek/rtw88/main.h     |  3 +++
>  3 files changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c
> index 98d2ac22f6f6..c412bc54efde 100644
> --- a/drivers/net/wireless/realtek/rtw88/mac80211.c
> +++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
> @@ -341,13 +341,11 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw,
>  	rtw_leave_lps_deep(rtwdev);
>  
>  	if (changed & BSS_CHANGED_ASSOC) {
> -		struct rtw_chip_info *chip = rtwdev->chip;
>  		enum rtw_net_type net_type;
>  
>  		if (conf->assoc) {
>  			rtw_coex_connect_notify(rtwdev, COEX_ASSOCIATE_FINISH);
>  			net_type = RTW_NET_MGD_LINKED;
> -			chip->ops->phy_calibration(rtwdev);
>  
>  			rtwvif->aid = conf->aid;
>  			rtw_fw_download_rsvd_page(rtwdev);
> @@ -663,6 +661,7 @@ static void rtw_ops_mgd_prepare_tx(struct ieee80211_hw *hw,
>  	mutex_lock(&rtwdev->mutex);
>  	rtw_leave_lps_deep(rtwdev);
>  	rtw_coex_connect_notify(rtwdev, COEX_ASSOCIATE_START);
> +	rtw_chip_prepare_tx(rtwdev);
>  	mutex_unlock(&rtwdev->mutex);
>  }
>  
> diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
> index f88a7d2370aa..d561968b67da 100644
> --- a/drivers/net/wireless/realtek/rtw88/main.c
> +++ b/drivers/net/wireless/realtek/rtw88/main.c
> @@ -408,6 +408,22 @@ void rtw_set_channel(struct rtw_dev *rtwdev)
>  	}
>  
>  	rtw_phy_set_tx_power_level(rtwdev, center_chan);
> +
> +	/* If set channel isn't for scanning, we'll do RF calibration once in
> +	 * this channel while mgd_prepare_tx.
> +	 */

	/* If the channel isn't set for scanning, we'll do RF calibration
	 * in ::mgd_prepare_tx(). Performing the calibration during
	 * scanning on each channel takes too long.
	 */
> +	if (!test_bit(RTW_FLAG_SCANNING, rtwdev->flags))
> +		rtwdev->need_rfk = true;
> +}
> +
> +void rtw_chip_prepare_tx(struct rtw_dev *rtwdev)
> +{
> +	struct rtw_chip_info *chip = rtwdev->chip;
> +
> +	if (rtwdev->need_rfk) {
> +		rtwdev->need_rfk = false;
> +		chip->ops->phy_calibration(rtwdev);
> +	}
>  }

Sebastian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] rtw88: 8723d: follow up fixes
  2020-05-18  8:14 [PATCH 0/3] rtw88: 8723d: follow up fixes yhchuang
                   ` (3 preceding siblings ...)
  2020-05-22  2:14 ` [PATCH 0/3] rtw88: 8723d: follow up fixes You-Sheng Yang
@ 2020-05-28 14:21 ` Sebastian Andrzej Siewior
  2020-05-29  2:23   ` Tony Chuang
  4 siblings, 1 reply; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2020-05-28 14:21 UTC (permalink / raw)
  To: yhchuang; +Cc: kvalo, linux-wireless, pkshih, kai.heng.feng

On 2020-05-18 16:14:41 [+0800], yhchuang@realtek.com wrote:
> From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> 
> The RTL8723DE devices have been tested by Canonical for the coex
> and basic wifi functions. And they have reported some issues for
> RTL8723DE. Fix them accordingly.

Minor rewording in 3/3, otherwise looks good.

Sebastian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 0/3] rtw88: 8723d: follow up fixes
  2020-05-28 14:21 ` Sebastian Andrzej Siewior
@ 2020-05-29  2:23   ` Tony Chuang
  0 siblings, 0 replies; 8+ messages in thread
From: Tony Chuang @ 2020-05-29  2:23 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: kvalo, linux-wireless, Pkshih, kai.heng.feng


> On 2020-05-18 16:14:41 [+0800], yhchuang@realtek.com wrote:
> > From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> >
> > The RTL8723DE devices have been tested by Canonical for the coex
> > and basic wifi functions. And they have reported some issues for
> > RTL8723DE. Fix them accordingly.
> 
> Minor rewording in 3/3, otherwise looks good.
> 
> Sebastian
> 

Thanks. I will improve the wording in v2.

Yan-Hsuan

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-29  2:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18  8:14 [PATCH 0/3] rtw88: 8723d: follow up fixes yhchuang
2020-05-18  8:14 ` [PATCH 1/3] rtw88: coex: 8723d: set antanna control owner yhchuang
2020-05-18  8:14 ` [PATCH 2/3] rtw88: coex: 8723d: handle BT inquiry cases yhchuang
2020-05-18  8:14 ` [PATCH 3/3] rtw88: fix EAPOL 4-way failure by finish IQK earlier yhchuang
2020-05-28 14:20   ` Sebastian Andrzej Siewior
2020-05-22  2:14 ` [PATCH 0/3] rtw88: 8723d: follow up fixes You-Sheng Yang
2020-05-28 14:21 ` Sebastian Andrzej Siewior
2020-05-29  2:23   ` Tony Chuang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).