Skip to contentSkip to conversation

wifi: rtw88: coex: remove rf4ce unused code

PATCH In review Dmitry Kandybka 3 participants 5 messages Aug 20, 2024 – Oct 15, 2024 Realtek wireless driver (rtw88)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: rtw88: coex: remove rf4ce unused code

In 'rtw_coex_run_coex', 'rf4ce_en' is hardcoded to false, so 'rtw_coex_action_rf4ce(rtwdev)' is never executed. Assuming that rf4ce was never fully implemented, remove lookalike leftovers. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes a9359faaa47d ("rtw88: coex: add the mechanism for RF4CE")
---
 drivers/net/wireless/realtek/rtw88/coex.c | 30 +----------------------
 1 file changed, 1 insertion(+), 29 deletions(-)
drivers/net/wireless/realtek/rtw88/coex.c +1 -29
index de3332eb7a22..1fbcf701e7b7 100644
@@ -1591,31 +1591,6 @@ static void rtw_coex_action_freerun(struct rtw_dev *rtwdev)
 	rtw_coex_tdma(rtwdev, false, 100);
 }
 
-static void rtw_coex_action_rf4ce(struct rtw_dev *rtwdev)
-{
-	const struct rtw_chip_info *chip = rtwdev->chip;
-	struct rtw_efuse *efuse = &rtwdev->efuse;
-	u8 table_case, tdma_case;
-
-	rtw_dbg(rtwdev, RTW_DBG_COEX, "[BTCoex], %s()\n", __func__);
-
-	rtw_coex_set_ant_path(rtwdev, false, COEX_SET_ANT_2G);
-	rtw_coex_set_rf_para(rtwdev, chip->wl_rf_para_rx[0]);
-
-	if (efuse->share_ant) {
-		/* Shared-Ant */
-		table_case = 9;
-		tdma_case = 16;
-	} else {
-		/* Non-Shared-Ant */
-		table_case = 100;
-		tdma_case = 100;
-	}
-
-	rtw_coex_table(rtwdev, false, table_case);
-	rtw_coex_tdma(rtwdev, false, tdma_case);
-}
-
 static void rtw_coex_action_bt_whql_test(struct rtw_dev *rtwdev)
 {
 	const struct rtw_chip_info *chip = rtwdev->chip;
@@ -2531,7 +2506,6 @@ static void rtw_coex_run_coex(struct rtw_dev *rtwdev, u8 reason)
 	struct rtw_coex *coex = &rtwdev->coex;
 	struct rtw_coex_dm *coex_dm = &coex->dm;
 	struct rtw_coex_stat *coex_stat = &coex->stat;
-	bool rf4ce_en = false;
 
 	lockdep_assert_held(&rtwdev->mutex);
 
@@ -2587,9 +2561,7 @@ static void rtw_coex_run_coex(struct rtw_dev *rtwdev, u8 reason)
 	coex_stat->wl_coex_mode = COEX_WLINK_2G1PORT;
 
 	if (coex_stat->bt_disabled) {
-		if (coex_stat->wl_connected && rf4ce_en)
-			rtw_coex_action_rf4ce(rtwdev);
-		else if (!coex_stat->wl_connected)
+		if (!coex_stat->wl_connected)
 			rtw_coex_action_wl_not_connected(rtwdev);
 		else
 			rtw_coex_action_wl_only(rtwdev);
Signature · 1 line
2.43.5
#1 lore raw
Quoted 69 lines · Dmitry Kandybka

In 'rtw_coex_run_coex', 'rf4ce_en' is hardcoded to false, so 'rtw_coex_action_rf4ce(rtwdev)' is never executed. Assuming that rf4ce was never fully implemented, remove lookalike leftovers. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes a9359faaa47d ("rtw88: coex: add the mechanism for RF4CE")

---
 drivers/net/wireless/realtek/rtw88/coex.c | 30 +----------------------

 1 file changed, 1 insertion(+), 29 deletions(-)
drivers/net/wireless/realtek/rtw88/coex.c +0 -0
index de3332eb7a22..1fbcf701e7b7 100644
@@ -1591,31 +1591,6 @@ static void rtw_coex_action_freerun(struct rtw_dev
 *rtwdev)
  	rtw_coex_tdma(rtwdev, false, 100);
  }

drivers/net/wireless/realtek/rtw88/coex.c +0 -25
-static void rtw_coex_action_rf4ce(struct rtw_dev *rtwdev)
-{
-	const struct rtw_chip_info *chip = rtwdev->chip;
-	struct rtw_efuse *efuse = &rtwdev->efuse;
-	u8 table_case, tdma_case;
-
-	rtw_dbg(rtwdev, RTW_DBG_COEX, "[BTCoex], %s()\n", __func__);
-
-	rtw_coex_set_ant_path(rtwdev, false, COEX_SET_ANT_2G);
-	rtw_coex_set_rf_para(rtwdev, chip->wl_rf_para_rx[0]);
-
-	if (efuse->share_ant) {
-		/* Shared-Ant */
-		table_case = 9;
-		tdma_case = 16;
-	} else {
-		/* Non-Shared-Ant */
-		table_case = 100;
-		tdma_case = 100;
-	}
-
-	rtw_coex_table(rtwdev, false, table_case);
-	rtw_coex_tdma(rtwdev, false, tdma_case);
-}
-

 static void rtw_coex_action_bt_whql_test(struct rtw_dev *rtwdev) {
  const struct rtw_chip_info *chip = rtwdev->chip;

drivers/net/wireless/realtek/rtw88/coex.c +0 -1
@@ -2531,7 +2506,6 @@ static void rtw_coex_run_coex(struct rtw_dev
 *rtwdev, u8 reason)
  	struct rtw_coex *coex = &rtwdev->coex;
  	struct rtw_coex_dm *coex_dm = &coex->dm;
  	struct rtw_coex_stat *coex_stat = &coex->stat;
-	bool rf4ce_en = false;


  lockdep_assert_held(&rtwdev->mutex);

drivers/net/wireless/realtek/rtw88/coex.c +0 -0
@@ -2587,9 +2561,7 @@ static void rtw_coex_run_coex(struct rtw_dev
 *rtwdev, u8 reason)
  	coex_stat->wl_coex_mode = COEX_WLINK_2G1PORT;


  if (coex_stat->bt_disabled) {

drivers/net/wireless/realtek/rtw88/coex.c +1 -3
-		if (coex_stat->wl_connected && rf4ce_en)
-			rtw_coex_action_rf4ce(rtwdev);
-		else if (!coex_stat->wl_connected)
+		if (!coex_stat->wl_connected)
Quoted 3 lines

  rtw_coex_action_wl_not_connected(rtwdev); else
  rtw_coex_action_wl_only(rtwdev);

Hello Ping-Ke Shih,
This is kindly reminder. Could you pay some attention to this patch and clarify if the rf4ce is actual for this moment and future?

Signature · 2 lines
Best regards,
Dmitry Kandybka
maintainer
#2 lore raw
Quoted 3 lines

This is kindly reminder. Could you pay some attention to this patch and clarify if the rf4ce is actual for this moment and future?

Yes. Our coex developers want to keep this chunk. For me, this kind of cleanup patch is not very help to driver, but I and developers need much time to confirm and judge if we keep or remove them, so I would want to ignore this kind of patches...

#3 lore raw
Quoted 4 lines · Ping-Ke Shih
Quoted 3 lines

This is kindly reminder. Could you pay some attention to this patch and clarify if the rf4ce is actual for this moment and future?

Quoted 8 lines

Yes. Our coex developers want to keep this chunk. For me, this kind of cleanup
patch is not very help to driver, but I and developers need much time to confirm and judge if we keep or remove them, so I would want to ignore this
kind of patches...

Thanks for you clarification. Have a good work on driver.

#4 lore raw
In reply to Ping-Ke Shih
Quoted 7 lines · Ping-Ke Shih
Quoted 2 lines

This is kindly reminder. Could you pay some attention to this patch and clarify if the rf4ce is actual for this moment and future?

Yes. Our coex developers want to keep this chunk. For me, this kind of cleanup patch is not very help to driver, but I and developers need much time to confirm and judge if we keep or remove them, so I would want to ignore this kind of patches...

Yeah, I share your pain. Cleanup patches are most of the time unnecessary extra work for us maintainers. We should try to write that "cleanup policy for wireless subsystem" doc at some point, then we could just point that to everyone submitting cleanup patches.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches