diff mbox

[v3,06/10] rtlwifi: btcoex: 21a 2ant: run mechanism if status changes or auto adjust is set

Message ID 20170511190119.23426-7-Larry.Finger@lwfinger.net (mailing list archive)
State Accepted
Commit 1f88d59e350eea7baadb657cb03f57f6816b3b95
Delegated to: Kalle Valo
Headers show

Commit Message

Larry Finger May 11, 2017, 7:01 p.m. UTC
From: Yan-Hsuan Chuang <yhchuang@realtek.com>

The driver will periodically ask the coex, and the coex only runs the
mechanism when the status was changed or the auto adjust is set.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Pkshih <pkshih@realtek.com>
Cc: Birming Chiu <birming@realtek.com>
Cc: Shaofu <shaofu@realtek.com>
Cc: Steven Ting <steventing@realtek.com>
---
v2 - resubmit after removal of BT_AUTO_REPORT_XXXX symbols.
v3 - remove one additional usage of BT_AUTO_REPORT_XXXX
---
 .../realtek/rtlwifi/btcoexist/halbtc8821a2ant.c         | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

Comments

kernel test robot May 13, 2017, 6:57 a.m. UTC | #1
Hi Yan-Hsuan,

[auto build test ERROR on wireless-drivers-next/master]
[also build test ERROR on next-20170512]
[cannot apply to v4.11]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Larry-Finger/rtlwifi-btcoex-21a-2ant-set-tdma-with-rssi-states/20170513-140718
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
config: alpha-allmodconfig (attached as .config)
compiler: alpha-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=alpha 

All errors (new ones prefixed by >>):

   drivers/net/wireless//realtek/rtlwifi/btcoexist/halbtc8821a2ant.c: In function 'ex_btc8821a2ant_periodical':
>> drivers/net/wireless//realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:4203:15: error: 'struct btc_coexist' has no member named 'auto_report_2ant'
     if (btcoexist->auto_report_2ant) {
                  ^~

vim +4203 drivers/net/wireless//realtek/rtlwifi/btcoexist/halbtc8821a2ant.c

  4197				 glcoex_ver_date_8821a_2ant, glcoex_ver_8821a_2ant,
  4198				 fw_ver, bt_patch_ver, bt_patch_ver);
  4199			RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
  4200				 "[BTCoex], ****************************************************************\n");
  4201		}
  4202	
> 4203		if (btcoexist->auto_report_2ant) {
  4204			btc8821a2ant_query_bt_info(btcoexist);
  4205		} else {
  4206			btc8821a2ant_monitor_bt_ctr(btcoexist);

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Larry Finger May 13, 2017, 10:26 a.m. UTC | #2
On 05/13/2017 01:57 AM, kbuild test robot wrote:
> Hi Yan-Hsuan,
>
> [auto build test ERROR on wireless-drivers-next/master]
> [also build test ERROR on next-20170512]
> [cannot apply to v4.11]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

This patch depends on the previously submitted, but not yet merged patch in 
https://patchwork.kernel.org/patch/9712523/.

Larry

>
> url:    https://github.com/0day-ci/linux/commits/Larry-Finger/rtlwifi-btcoex-21a-2ant-set-tdma-with-rssi-states/20170513-140718
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master
> config: alpha-allmodconfig (attached as .config)
> compiler: alpha-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
> reproduce:
>         wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=alpha
>
> All errors (new ones prefixed by >>):
>
>    drivers/net/wireless//realtek/rtlwifi/btcoexist/halbtc8821a2ant.c: In function 'ex_btc8821a2ant_periodical':
>>> drivers/net/wireless//realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:4203:15: error: 'struct btc_coexist' has no member named 'auto_report_2ant'
>      if (btcoexist->auto_report_2ant) {
>                   ^~
>
> vim +4203 drivers/net/wireless//realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
>
>   4197				 glcoex_ver_date_8821a_2ant, glcoex_ver_8821a_2ant,
>   4198				 fw_ver, bt_patch_ver, bt_patch_ver);
>   4199			RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
>   4200				 "[BTCoex], ****************************************************************\n");
>   4201		}
>   4202	
>> 4203		if (btcoexist->auto_report_2ant) {
>   4204			btc8821a2ant_query_bt_info(btcoexist);
>   4205		} else {
>   4206			btc8821a2ant_monitor_bt_ctr(btcoexist);
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
>
diff mbox

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
index ca7649dca352..0d97e214ee10 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
@@ -3485,14 +3485,14 @@  static void btc8821a2ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
 	if (btc8821a2ant_is_common_action(btcoexist)) {
 		RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
 			 "[BTCoex], Action 2-Ant common\n");
-		coex_dm->reset_tdma_adjust = true;
+		coex_dm->auto_tdma_adjust = true;
 	} else {
 		if (coex_dm->cur_algorithm != coex_dm->pre_algorithm) {
 			RT_TRACE(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
 				 "[BTCoex], pre_algorithm = %d, cur_algorithm = %d\n",
 				    coex_dm->pre_algorithm,
 				    coex_dm->cur_algorithm);
-			coex_dm->reset_tdma_adjust = true;
+			coex_dm->auto_tdma_adjust = false;
 		}
 		switch (coex_dm->cur_algorithm) {
 		case BT_8821A_2ANT_COEX_ALGO_SCO:
@@ -4200,7 +4200,14 @@  void ex_btc8821a2ant_periodical(struct btc_coexist *btcoexist)
 			 "[BTCoex], ****************************************************************\n");
 	}
 
-	btc8821a2ant_query_bt_info(btcoexist);
-	btc8821a2ant_monitor_bt_ctr(btcoexist);
-	btc8821a2ant_monitor_wifi_ctr(btcoexist);
+	if (btcoexist->auto_report_2ant) {
+		btc8821a2ant_query_bt_info(btcoexist);
+	} else {
+		btc8821a2ant_monitor_bt_ctr(btcoexist);
+		btc8821a2ant_monitor_wifi_ctr(btcoexist);
+
+		if (btc8821a2ant_is_wifi_status_changed(btcoexist) ||
+		    coex_dm->auto_tdma_adjust)
+			btc8821a2ant_run_coexist_mechanism(btcoexist);
+	}
 }