Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 03/14] rtlwifi: rtl8821ae: Remove all instances of DBG_EMERG
From: Larry Finger @ 2016-12-11  5:45 UTC (permalink / raw)
  To: kvalo; +Cc: devel, linux-wireless, Larry Finger, Ping-Ke Shih
In-Reply-To: <20161211054523.7119-1-Larry.Finger@lwfinger.net>

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
---
 .../net/wireless/realtek/rtlwifi/rtl8821ae/dm.c    |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8821ae/fw.c    | 11 ++----
 .../net/wireless/realtek/rtlwifi/rtl8821ae/hw.c    | 15 +++-----
 .../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c   | 43 ++++++++--------------
 .../net/wireless/realtek/rtlwifi/rtl8821ae/rf.c    |  5 +--
 .../net/wireless/realtek/rtlwifi/rtl8821ae/sw.c    | 14 +++----
 6 files changed, 33 insertions(+), 58 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
index bdfd444..32900c5 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
@@ -604,8 +604,7 @@ static void rtl8821ae_dm_find_minimum_rssi(struct ieee80211_hw *hw)
 	if ((mac->link_state < MAC80211_LINKED) &&
 	    (rtlpriv->dm.entry_min_undec_sm_pwdb == 0)) {
 		rtl_dm_dig->min_undec_pwdb_for_dm = 0;
-		RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD,
-			 "Not connected to any\n");
+		pr_debug("rtl8821ae: Not connected to any AP\n");
 	}
 	if (mac->link_state >= MAC80211_LINKED) {
 		if (mac->opmode == NL80211_IFTYPE_AP ||
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
index c70face..602ac86 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
@@ -125,8 +125,7 @@ static void _rtl8821ae_write_fw(struct ieee80211_hw *hw,
 	remainsize = size % FW_8821AE_PAGE_SIZE;
 
 	if (pagenums > 8) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Page numbers should not greater then 8\n");
+		pr_err("rtl8821ae: Page numbers should not greater then 8\n");
 	}
 
 	for (page = 0; page < pagenums; page++) {
@@ -162,8 +161,8 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
 		goto exit;
 	}
 
-	RT_TRACE(rtlpriv, COMP_FW, DBG_EMERG,
-		 "Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
+	pr_err("rtl8821ae: Checksum report OK! REG_MCUFWDL:0x%08x\n",
+	       value32);
 
 	value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
 	value32 |= MCUFWDL_RDY;
@@ -186,9 +184,8 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
 		udelay(FW_8821AE_POLLING_DELAY);
 	} while (counter++ < FW_8821AE_POLLING_TIMEOUT_COUNT);
 
-	RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-		 "Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
-		 value32);
+	pr_err("rtl8821ae: Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
+	       value32);
 
 exit:
 	return err;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
index b6dc2f3..3932a5d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
@@ -822,9 +822,8 @@ static bool _rtl8821ae_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
 			break;
 
 		if (count > POLLING_LLT_THRESHOLD) {
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Failed to polling write LLT done at address %d!\n",
-				 address);
+			pr_err("rtl8821ae: Failed to polling write LLT done at address %d!\n",
+			       address);
 			status = false;
 			break;
 		}
@@ -1927,7 +1926,7 @@ int rtl8821ae_hw_init(struct ieee80211_hw *hw)
 
 	rtstatus = _rtl8821ae_init_mac(hw);
 	if (rtstatus != true) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+		pr_err("rtl8821ae: Init MAC failed\n");
 		err = 1;
 		return err;
 	}
@@ -2174,8 +2173,7 @@ static int _rtl8821ae_set_media_status(struct ieee80211_hw *hw,
 			 "Set Network type to AP!\n");
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Network type %d not support!\n", type);
+		pr_err("rtl8821ae: Network type %d not support!\n", type);
 		return 1;
 	}
 
@@ -3274,7 +3272,7 @@ void rtl8821ae_read_eeprom_info(struct ieee80211_hw *hw)
 		rtlefuse->autoload_failflag = false;
 		_rtl8821ae_read_adapter_info(hw, false);
 	} else {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+		pr_err("rtl8821ae: Autoload ERR!!\n");
 	}
 	/*hal_ReadRFType_8812A()*/
 	/* _rtl8821ae_hal_customized_behavior(hw); */
@@ -3949,8 +3947,7 @@ void rtl8821ae_set_key(struct ieee80211_hw *hw, u32 key_index,
 				if (mac->opmode == NL80211_IFTYPE_AP) {
 					entry_id = rtl_cam_get_free_entry(hw, p_macaddr);
 					if (entry_id >=  TOTAL_CAM_ENTRY) {
-						RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-							 "Can not find free hwsecurity cam entry\n");
+						pr_err("an not find free hwsecurity cam entry\n");
 						return;
 					}
 				} else {
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
index bd1a546..42c2802 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
@@ -215,7 +215,6 @@ void rtl8821ae_phy_set_rf_reg(struct ieee80211_hw *hw,
 static u32 _rtl8821ae_phy_rf_serial_read(struct ieee80211_hw *hw,
 					 enum radio_path rfpath, u32 offset)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
 	bool is_pi_mode = false;
 	u32 retvalue = 0;
@@ -223,7 +222,7 @@ static u32 _rtl8821ae_phy_rf_serial_read(struct ieee80211_hw *hw,
 	/* 2009/06/17 MH We can not execute IO for power
 	save or other accident mode.*/
 	if (RT_CANNOT_IO(hw)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+		pr_err("rtl8821ae: return all one\n");
 		return 0xFFFFFFFF;
 	}
 	/* <20120809, Kordan> CCA OFF(when entering),
@@ -284,7 +283,7 @@ static void _rtl8821ae_phy_rf_serial_write(struct ieee80211_hw *hw,
 	u32 newoffset;
 
 	if (RT_CANNOT_IO(hw)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+		pr_err("rtl8821ae: stop\n");
 		return;
 	}
 	offset &= 0xff;
@@ -1665,7 +1664,7 @@ static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw)
 	rtstatus = _rtl8821ae_phy_config_bb_with_headerfile(hw,
 						       BASEBAND_CONFIG_PHY_REG);
 	if (rtstatus != true) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Write BB Reg Fail!!\n");
+		pr_err("rtl8821ae: Write BB Reg Fail!!\n");
 		return false;
 	}
 	_rtl8821ae_phy_init_tx_power_by_rate(hw);
@@ -1674,7 +1673,7 @@ static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw)
 						    BASEBAND_CONFIG_PHY_REG);
 	}
 	if (rtstatus != true) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "BB_PG Reg Fail!!\n");
+		pr_err("rtl8821ae: BB_PG Reg Fail!!\n");
 		return false;
 	}
 
@@ -1688,7 +1687,7 @@ static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw)
 						BASEBAND_CONFIG_AGC_TAB);
 
 	if (rtstatus != true) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "AGC Table Fail\n");
+		pr_err("rtl8821ae: AGC Table Fail\n");
 		return false;
 	}
 	rtlphy->cck_high_power = (bool)(rtl_get_bbreg(hw,
@@ -2064,8 +2063,7 @@ bool rtl8812ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
 		break;
 	case RF90_PATH_C:
 	case RF90_PATH_D:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n", rfpath);
+		pr_err("rtl8821ae: switch case %#x not processed\n", rfpath);
 		break;
 	}
 	return true;
@@ -2132,8 +2130,7 @@ bool rtl8821ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
 	case RF90_PATH_B:
 	case RF90_PATH_C:
 	case RF90_PATH_D:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n", rfpath);
+		pr_err("rtl8821ae: switch case %#x not processed\n", rfpath);
 		break;
 	}
 	return true;
@@ -3336,8 +3333,7 @@ void rtl8821ae_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
 						      (u8 *)&iotype);
 			break;
 		default:
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Unknown Scan Backup operation.\n");
+			pr_err("rtl8821ae: Unknown Scan Backup operation.\n");
 			break;
 		}
 	}
@@ -3378,8 +3374,7 @@ static u8 _rtl8821ae_phy_get_secondary_chnl(struct rtl_priv *rtlpriv)
 		else if (mac->cur_80_prime_sc == PRIME_CHNL_OFFSET_UPPER)
 			sc_set_40 = VHT_DATA_SC_40_UPPER_OF_80MHZ;
 		else
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				"SCMapping: Not Correct Primary40MHz Setting\n");
+			pr_err("rtl8821ae: SCMapping: Not Correct Primary40MHz Setting\n");
 
 		if ((mac->cur_40_prime_sc == PRIME_CHNL_OFFSET_LOWER) &&
 			(mac->cur_80_prime_sc == HAL_PRIME_CHNL_OFFSET_LOWER))
@@ -3394,16 +3389,14 @@ static u8 _rtl8821ae_phy_get_secondary_chnl(struct rtl_priv *rtlpriv)
 			(mac->cur_80_prime_sc == HAL_PRIME_CHNL_OFFSET_UPPER))
 			sc_set_20 = VHT_DATA_SC_20_UPPERST_OF_80MHZ;
 		else
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				"SCMapping: Not Correct Primary40MHz Setting\n");
+			pr_err("rtl8821ae: SCMapping: Not Correct Primary40MHz Setting\n");
 	} else if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) {
 		if (mac->cur_40_prime_sc == PRIME_CHNL_OFFSET_UPPER)
 			sc_set_20 = VHT_DATA_SC_20_UPPER_OF_80MHZ;
 		else if (mac->cur_40_prime_sc == PRIME_CHNL_OFFSET_LOWER)
 			sc_set_20 = VHT_DATA_SC_20_LOWER_OF_80MHZ;
 		else
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "SCMapping: Not Correct Primary40MHz Setting\n");
+			pr_err("rtl8821ae: SCMapping: Not Correct Primary40MHz Setting\n");
 	}
 	return (sc_set_40 << 4) | sc_set_20;
 }
@@ -3479,8 +3472,7 @@ void rtl8821ae_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
 
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+		pr_err("rtl8821ae: unknown bandwidth: %#X\n",
+		       rtlphy->current_chan_bw);
 		break;
 	}
 
@@ -4660,8 +4652,8 @@ bool rtl8821ae_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
 			postprocessing = true;
 			break;
 		default:
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "switch case %#x not processed\n", iotype);
+			pr_err("rtl8821ae: switch case %#x not processed\n",
+			       iotype);
 			break;
 		}
 	} while (false);
@@ -4704,9 +4695,8 @@ static void rtl8821ae_phy_set_io(struct ieee80211_hw *hw)
 	case IO_CMD_PAUSE_BAND1_DM_BY_SCAN:
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n",
-			 rtlphy->current_io_type);
+		pr_err("rtl8821ae: switch case %#x not processed\n",
+		       rtlphy->current_io_type);
 		break;
 	}
 	rtlphy->set_io_inprogress = false;
@@ -4811,8 +4801,8 @@ static bool _rtl8821ae_phy_set_rf_power_state(struct ieee80211_hw *hw,
 		}
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n", rfpwr_state);
+		pr_err("rtl8821ae: switch case %#x not processed\n",
+		       rfpwr_state);
 		bresult = false;
 		break;
 	}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rf.c
index c6ab957..95489f4 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rf.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rf.c
@@ -34,8 +34,6 @@ static bool _rtl8821ae_phy_rf6052_config_parafile(struct ieee80211_hw *hw);
 
 void rtl8821ae_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
-
 	switch (bandwidth) {
 	case HT_CHANNEL_WIDTH_20:
 		rtl_set_rfreg(hw, RF90_PATH_A, RF_CHNLBW, BIT(11)|BIT(10), 3);
@@ -50,8 +48,7 @@ void rtl8821ae_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
 		rtl_set_rfreg(hw, RF90_PATH_B, RF_CHNLBW, BIT(11)|BIT(10), 0);
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "unknown bandwidth: %#X\n", bandwidth);
+		pr_err("rtl8821ae: unknown bandwidth: %#X\n", bandwidth);
 		break;
 	}
 }
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
index 297938e..8ec7ab2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
@@ -192,14 +192,12 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
 	/* for firmware buf */
 	rtlpriv->rtlhal.pfirmware = vzalloc(0x8000);
 	if (!rtlpriv->rtlhal.pfirmware) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't alloc buffer for fw.\n");
+		pr_err("rtl8821ae: Can't alloc buffer for fw.\n");
 		return 1;
 	}
 	rtlpriv->rtlhal.wowlan_firmware = vzalloc(0x8000);
 	if (!rtlpriv->rtlhal.wowlan_firmware) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't alloc buffer for wowlan fw.\n");
+		pr_err("rtl8821ae: Can't alloc buffer for wowlan fw.\n");
 		return 1;
 	}
 
@@ -218,8 +216,7 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
 				      rtlpriv->io.dev, GFP_KERNEL, hw,
 				      rtl_fw_cb);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Failed to request normal firmware!\n");
+		pr_err("rtl8821ae: Failed to request normal firmware!\n");
 		return 1;
 	}
 	/*load wowlan firmware*/
@@ -229,8 +226,7 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
 				      rtlpriv->io.dev, GFP_KERNEL, hw,
 				      rtl_wowlan_fw_cb);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Failed to request wowlan firmware!\n");
+		pr_err("rtl8821ae: Failed to request wowlan firmware!\n");
 		return 1;
 	}
 	return 0;
@@ -313,7 +309,7 @@ static struct rtl_mod_params rtl8821ae_mod_params = {
 	.fwctrl_lps = true,
 	.msi_support = true,
 	.int_clear = true,
-	.debug = DBG_EMERG,
+	.debug = 0,
 	.disable_watchdog = 0,
 };
 
-- 
2.10.2

^ permalink raw reply related

* [PATCH 04/14] rtlwifi_new: rtl8723be: Remove all instances of DBG_EMERG
From: Larry Finger @ 2016-12-11  5:45 UTC (permalink / raw)
  To: kvalo; +Cc: devel, linux-wireless, Larry Finger, Ping-Ke Shih
In-Reply-To: <20161211054523.7119-1-Larry.Finger@lwfinger.net>

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c  |  9 +++------
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c  | 16 ++++++----------
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c |  6 ++----
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 18 +++++++-----------
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/rf.c  |  3 +--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c  |  8 +++-----
 6 files changed, 22 insertions(+), 38 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
index 6b03c7f..71d1e89 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
@@ -97,8 +97,7 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
 	while (!bwrite_sucess) {
 		wait_writeh2c_limmit--;
 		if (wait_writeh2c_limmit == 0) {
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Write H2C fail because no trigger for FW INT!\n");
+			pr_err("Write H2C fail because no trigger for FW INT!\n");
 			break;
 		}
 
@@ -121,8 +120,7 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
 			box_extreg = REG_HMEBOX_EXT_3;
 			break;
 		default:
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "switch case %#x not processed\n", boxnum);
+			pr_err("switch case %#x not processed\n", boxnum);
 			break;
 		}
 
@@ -194,8 +192,7 @@ static void _rtl8723be_fill_h2c_command(struct ieee80211_hw *hw, u8 element_id,
 			}
 			break;
 		default:
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "switch case %#x not processed\n", cmd_len);
+			pr_err("switch case %#x not processed\n", cmd_len);
 			break;
 		}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
index 56a1ae4..ae2a38e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
@@ -747,9 +747,8 @@ static bool _rtl8723be_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
 			break;
 
 		if (count > POLLING_LLT_THRESHOLD) {
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Failed to polling write LLT done at address %d!\n",
-				 address);
+			pr_err("Failed to polling write LLT done at address %d!\n",
+			       address);
 			status = false;
 			break;
 		}
@@ -1383,7 +1382,7 @@ int rtl8723be_hw_init(struct ieee80211_hw *hw)
 	}
 	rtstatus = _rtl8723be_init_mac(hw);
 	if (!rtstatus) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+		pr_err("Init MAC failed\n");
 		err = 1;
 		goto exit;
 	}
@@ -1532,8 +1531,7 @@ static int _rtl8723be_set_media_status(struct ieee80211_hw *hw,
 			 "Set Network type to AP!\n");
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Network type %d not support!\n", type);
+		pr_err("Network type %d not support!\n", type);
 		return 1;
 	}
 
@@ -2247,7 +2245,7 @@ void rtl8723be_read_eeprom_info(struct ieee80211_hw *hw)
 		rtlefuse->autoload_failflag = false;
 		_rtl8723be_read_adapter_info(hw, false);
 	} else {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+		pr_err("Autoload ERR!!\n");
 	}
 	_rtl8723be_hal_customized_behavior(hw);
 }
@@ -2584,9 +2582,7 @@ void rtl8723be_set_key(struct ieee80211_hw *hw, u32 key_index,
 					entry_id = rtl_cam_get_free_entry(hw,
 								p_macaddr);
 					if (entry_id >=  TOTAL_CAM_ENTRY) {
-						RT_TRACE(rtlpriv, COMP_SEC,
-							 DBG_EMERG,
-							 "Can not find free hw security cam entry\n");
+						pr_err("Can not find free hw security cam entry\n");
 						return;
 					}
 				} else {
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c
index 497913e..193125b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/led.c
@@ -57,8 +57,7 @@ void rtl8723be_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled)
 		rtl_write_byte(rtlpriv, REG_LEDCFG1, ledcfg & 0x10);
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n", pled->ledpin);
+		pr_err("switch case %#x not processed\n", pled->ledpin);
 		break;
 	}
 	pled->ledon = true;
@@ -99,8 +98,7 @@ void rtl8723be_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled)
 
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n", pled->ledpin);
+		pr_err("switch case %#x not processed\n", pled->ledpin);
 		break;
 	}
 	pled->ledon = false;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
index b4e0a58..8c2b497 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
@@ -467,7 +467,7 @@ static bool _rtl8723be_phy_bb8723b_config_parafile(struct ieee80211_hw *hw)
 	rtstatus = _rtl8723be_phy_config_bb_with_headerfile(hw,
 						BASEBAND_CONFIG_PHY_REG);
 	if (!rtstatus) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Write BB Reg Fail!!\n");
+		pr_err("Write BB Reg Fail!!\n");
 		return false;
 	}
 	_rtl8723be_phy_init_tx_power_by_rate(hw);
@@ -478,13 +478,13 @@ static bool _rtl8723be_phy_bb8723b_config_parafile(struct ieee80211_hw *hw)
 	}
 	phy_txpower_by_rate_config(hw);
 	if (!rtstatus) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "BB_PG Reg Fail!!\n");
+		pr_err("BB_PG Reg Fail!!\n");
 		return false;
 	}
 	rtstatus = _rtl8723be_phy_config_bb_with_headerfile(hw,
 						BASEBAND_CONFIG_AGC_TAB);
 	if (!rtstatus) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "AGC Table Fail\n");
+		pr_err("AGC Table Fail\n");
 		return false;
 	}
 	rtlphy->cck_high_power = (bool)(rtl_get_bbreg(hw,
@@ -1249,8 +1249,7 @@ void rtl8723be_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
 						      (u8 *)&iotype);
 			break;
 		default:
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Unknown Scan Backup operation.\n");
+			pr_err("Unknown Scan Backup operation.\n");
 			break;
 		}
 	}
@@ -1291,8 +1290,7 @@ void rtl8723be_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
 		rtl_write_byte(rtlpriv, REG_RRSR + 2, reg_prsr_rsc);
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+		pr_err("unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
 		break;
 	}
 
@@ -1316,8 +1314,7 @@ void rtl8723be_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
 			       HAL_PRIME_CHNL_OFFSET_LOWER) ? 2 : 1);
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+		pr_err("unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
 		break;
 	}
 	rtl8723be_phy_rf6052_set_bandwidth(hw, rtlphy->current_chan_bw);
@@ -1462,8 +1459,7 @@ static bool _rtl8723be_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 			currentcmd = &postcommoncmd[*step];
 			break;
 		default:
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Invalid 'stage' = %d, Check it!\n", *stage);
+			pr_err("Invalid 'stage' = %d, Check it!\n", *stage);
 			return true;
 		}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/rf.c
index 78f4f18..4849145 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/rf.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/rf.c
@@ -51,8 +51,7 @@ void rtl8723be_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
 			      rtlphy->rfreg_chnlval[0]);
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "unknown bandwidth: %#X\n", bandwidth);
+		pr_err("unknown bandwidth: %#X\n", bandwidth);
 		break;
 	}
 }
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c
index 847644d..dd42c1a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c
@@ -179,8 +179,7 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw)
 	/* for firmware buf */
 	rtlpriv->rtlhal.pfirmware = vzalloc(0x8000);
 	if (!rtlpriv->rtlhal.pfirmware) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't alloc buffer for fw.\n");
+		pr_err("Can't alloc buffer for fw.\n");
 		return 1;
 	}
 
@@ -190,8 +189,7 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw)
 				      rtlpriv->io.dev, GFP_KERNEL, hw,
 				      rtl_fw_cb);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Failed to request firmware!\n");
+		pr_err("Failed to request firmware!\n");
 		return 1;
 	}
 	return 0;
@@ -273,7 +271,7 @@ static struct rtl_mod_params rtl8723be_mod_params = {
 	.fwctrl_lps = true,
 	.msi_support = false,
 	.disable_watchdog = false,
-	.debug = DBG_EMERG,
+	.debug = 0,
 	.ant_sel = 0,
 };
 
-- 
2.10.2

^ permalink raw reply related

* [PATCH 03/14] rtlwifi_new: rtl8821ae: Remove all instances of DBG_EMERG
From: Larry Finger @ 2016-12-11  5:45 UTC (permalink / raw)
  To: kvalo; +Cc: devel, linux-wireless, Larry Finger, Ping-Ke Shih
In-Reply-To: <20161211054523.7119-1-Larry.Finger@lwfinger.net>

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
---
 .../net/wireless/realtek/rtlwifi/rtl8821ae/dm.c    |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8821ae/fw.c    | 11 ++----
 .../net/wireless/realtek/rtlwifi/rtl8821ae/hw.c    | 15 +++-----
 .../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c   | 43 ++++++++--------------
 .../net/wireless/realtek/rtlwifi/rtl8821ae/rf.c    |  5 +--
 .../net/wireless/realtek/rtlwifi/rtl8821ae/sw.c    | 14 +++----
 6 files changed, 33 insertions(+), 58 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
index bdfd444..32900c5 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
@@ -604,8 +604,7 @@ static void rtl8821ae_dm_find_minimum_rssi(struct ieee80211_hw *hw)
 	if ((mac->link_state < MAC80211_LINKED) &&
 	    (rtlpriv->dm.entry_min_undec_sm_pwdb == 0)) {
 		rtl_dm_dig->min_undec_pwdb_for_dm = 0;
-		RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD,
-			 "Not connected to any\n");
+		pr_debug("rtl8821ae: Not connected to any AP\n");
 	}
 	if (mac->link_state >= MAC80211_LINKED) {
 		if (mac->opmode == NL80211_IFTYPE_AP ||
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
index e8688f4..536c12a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
@@ -125,8 +125,7 @@ static void _rtl8821ae_write_fw(struct ieee80211_hw *hw,
 	remainsize = size % FW_8821AE_PAGE_SIZE;
 
 	if (pagenums > 8) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Page numbers should not greater then 8\n");
+		pr_err("Page numbers should not greater then 8\n");
 	}
 
 	for (page = 0; page < pagenums; page++) {
@@ -162,8 +161,7 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
 		goto exit;
 	}
 
-	RT_TRACE(rtlpriv, COMP_FW, DBG_EMERG,
-		 "Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
+	pr_err("Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
 
 	value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
 	value32 |= MCUFWDL_RDY;
@@ -186,9 +184,8 @@ static int _rtl8821ae_fw_free_to_go(struct ieee80211_hw *hw)
 		udelay(FW_8821AE_POLLING_DELAY);
 	} while (counter++ < FW_8821AE_POLLING_TIMEOUT_COUNT);
 
-	RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-		 "Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
-		 value32);
+	pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n",
+	       value32);
 
 exit:
 	return err;
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
index b045dd0..259984f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
@@ -822,9 +822,8 @@ static bool _rtl8821ae_llt_write(struct ieee80211_hw *hw, u32 address, u32 data)
 			break;
 
 		if (count > POLLING_LLT_THRESHOLD) {
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Failed to polling write LLT done at address %d!\n",
-				 address);
+			pr_err("Failed to polling write LLT done at address %d!\n",
+			       address);
 			status = false;
 			break;
 		}
@@ -1927,7 +1926,7 @@ int rtl8821ae_hw_init(struct ieee80211_hw *hw)
 
 	rtstatus = _rtl8821ae_init_mac(hw);
 	if (rtstatus != true) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Init MAC failed\n");
+		pr_err("Init MAC failed\n");
 		err = 1;
 		return err;
 	}
@@ -2174,8 +2173,7 @@ static int _rtl8821ae_set_media_status(struct ieee80211_hw *hw,
 			 "Set Network type to AP!\n");
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Network type %d not support!\n", type);
+		pr_err("Network type %d not support!\n", type);
 		return 1;
 	}
 
@@ -3275,7 +3273,7 @@ void rtl8821ae_read_eeprom_info(struct ieee80211_hw *hw)
 		rtlefuse->autoload_failflag = false;
 		_rtl8821ae_read_adapter_info(hw, false);
 	} else {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Autoload ERR!!\n");
+		pr_err("Autoload ERR!!\n");
 	}
 	/*hal_ReadRFType_8812A()*/
 	/* _rtl8821ae_hal_customized_behavior(hw); */
@@ -3950,8 +3948,7 @@ void rtl8821ae_set_key(struct ieee80211_hw *hw, u32 key_index,
 				if (mac->opmode == NL80211_IFTYPE_AP) {
 					entry_id = rtl_cam_get_free_entry(hw, p_macaddr);
 					if (entry_id >=  TOTAL_CAM_ENTRY) {
-						RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-							 "Can not find free hwsecurity cam entry\n");
+						pr_err("Can not find free hwsecurity cam entry\n");
 						return;
 					}
 				} else {
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
index 7e2f7b0..8cffa6f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
@@ -215,7 +215,6 @@ void rtl8821ae_phy_set_rf_reg(struct ieee80211_hw *hw,
 static u32 _rtl8821ae_phy_rf_serial_read(struct ieee80211_hw *hw,
 					 enum radio_path rfpath, u32 offset)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
 	bool is_pi_mode = false;
 	u32 retvalue = 0;
@@ -223,7 +222,7 @@ static u32 _rtl8821ae_phy_rf_serial_read(struct ieee80211_hw *hw,
 	/* 2009/06/17 MH We can not execute IO for power
 	save or other accident mode.*/
 	if (RT_CANNOT_IO(hw)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+		pr_err("return all one\n");
 		return 0xFFFFFFFF;
 	}
 	/* <20120809, Kordan> CCA OFF(when entering),
@@ -284,7 +283,7 @@ static void _rtl8821ae_phy_rf_serial_write(struct ieee80211_hw *hw,
 	u32 newoffset;
 
 	if (RT_CANNOT_IO(hw)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+		pr_err("stop\n");
 		return;
 	}
 	offset &= 0xff;
@@ -1665,7 +1664,7 @@ static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw)
 	rtstatus = _rtl8821ae_phy_config_bb_with_headerfile(hw,
 						       BASEBAND_CONFIG_PHY_REG);
 	if (rtstatus != true) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Write BB Reg Fail!!\n");
+		pr_err("Write BB Reg Fail!!\n");
 		return false;
 	}
 	_rtl8821ae_phy_init_tx_power_by_rate(hw);
@@ -1674,7 +1673,7 @@ static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw)
 						    BASEBAND_CONFIG_PHY_REG);
 	}
 	if (rtstatus != true) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "BB_PG Reg Fail!!\n");
+		pr_err("BB_PG Reg Fail!!\n");
 		return false;
 	}
 
@@ -1688,7 +1687,7 @@ static bool _rtl8821ae_phy_bb8821a_config_parafile(struct ieee80211_hw *hw)
 						BASEBAND_CONFIG_AGC_TAB);
 
 	if (rtstatus != true) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "AGC Table Fail\n");
+		pr_err("AGC Table Fail\n");
 		return false;
 	}
 	rtlphy->cck_high_power = (bool)(rtl_get_bbreg(hw,
@@ -2064,8 +2063,7 @@ bool rtl8812ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
 		break;
 	case RF90_PATH_C:
 	case RF90_PATH_D:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n", rfpath);
+		pr_err("switch case %#x not processed\n", rfpath);
 		break;
 	}
 	return true;
@@ -2132,8 +2130,7 @@ bool rtl8821ae_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
 	case RF90_PATH_B:
 	case RF90_PATH_C:
 	case RF90_PATH_D:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n", rfpath);
+		pr_err("switch case %#x not processed\n", rfpath);
 		break;
 	}
 	return true;
@@ -3336,8 +3333,7 @@ void rtl8821ae_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
 						      (u8 *)&iotype);
 			break;
 		default:
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Unknown Scan Backup operation.\n");
+			pr_err("Unknown Scan Backup operation.\n");
 			break;
 		}
 	}
@@ -3378,8 +3374,7 @@ static u8 _rtl8821ae_phy_get_secondary_chnl(struct rtl_priv *rtlpriv)
 		else if (mac->cur_80_prime_sc == PRIME_CHNL_OFFSET_UPPER)
 			sc_set_40 = VHT_DATA_SC_40_UPPER_OF_80MHZ;
 		else
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				"SCMapping: Not Correct Primary40MHz Setting\n");
+			pr_err("SCMapping: Not Correct Primary40MHz Setting\n");
 
 		if ((mac->cur_40_prime_sc == PRIME_CHNL_OFFSET_LOWER) &&
 			(mac->cur_80_prime_sc == HAL_PRIME_CHNL_OFFSET_LOWER))
@@ -3394,16 +3389,14 @@ static u8 _rtl8821ae_phy_get_secondary_chnl(struct rtl_priv *rtlpriv)
 			(mac->cur_80_prime_sc == HAL_PRIME_CHNL_OFFSET_UPPER))
 			sc_set_20 = VHT_DATA_SC_20_UPPERST_OF_80MHZ;
 		else
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				"SCMapping: Not Correct Primary40MHz Setting\n");
+			pr_err("SCMapping: Not Correct Primary40MHz Setting\n");
 	} else if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) {
 		if (mac->cur_40_prime_sc == PRIME_CHNL_OFFSET_UPPER)
 			sc_set_20 = VHT_DATA_SC_20_UPPER_OF_80MHZ;
 		else if (mac->cur_40_prime_sc == PRIME_CHNL_OFFSET_LOWER)
 			sc_set_20 = VHT_DATA_SC_20_LOWER_OF_80MHZ;
 		else
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "SCMapping: Not Correct Primary40MHz Setting\n");
+			pr_err("SCMapping: Not Correct Primary40MHz Setting\n");
 	}
 	return (sc_set_40 << 4) | sc_set_20;
 }
@@ -3479,8 +3472,7 @@ void rtl8821ae_phy_set_bw_mode_callback(struct ieee80211_hw *hw)
 
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
+		pr_err("unknown bandwidth: %#X\n", rtlphy->current_chan_bw);
 		break;
 	}
 
@@ -4660,8 +4652,7 @@ bool rtl8821ae_phy_set_io_cmd(struct ieee80211_hw *hw, enum io_type iotype)
 			postprocessing = true;
 			break;
 		default:
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "switch case %#x not processed\n", iotype);
+			pr_err("switch case %#x not processed\n", iotype);
 			break;
 		}
 	} while (false);
@@ -4704,9 +4695,8 @@ static void rtl8821ae_phy_set_io(struct ieee80211_hw *hw)
 	case IO_CMD_PAUSE_BAND1_DM_BY_SCAN:
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n",
-			 rtlphy->current_io_type);
+		pr_err("switch case %#x not processed\n",
+		       rtlphy->current_io_type);
 		break;
 	}
 	rtlphy->set_io_inprogress = false;
@@ -4811,8 +4801,7 @@ static bool _rtl8821ae_phy_set_rf_power_state(struct ieee80211_hw *hw,
 		}
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n", rfpwr_state);
+		pr_err("switch case %#x not processed\n", rfpwr_state);
 		bresult = false;
 		break;
 	}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rf.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rf.c
index c6ab957..95489f4 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rf.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rf.c
@@ -34,8 +34,6 @@ static bool _rtl8821ae_phy_rf6052_config_parafile(struct ieee80211_hw *hw);
 
 void rtl8821ae_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
-
 	switch (bandwidth) {
 	case HT_CHANNEL_WIDTH_20:
 		rtl_set_rfreg(hw, RF90_PATH_A, RF_CHNLBW, BIT(11)|BIT(10), 3);
@@ -50,8 +48,7 @@ void rtl8821ae_phy_rf6052_set_bandwidth(struct ieee80211_hw *hw, u8 bandwidth)
 		rtl_set_rfreg(hw, RF90_PATH_B, RF_CHNLBW, BIT(11)|BIT(10), 0);
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "unknown bandwidth: %#X\n", bandwidth);
+		pr_err("unknown bandwidth: %#X\n", bandwidth);
 		break;
 	}
 }
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
index 297938e..8ec7ab2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
@@ -192,14 +192,12 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
 	/* for firmware buf */
 	rtlpriv->rtlhal.pfirmware = vzalloc(0x8000);
 	if (!rtlpriv->rtlhal.pfirmware) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't alloc buffer for fw.\n");
+		pr_err("rtl8821ae: Can't alloc buffer for fw.\n");
 		return 1;
 	}
 	rtlpriv->rtlhal.wowlan_firmware = vzalloc(0x8000);
 	if (!rtlpriv->rtlhal.wowlan_firmware) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't alloc buffer for wowlan fw.\n");
+		pr_err("rtl8821ae: Can't alloc buffer for wowlan fw.\n");
 		return 1;
 	}
 
@@ -218,8 +216,7 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
 				      rtlpriv->io.dev, GFP_KERNEL, hw,
 				      rtl_fw_cb);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Failed to request normal firmware!\n");
+		pr_err("rtl8821ae: Failed to request normal firmware!\n");
 		return 1;
 	}
 	/*load wowlan firmware*/
@@ -229,8 +226,7 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
 				      rtlpriv->io.dev, GFP_KERNEL, hw,
 				      rtl_wowlan_fw_cb);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Failed to request wowlan firmware!\n");
+		pr_err("rtl8821ae: Failed to request wowlan firmware!\n");
 		return 1;
 	}
 	return 0;
@@ -313,7 +309,7 @@ static struct rtl_mod_params rtl8821ae_mod_params = {
 	.fwctrl_lps = true,
 	.msi_support = true,
 	.int_clear = true,
-	.debug = DBG_EMERG,
+	.debug = 0,
 	.disable_watchdog = 0,
 };
 
-- 
2.10.2

^ permalink raw reply related

* [PATCH 02/14] rtlwifi: Remove RT_TRACE messages that use DBG_EMERG
From: Larry Finger @ 2016-12-11  5:45 UTC (permalink / raw)
  To: kvalo; +Cc: devel, linux-wireless, Larry Finger, Ping-Ke Shih
In-Reply-To: <20161211054523.7119-1-Larry.Finger@lwfinger.net>

These messages are always logged and represent error conditions, thus
we can use pr_err().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtlwifi/base.c  | 14 +++------
 drivers/net/wireless/realtek/rtlwifi/cam.c   | 14 +++------
 drivers/net/wireless/realtek/rtlwifi/core.c  | 20 +++++-------
 drivers/net/wireless/realtek/rtlwifi/efuse.c |  3 +-
 drivers/net/wireless/realtek/rtlwifi/pci.c   | 36 ++++++++--------------
 drivers/net/wireless/realtek/rtlwifi/ps.c    |  3 +-
 drivers/net/wireless/realtek/rtlwifi/rc.c    |  3 +-
 drivers/net/wireless/realtek/rtlwifi/usb.c   | 46 +++++++++-------------------
 8 files changed, 47 insertions(+), 92 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
index 4ac928b..0a8553e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -207,8 +207,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw,
 	 *highest supported RX rate
 	 */
 	if (rtlpriv->dm.supp_phymode_switch) {
-		RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-			 "Support phy mode switch\n");
+		pr_info("Support phy mode switch\n");
 
 		ht_cap->mcs.rx_mask[0] = 0xFF;
 		ht_cap->mcs.rx_mask[1] = 0xFF;
@@ -389,8 +388,8 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
 			/* <4> set mac->sband to wiphy->sband */
 			hw->wiphy->bands[NL80211_BAND_5GHZ] = sband;
 		} else {
-			RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Err BAND %d\n",
-				 rtlhal->current_bandtype);
+			pr_err("rtlwifi: Err BAND %d\n",
+			       rtlhal->current_bandtype);
 		}
 	}
 	/* <5> set hw caps */
@@ -544,7 +542,7 @@ int rtl_init_core(struct ieee80211_hw *hw)
 	 * mac80211 hw  in _rtl_init_mac80211.
 	 */
 	if (rtl_regd_init(hw, rtl_reg_notifier)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "REGD init failed\n");
+		pr_err("rtlwifi: REGD init failed\n");
 		return 1;
 	}
 
@@ -1694,8 +1692,7 @@ void rtl_watchdog_wq_callback(void *data)
 			 * we should reconnect this AP
 			 */
 			if (rtlpriv->link_info.roam_times >= 5) {
-				RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-					 "AP off, try to reconnect now\n");
+				pr_err("rtlwifi: AP off, try to reconnect now\n");
 				rtlpriv->link_info.roam_times = 0;
 				ieee80211_connection_loss(
 					rtlpriv->mac80211.vif);
@@ -1886,8 +1883,7 @@ void rtl_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
 						      (u8 *)&iotype);
 			break;
 		default:
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Unknown Scan Backup operation.\n");
+			pr_err("rtlwifi: Unknown Scan Backup operation.\n");
 			break;
 		}
 	}
diff --git a/drivers/net/wireless/realtek/rtlwifi/cam.c b/drivers/net/wireless/realtek/rtlwifi/cam.c
index 8fe8b4c..a0605d8 100644
--- a/drivers/net/wireless/realtek/rtlwifi/cam.c
+++ b/drivers/net/wireless/realtek/rtlwifi/cam.c
@@ -285,8 +285,7 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 *sta_addr)
 	u8 i, *addr;
 
 	if (NULL == sta_addr) {
-		RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-			 "sta_addr is NULL.\n");
+		pr_err("rtlwifi: sta_addr is NULL.\n");
 		return TOTAL_CAM_ENTRY;
 	}
 	/* Does STA already exist? */
@@ -298,9 +297,8 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 *sta_addr)
 	/* Get a free CAM entry. */
 	for (entry_idx = 4; entry_idx < TOTAL_CAM_ENTRY; entry_idx++) {
 		if ((bitmap & BIT(0)) == 0) {
-			RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-				 "-----hwsec_cam_bitmap: 0x%x entry_idx=%d\n",
-				 rtlpriv->sec.hwsec_cam_bitmap, entry_idx);
+			pr_err("rtlwifi: -----hwsec_cam_bitmap: 0x%x entry_idx=%d\n",
+			       rtlpriv->sec.hwsec_cam_bitmap, entry_idx);
 			rtlpriv->sec.hwsec_cam_bitmap |= BIT(0) << entry_idx;
 			memcpy(rtlpriv->sec.hwsec_cam_sta_addr[entry_idx],
 			       sta_addr, ETH_ALEN);
@@ -319,14 +317,12 @@ void rtl_cam_del_entry(struct ieee80211_hw *hw, u8 *sta_addr)
 	u8 i, *addr;
 
 	if (NULL == sta_addr) {
-		RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-			 "sta_addr is NULL.\n");
+		pr_err("rtlwifi: sta_addr is NULL.\n");
 		return;
 	}
 
 	if (is_zero_ether_addr(sta_addr)) {
-		RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-			 "sta_addr is %pM\n", sta_addr);
+		pr_err("rtlwifi: sta_addr is %pM\n", sta_addr);
 		return;
 	}
 	/* Does STA already exist? */
diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
index 6aad64c..77d7baa 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -117,8 +117,7 @@ static void rtl_fw_do_work(const struct firmware *firmware, void *context,
 	}
 found_alt:
 	if (firmware->size > rtlpriv->max_fw_size) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Firmware is too big!\n");
+		pr_err("rtlwifi: Firmware is too big!\n");
 		release_firmware(firmware);
 		return;
 	}
@@ -303,8 +302,8 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
 				(u8 *)(&mac->basic_rates));
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "operation mode %d is not support!\n", vif->type);
+		pr_err("rtlwifi: operation mode %d is not supported!\n",
+		       vif->type);
 		err = -EOPNOTSUPP;
 		goto out;
 	}
@@ -764,9 +762,8 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
 			default:
 					mac->bw_40 = false;
 					mac->bw_80 = false;
-					RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-						 "switch case %#x not processed\n",
-						 channel_type);
+					pr_err("rtlwifi: switch case %#x not processed\n",
+					       channel_type);
 					break;
 			}
 		}
@@ -1399,8 +1396,7 @@ static int rtl_op_ampdu_action(struct ieee80211_hw *hw,
 			 "IEEE80211_AMPDU_RX_STOP:TID:%d\n", tid);
 		return rtl_rx_agg_stop(hw, sta, tid);
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "IEEE80211_AMPDU_ERR!!!!:\n");
+		pr_err("rtlwifi: IEEE80211_AMPDU_ERR!!!!:\n");
 		return -EOPNOTSUPP;
 	}
 	return 0;
@@ -1536,8 +1532,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 		err = -EOPNOTSUPP;
 		goto out_unlock;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "alg_err:%x!!!!:\n", key->cipher);
+		pr_err("rtlwifi: alg_err:%x!!!!:\n", key->cipher);
 		goto out_unlock;
 	}
 	if (key_type == WEP40_ENCRYPTION ||
@@ -1662,8 +1657,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 		rtl_cam_delete_one_entry(hw, mac_addr, key_idx);
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "cmd_err:%x!!!!:\n", cmd);
+		pr_err("rtlwifi: cmd_err:%x!!!!:\n", cmd);
 	}
 out_unlock:
 	mutex_unlock(&rtlpriv->locks.conf_mutex);
diff --git a/drivers/net/wireless/realtek/rtlwifi/efuse.c b/drivers/net/wireless/realtek/rtlwifi/efuse.c
index 7becfef..afc7550 100644
--- a/drivers/net/wireless/realtek/rtlwifi/efuse.c
+++ b/drivers/net/wireless/realtek/rtlwifi/efuse.c
@@ -1259,8 +1259,7 @@ int rtl_get_hwinfo(struct ieee80211_hw *hw, struct rtl_priv *rtlpriv,
 		break;
 
 	case EEPROM_93C46:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "RTL8XXX did not boot from eeprom, check it !!\n");
+		pr_err("rtlwifi: RTL8XXX did not boot from eeprom, check it !!\n");
 		return 1;
 
 	default:
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
index 661c66f..f8bfa73 100644
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -174,9 +174,8 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw)
 		}
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n",
-			 rtlpci->const_support_pciaspm);
+		pr_err("rtlwifi: switch case %#x not processed\n",
+		       rtlpci->const_support_pciaspm);
 		break;
 	}
 
@@ -1247,9 +1246,8 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
 					 &buffer_desc_dma);
 
 		if (!buffer_desc || (unsigned long)buffer_desc & 0xFF) {
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Cannot allocate TX ring (prio = %d)\n",
-				 prio);
+			pr_err("rtlwifi: Cannot allocate TX ring (prio = %d)\n",
+			       prio);
 			return -ENOMEM;
 		}
 
@@ -1266,8 +1264,7 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
 				     sizeof(*desc) * entries, &desc_dma);
 
 	if (!desc || (unsigned long)desc & 0xFF) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Cannot allocate TX ring (prio = %d)\n", prio);
+		pr_err("rtlwifi: Cannot allocate TX ring (prio = %d)\n", prio);
 		return -ENOMEM;
 	}
 
@@ -1314,8 +1311,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
 					  &rtlpci->rx_ring[rxring_idx].dma);
 		if (!rtlpci->rx_ring[rxring_idx].buffer_desc ||
 		    (ulong)rtlpci->rx_ring[rxring_idx].buffer_desc & 0xFF) {
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Cannot allocate RX ring\n");
+			pr_err("rtlwifi: Cannot allocate RX ring\n");
 			return -ENOMEM;
 		}
 
@@ -1338,8 +1334,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
 					  &rtlpci->rx_ring[rxring_idx].dma);
 		if (!rtlpci->rx_ring[rxring_idx].desc ||
 		    (unsigned long)rtlpci->rx_ring[rxring_idx].desc & 0xFF) {
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Cannot allocate RX ring\n");
+			pr_err("rtlwifi: Cannot allocate RX ring\n");
 			return -ENOMEM;
 		}
 
@@ -1799,15 +1794,13 @@ static void rtl_pci_deinit(struct ieee80211_hw *hw)
 
 static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	int err;
 
 	_rtl_pci_init_struct(hw, pdev);
 
 	err = _rtl_pci_init_trx_ring(hw);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "tx ring initialization failed\n");
+		pr_err("rtlwifi: tx ring initialization failed\n");
 		return err;
 	}
 
@@ -2275,7 +2268,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
 	rtlpriv->cfg->ops->read_eeprom_info(hw);
 
 	if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
+		pr_err("rtlwifi: Can't init_sw_vars\n");
 		err = -ENODEV;
 		goto fail3;
 	}
@@ -2287,22 +2280,20 @@ int rtl_pci_probe(struct pci_dev *pdev,
 	/* Init mac80211 sw */
 	err = rtl_init_core(hw);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't allocate sw for mac80211\n");
+		pr_err("rtlwifi: Can't allocate sw for mac80211\n");
 		goto fail3;
 	}
 
 	/* Init PCI sw */
 	err = rtl_pci_init(hw, pdev);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Failed to init PCI\n");
+		pr_err("rtlwifi: Failed to init PCI\n");
 		goto fail3;
 	}
 
 	err = ieee80211_register_hw(hw);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't register mac80211 hw.\n");
+		pr_err("rtlwifi: Can't register mac80211 hw.\n");
 		err = -ENODEV;
 		goto fail3;
 	}
@@ -2310,8 +2301,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
 
 	err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "failed to create sysfs device attributes\n");
+		pr_err("rtlwifi: failed to create sysfs device attributes\n");
 		goto fail3;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c
index d0ffc4d..4f83270 100644
--- a/drivers/net/wireless/realtek/rtlwifi/ps.c
+++ b/drivers/net/wireless/realtek/rtlwifi/ps.c
@@ -150,8 +150,7 @@ static bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
 		break;
 
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n", state_toset);
+		pr_err("rtlwifi: switch case %#x not processed\n", state_toset);
 		break;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rc.c b/drivers/net/wireless/realtek/rtlwifi/rc.c
index ce8621a..951d257 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rc.c
@@ -267,8 +267,7 @@ static void *rtl_rate_alloc_sta(void *ppriv,
 
 	rate_priv = kzalloc(sizeof(struct rtl_rate_priv), gfp);
 	if (!rate_priv) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Unable to allocate private rc structure\n");
+		pr_err("rtlwifi: Unable to allocate private rc structure\n");
 		return NULL;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c
index dc58aa6..14d68e9 100644
--- a/drivers/net/wireless/realtek/rtlwifi/usb.c
+++ b/drivers/net/wireless/realtek/rtlwifi/usb.c
@@ -421,14 +421,12 @@ static void _rtl_rx_completed(struct urb *urb);
 static int _rtl_prep_rx_urb(struct ieee80211_hw *hw, struct rtl_usb *rtlusb,
 			      struct urb *urb, gfp_t gfp_mask)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	void *buf;
 
 	buf = usb_alloc_coherent(rtlusb->udev, rtlusb->rx_max_size, gfp_mask,
 				 &urb->transfer_dma);
 	if (!buf) {
-		RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-			 "Failed to usb_alloc_coherent!!\n");
+		pr_err("rtlwifi: Failed to usb_alloc_coherent!!\n");
 		return -ENOMEM;
 	}
 
@@ -613,8 +611,6 @@ static unsigned int _rtl_rx_get_padding(struct ieee80211_hdr *hdr,
 static void _rtl_rx_completed(struct urb *_urb)
 {
 	struct rtl_usb *rtlusb = (struct rtl_usb *)_urb->context;
-	struct ieee80211_hw *hw = usb_get_intfdata(rtlusb->intf);
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	int err = 0;
 
 	if (unlikely(IS_USB_STOP(rtlusb)))
@@ -628,17 +624,15 @@ static void _rtl_rx_completed(struct urb *_urb)
 		struct ieee80211_hdr *hdr;
 
 		if (size < RTL_RX_DESC_SIZE + sizeof(struct ieee80211_hdr)) {
-			RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-				 "Too short packet from bulk IN! (len: %d)\n",
-				 size);
+			pr_err("rtlwifi: Too short packet from bulk IN! (len: %d)\n",
+			       size);
 			goto resubmit;
 		}
 
 		qlen = skb_queue_len(&rtlusb->rx_queue);
 		if (qlen >= __RX_SKB_MAX_QUEUED) {
-			RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-				 "Pending RX skbuff queue full! (qlen: %d)\n",
-				 qlen);
+			pr_err("rtlwifi: Pending RX skbuff queue full! (qlen: %d)\n",
+			       qlen);
 			goto resubmit;
 		}
 
@@ -647,8 +641,7 @@ static void _rtl_rx_completed(struct urb *_urb)
 
 		skb = dev_alloc_skb(size + __RADIO_TAP_SIZE_RSV + padding);
 		if (!skb) {
-			RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-				 "Can't allocate skb for bulk IN!\n");
+			pr_err("rtlwifi: Can't allocate skb for bulk IN!\n");
 			goto resubmit;
 		}
 
@@ -725,7 +718,6 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)
 	struct urb *urb;
 	int err;
 	int i;
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
 
 	WARN_ON(0 == rtlusb->rx_urb_num);
@@ -740,8 +732,7 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)
 
 		err = _rtl_prep_rx_urb(hw, rtlusb, urb, GFP_KERNEL);
 		if (err < 0) {
-			RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-				 "Failed to prep_rx_urb!!\n");
+			pr_err("rtlwifi: Failed to prep_rx_urb!!\n");
 			usb_free_urb(urb);
 			goto err_out;
 		}
@@ -839,7 +830,6 @@ static void rtl_usb_stop(struct ieee80211_hw *hw)
 static void _rtl_submit_tx_urb(struct ieee80211_hw *hw, struct urb *_urb)
 {
 	int err;
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
 
 	usb_anchor_urb(_urb, &rtlusb->tx_submitted);
@@ -847,8 +837,7 @@ static void _rtl_submit_tx_urb(struct ieee80211_hw *hw, struct urb *_urb)
 	if (err < 0) {
 		struct sk_buff *skb;
 
-		RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-			 "Failed to submit urb\n");
+		pr_err("rtlwifi: Failed to submit urb\n");
 		usb_unanchor_urb(_urb);
 		skb = (struct sk_buff *)_urb->context;
 		kfree_skb(skb);
@@ -859,7 +848,6 @@ static void _rtl_submit_tx_urb(struct ieee80211_hw *hw, struct urb *_urb)
 static int _usb_tx_post(struct ieee80211_hw *hw, struct urb *urb,
 			struct sk_buff *skb)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
 	struct ieee80211_tx_info *txinfo;
 
@@ -870,8 +858,7 @@ static int _usb_tx_post(struct ieee80211_hw *hw, struct urb *urb,
 	txinfo->flags |= IEEE80211_TX_STAT_ACK;
 
 	if (urb->status) {
-		RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-			 "Urb has error status 0x%X\n", urb->status);
+		pr_err("rtlwifi: Urb has error status 0x%X\n", urb->status);
 		goto out;
 	}
 	/*  TODO:	statistics */
@@ -919,7 +906,6 @@ static struct urb *_rtl_usb_tx_urb_setup(struct ieee80211_hw *hw,
 static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
 		       enum rtl_txq qnum)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
 	u32 ep_num;
 	struct urb *_urb = NULL;
@@ -927,8 +913,7 @@ static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
 
 	WARN_ON(NULL == rtlusb->usb_tx_aggregate_hdl);
 	if (unlikely(IS_USB_STOP(rtlusb))) {
-		RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-			 "USB device is stopping...\n");
+		pr_err("rtlwifi: USB device is stopping...\n");
 		kfree_skb(skb);
 		return;
 	}
@@ -936,8 +921,7 @@ static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
 	_skb = skb;
 	_urb = _rtl_usb_tx_urb_setup(hw, _skb, ep_num);
 	if (unlikely(!_urb)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't allocate urb. Drop skb!\n");
+		pr_err("rtlwifi: Can't allocate urb. Drop skb!\n");
 		kfree_skb(skb);
 		return;
 	}
@@ -1102,20 +1086,18 @@ int rtl_usb_probe(struct usb_interface *intf,
 	/* Init mac80211 sw */
 	err = rtl_init_core(hw);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't allocate sw for mac80211\n");
+		pr_err("rtlwifi: Can't allocate sw for mac80211\n");
 		goto error_out;
 	}
 	if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
+		pr_err("rtlwifi: Can't init_sw_vars\n");
 		goto error_out;
 	}
 	rtlpriv->cfg->ops->init_sw_leds(hw);
 
 	err = ieee80211_register_hw(hw);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't register mac80211 hw.\n");
+		pr_err("rtlwifi: Can't register mac80211 hw.\n");
 		err = -ENODEV;
 		goto error_out;
 	}
-- 
2.10.2

^ permalink raw reply related

* [PATCH 02/14] rtlwifi_new: Remove RT_TRACE messages that use DBG_EMERG
From: Larry Finger @ 2016-12-11  5:44 UTC (permalink / raw)
  To: kvalo; +Cc: devel, linux-wireless, Larry Finger, Ping-Ke Shih
In-Reply-To: <20161211054523.7119-1-Larry.Finger@lwfinger.net>

These messages are always logged and reprresent error conditions, thus
we can use pr_err().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtlwifi/base.c  | 15 ++++-----
 drivers/net/wireless/realtek/rtlwifi/cam.c   | 14 +++------
 drivers/net/wireless/realtek/rtlwifi/core.c  | 21 +++++--------
 drivers/net/wireless/realtek/rtlwifi/debug.c |  9 ++----
 drivers/net/wireless/realtek/rtlwifi/debug.h |  2 +-
 drivers/net/wireless/realtek/rtlwifi/efuse.c |  3 +-
 drivers/net/wireless/realtek/rtlwifi/pci.c   | 36 ++++++++--------------
 drivers/net/wireless/realtek/rtlwifi/ps.c    |  3 +-
 drivers/net/wireless/realtek/rtlwifi/rc.c    |  3 +-
 drivers/net/wireless/realtek/rtlwifi/usb.c   | 46 +++++++++-------------------
 10 files changed, 53 insertions(+), 99 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
index 4ac928b..e7346cd 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -207,8 +207,7 @@ static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw,
 	 *highest supported RX rate
 	 */
 	if (rtlpriv->dm.supp_phymode_switch) {
-		RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG,
-			 "Support phy mode switch\n");
+		pr_err("rtlwifi: Support phy mode switch\n");
 
 		ht_cap->mcs.rx_mask[0] = 0xFF;
 		ht_cap->mcs.rx_mask[1] = 0xFF;
@@ -389,8 +388,8 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
 			/* <4> set mac->sband to wiphy->sband */
 			hw->wiphy->bands[NL80211_BAND_5GHZ] = sband;
 		} else {
-			RT_TRACE(rtlpriv, COMP_INIT, DBG_EMERG, "Err BAND %d\n",
-				 rtlhal->current_bandtype);
+			pr_err("rtlwifi: Err BAND %d\n",
+			       rtlhal->current_bandtype);
 		}
 	}
 	/* <5> set hw caps */
@@ -544,7 +543,7 @@ int rtl_init_core(struct ieee80211_hw *hw)
 	 * mac80211 hw  in _rtl_init_mac80211.
 	 */
 	if (rtl_regd_init(hw, rtl_reg_notifier)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "REGD init failed\n");
+		pr_err("rtlwifi: REGD init failed\n");
 		return 1;
 	}
 
@@ -1694,8 +1693,7 @@ void rtl_watchdog_wq_callback(void *data)
 			 * we should reconnect this AP
 			 */
 			if (rtlpriv->link_info.roam_times >= 5) {
-				RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-					 "AP off, try to reconnect now\n");
+				pr_err("rtlwifi: AP off, try to reconnect now\n");
 				rtlpriv->link_info.roam_times = 0;
 				ieee80211_connection_loss(
 					rtlpriv->mac80211.vif);
@@ -1886,8 +1884,7 @@ void rtl_phy_scan_operation_backup(struct ieee80211_hw *hw, u8 operation)
 						      (u8 *)&iotype);
 			break;
 		default:
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Unknown Scan Backup operation.\n");
+			pr_err("rtlwifi: Unknown Scan Backup operation.\n");
 			break;
 		}
 	}
diff --git a/drivers/net/wireless/realtek/rtlwifi/cam.c b/drivers/net/wireless/realtek/rtlwifi/cam.c
index 8fe8b4c..ed67694 100644
--- a/drivers/net/wireless/realtek/rtlwifi/cam.c
+++ b/drivers/net/wireless/realtek/rtlwifi/cam.c
@@ -285,8 +285,7 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 *sta_addr)
 	u8 i, *addr;
 
 	if (NULL == sta_addr) {
-		RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-			 "sta_addr is NULL.\n");
+		pr_err("rtlwifi: sta_addr is NULL.\n");
 		return TOTAL_CAM_ENTRY;
 	}
 	/* Does STA already exist? */
@@ -298,9 +297,8 @@ u8 rtl_cam_get_free_entry(struct ieee80211_hw *hw, u8 *sta_addr)
 	/* Get a free CAM entry. */
 	for (entry_idx = 4; entry_idx < TOTAL_CAM_ENTRY; entry_idx++) {
 		if ((bitmap & BIT(0)) == 0) {
-			RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-				 "-----hwsec_cam_bitmap: 0x%x entry_idx=%d\n",
-				 rtlpriv->sec.hwsec_cam_bitmap, entry_idx);
+			pr_err("rtlwifi: -----hwsec_cam_bitmap: 0x%x entry_idx=%d\n",
+			       rtlpriv->sec.hwsec_cam_bitmap, entry_idx);
 			rtlpriv->sec.hwsec_cam_bitmap |= BIT(0) << entry_idx;
 			memcpy(rtlpriv->sec.hwsec_cam_sta_addr[entry_idx],
 			       sta_addr, ETH_ALEN);
@@ -319,14 +317,12 @@ void rtl_cam_del_entry(struct ieee80211_hw *hw, u8 *sta_addr)
 	u8 i, *addr;
 
 	if (NULL == sta_addr) {
-		RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-			 "sta_addr is NULL.\n");
+		pr_err("rtlwifi: sta_addr is NULL.\n");
 		return;
 	}
 
 	if (is_zero_ether_addr(sta_addr)) {
-		RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
-			 "sta_addr is %pM\n", sta_addr);
+		pr_err("rtlwifi: sta_addr is %pM\n", sta_addr);
 		return;
 	}
 	/* Does STA already exist? */
diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
index 7ae774d..36ee812 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -117,8 +117,7 @@ static void rtl_fw_do_work(const struct firmware *firmware, void *context,
 	}
 found_alt:
 	if (firmware->size > rtlpriv->max_fw_size) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Firmware is too big!\n");
+		pr_err("rtlwifi: Firmware is too big!\n");
 		release_firmware(firmware);
 		return;
 	}
@@ -303,8 +302,8 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
 				(u8 *)(&mac->basic_rates));
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "operation mode %d is not support!\n", vif->type);
+		pr_err("rtlwifi: operation mode %d is not support!\n",
+		       vif->type);
 		err = -EOPNOTSUPP;
 		goto out;
 	}
@@ -764,9 +763,8 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
 			default:
 					mac->bw_40 = false;
 					mac->bw_80 = false;
-					RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-						 "switch case %#x not processed\n",
-						 channel_type);
+					pr_err("rtlwifi: switch case %#x not processed\n",
+					       channel_type);
 					break;
 			}
 		}
@@ -1399,8 +1397,7 @@ static int rtl_op_ampdu_action(struct ieee80211_hw *hw,
 			 "IEEE80211_AMPDU_RX_STOP:TID:%d\n", tid);
 		return rtl_rx_agg_stop(hw, sta, tid);
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "IEEE80211_AMPDU_ERR!!!!:\n");
+		pr_err("rtlwifi: IEEE80211_AMPDU_ERR!!!!:\n");
 		return -EOPNOTSUPP;
 	}
 	return 0;
@@ -1536,8 +1533,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 		err = -EOPNOTSUPP;
 		goto out_unlock;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "alg_err:%x!!!!:\n", key->cipher);
+		pr_err("rtlwifi: alg_err:%x!!!!:\n", key->cipher);
 		goto out_unlock;
 	}
 	if (key_type == WEP40_ENCRYPTION ||
@@ -1662,8 +1658,7 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 		rtl_cam_delete_one_entry(hw, mac_addr, key_idx);
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "cmd_err:%x!!!!:\n", cmd);
+		pr_err("rtlwifi: cmd_err:%x!!!!:\n", cmd);
 	}
 out_unlock:
 	mutex_unlock(&rtlpriv->locks.conf_mutex);
diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.c b/drivers/net/wireless/realtek/rtlwifi/debug.c
index 33905bb..0b3e516 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.c
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.c
@@ -41,16 +41,13 @@ void rtl_dbgp_flag_init(struct ieee80211_hw *hw)
 	    COMP_EASY_CONCURRENT | COMP_EFUSE | COMP_QOS | COMP_MAC80211 |
 	    COMP_REGD | COMP_CHAN | COMP_BT_COEXIST;
 
-
 	for (i = 0; i < DBGP_TYPE_MAX; i++)
 		rtlpriv->dbg.dbgp_type[i] = 0;
-
-	/*Init Debug flag enable condition */
-}
+};
 EXPORT_SYMBOL_GPL(rtl_dbgp_flag_init);
 
 #ifdef CONFIG_RTLWIFI_DEBUG
-void _rtl_dbg_trace(struct rtl_priv *rtlpriv, int comp, int level,
+void _rtl_dbg_trace(struct rtl_priv *rtlpriv, u64 comp, int level,
 		    const char *modname, const char *fmt, ...)
 {
 	if (unlikely((comp & rtlpriv->dbg.global_debugcomponents) &&
@@ -70,6 +67,6 @@ void _rtl_dbg_trace(struct rtl_priv *rtlpriv, int comp, int level,
 
 		va_end(args);
 	}
-}
+};
 EXPORT_SYMBOL_GPL(_rtl_dbg_trace);
 #endif
diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.h b/drivers/net/wireless/realtek/rtlwifi/debug.h
index 6f2e2b9..51794bc 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.h
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.h
@@ -169,7 +169,7 @@ enum dbgp_flag_e {
 struct rtl_priv;
 
 __printf(5, 6)
-void _rtl_dbg_trace(struct rtl_priv *rtlpriv, int comp, int level,
+void _rtl_dbg_trace(struct rtl_priv *rtlpriv, u64 comp, int level,
 		    const char *modname, const char *fmt, ...);
 
 #define RT_TRACE(rtlpriv, comp, level, fmt, ...)			\
diff --git a/drivers/net/wireless/realtek/rtlwifi/efuse.c b/drivers/net/wireless/realtek/rtlwifi/efuse.c
index 7becfef..afc7550 100644
--- a/drivers/net/wireless/realtek/rtlwifi/efuse.c
+++ b/drivers/net/wireless/realtek/rtlwifi/efuse.c
@@ -1259,8 +1259,7 @@ int rtl_get_hwinfo(struct ieee80211_hw *hw, struct rtl_priv *rtlpriv,
 		break;
 
 	case EEPROM_93C46:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "RTL8XXX did not boot from eeprom, check it !!\n");
+		pr_err("RTL8XXX did not boot from eeprom, check it !!\n");
 		return 1;
 
 	default:
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
index bb767186..7efe683 100644
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -174,9 +174,8 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw)
 		}
 		break;
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n",
-			 rtlpci->const_support_pciaspm);
+		pr_err("rtlwifi: switch case %#x not processed\n",
+		       rtlpci->const_support_pciaspm);
 		break;
 	}
 
@@ -1247,9 +1246,8 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
 					 &buffer_desc_dma);
 
 		if (!buffer_desc || (unsigned long)buffer_desc & 0xFF) {
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Cannot allocate TX ring (prio = %d)\n",
-				 prio);
+			pr_err("rtlwifi: Cannot allocate TX ring (prio = %d)\n",
+			       prio);
 			return -ENOMEM;
 		}
 
@@ -1266,8 +1264,7 @@ static int _rtl_pci_init_tx_ring(struct ieee80211_hw *hw,
 				     sizeof(*desc) * entries, &desc_dma);
 
 	if (!desc || (unsigned long)desc & 0xFF) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Cannot allocate TX ring (prio = %d)\n", prio);
+		pr_err("rtlwifi: Cannot allocate TX ring (prio = %d)\n", prio);
 		return -ENOMEM;
 	}
 
@@ -1314,8 +1311,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
 					  &rtlpci->rx_ring[rxring_idx].dma);
 		if (!rtlpci->rx_ring[rxring_idx].buffer_desc ||
 		    (ulong)rtlpci->rx_ring[rxring_idx].buffer_desc & 0xFF) {
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Cannot allocate RX ring\n");
+			pr_err("rtlwifi: Cannot allocate RX ring\n");
 			return -ENOMEM;
 		}
 
@@ -1338,8 +1334,7 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw, int rxring_idx)
 					  &rtlpci->rx_ring[rxring_idx].dma);
 		if (!rtlpci->rx_ring[rxring_idx].desc ||
 		    (unsigned long)rtlpci->rx_ring[rxring_idx].desc & 0xFF) {
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Cannot allocate RX ring\n");
+			pr_err("rtlwifi: Cannot allocate RX ring\n");
 			return -ENOMEM;
 		}
 
@@ -1799,15 +1794,13 @@ static void rtl_pci_deinit(struct ieee80211_hw *hw)
 
 static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	int err;
 
 	_rtl_pci_init_struct(hw, pdev);
 
 	err = _rtl_pci_init_trx_ring(hw);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "tx ring initialization failed\n");
+		pr_err("rtlwifi: tx ring initialization failed\n");
 		return err;
 	}
 
@@ -2275,7 +2268,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
 	rtlpriv->cfg->ops->read_eeprom_info(hw);
 
 	if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
+		pr_err("rtlwifi: Can't init_sw_vars\n");
 		err = -ENODEV;
 		goto fail3;
 	}
@@ -2287,22 +2280,20 @@ int rtl_pci_probe(struct pci_dev *pdev,
 	/* Init mac80211 sw */
 	err = rtl_init_core(hw);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't allocate sw for mac80211\n");
+		pr_err("rtlwifi: Can't allocate sw for mac80211\n");
 		goto fail3;
 	}
 
 	/* Init PCI sw */
 	err = rtl_pci_init(hw, pdev);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Failed to init PCI\n");
+		pr_err("rtlwifi: Failed to init PCI\n");
 		goto fail3;
 	}
 
 	err = ieee80211_register_hw(hw);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't register mac80211 hw.\n");
+		pr_err("rtlwifi: Can't register mac80211 hw.\n");
 		err = -ENODEV;
 		goto fail3;
 	}
@@ -2310,8 +2301,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
 
 	err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "failed to create sysfs device attributes\n");
+		pr_err("rtlwifi: failed to create sysfs device attributes\n");
 		goto fail3;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c
index d0ffc4d..ba5c23b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/ps.c
+++ b/drivers/net/wireless/realtek/rtlwifi/ps.c
@@ -150,8 +150,7 @@ static bool rtl_ps_set_rf_state(struct ieee80211_hw *hw,
 		break;
 
 	default:
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "switch case %#x not processed\n", state_toset);
+		pr_err("rtlwifi: switch case %#x not processed\n", state_toset);
 		break;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rc.c b/drivers/net/wireless/realtek/rtlwifi/rc.c
index ce8621a..c2e3d44 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rc.c
@@ -267,8 +267,7 @@ static void *rtl_rate_alloc_sta(void *ppriv,
 
 	rate_priv = kzalloc(sizeof(struct rtl_rate_priv), gfp);
 	if (!rate_priv) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Unable to allocate private rc structure\n");
+		pr_err("rtlwifi: Unable to allocate private rc structure\n");
 		return NULL;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c
index 1558f54..df46cfd 100644
--- a/drivers/net/wireless/realtek/rtlwifi/usb.c
+++ b/drivers/net/wireless/realtek/rtlwifi/usb.c
@@ -421,14 +421,12 @@ static void _rtl_rx_completed(struct urb *urb);
 static int _rtl_prep_rx_urb(struct ieee80211_hw *hw, struct rtl_usb *rtlusb,
 			      struct urb *urb, gfp_t gfp_mask)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	void *buf;
 
 	buf = usb_alloc_coherent(rtlusb->udev, rtlusb->rx_max_size, gfp_mask,
 				 &urb->transfer_dma);
 	if (!buf) {
-		RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-			 "Failed to usb_alloc_coherent!!\n");
+		pr_err("rtlwifi: Failed to usb_alloc_coherent!!\n");
 		return -ENOMEM;
 	}
 
@@ -613,8 +611,6 @@ static unsigned int _rtl_rx_get_padding(struct ieee80211_hdr *hdr,
 static void _rtl_rx_completed(struct urb *_urb)
 {
 	struct rtl_usb *rtlusb = (struct rtl_usb *)_urb->context;
-	struct ieee80211_hw *hw = usb_get_intfdata(rtlusb->intf);
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	int err = 0;
 
 	if (unlikely(IS_USB_STOP(rtlusb)))
@@ -628,17 +624,15 @@ static void _rtl_rx_completed(struct urb *_urb)
 		struct ieee80211_hdr *hdr;
 
 		if (size < RTL_RX_DESC_SIZE + sizeof(struct ieee80211_hdr)) {
-			RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-				 "Too short packet from bulk IN! (len: %d)\n",
-				 size);
+			pr_err("rtlwifi: Too short packet from bulk IN! (len: %d)\n",
+			       size);
 			goto resubmit;
 		}
 
 		qlen = skb_queue_len(&rtlusb->rx_queue);
 		if (qlen >= __RX_SKB_MAX_QUEUED) {
-			RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-				 "Pending RX skbuff queue full! (qlen: %d)\n",
-				 qlen);
+			pr_err("rtlwifi: Pending RX skbuff queue full! (qlen: %d)\n",
+			       qlen);
 			goto resubmit;
 		}
 
@@ -647,8 +641,7 @@ static void _rtl_rx_completed(struct urb *_urb)
 
 		skb = dev_alloc_skb(size + __RADIO_TAP_SIZE_RSV + padding);
 		if (!skb) {
-			RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-				 "Can't allocate skb for bulk IN!\n");
+			pr_err("rtlwifi: Can't allocate skb for bulk IN!\n");
 			goto resubmit;
 		}
 
@@ -725,7 +718,6 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)
 	struct urb *urb;
 	int err;
 	int i;
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
 
 	WARN_ON(0 == rtlusb->rx_urb_num);
@@ -740,8 +732,7 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw)
 
 		err = _rtl_prep_rx_urb(hw, rtlusb, urb, GFP_KERNEL);
 		if (err < 0) {
-			RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-				 "Failed to prep_rx_urb!!\n");
+			pr_err("rtlwifi: Failed to prep_rx_urb!!\n");
 			usb_free_urb(urb);
 			goto err_out;
 		}
@@ -839,7 +830,6 @@ static void rtl_usb_stop(struct ieee80211_hw *hw)
 static void _rtl_submit_tx_urb(struct ieee80211_hw *hw, struct urb *_urb)
 {
 	int err;
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
 
 	usb_anchor_urb(_urb, &rtlusb->tx_submitted);
@@ -847,8 +837,7 @@ static void _rtl_submit_tx_urb(struct ieee80211_hw *hw, struct urb *_urb)
 	if (err < 0) {
 		struct sk_buff *skb;
 
-		RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-			 "Failed to submit urb\n");
+		pr_err("rtlwifi: Failed to submit urb\n");
 		usb_unanchor_urb(_urb);
 		skb = (struct sk_buff *)_urb->context;
 		kfree_skb(skb);
@@ -859,7 +848,6 @@ static void _rtl_submit_tx_urb(struct ieee80211_hw *hw, struct urb *_urb)
 static int _usb_tx_post(struct ieee80211_hw *hw, struct urb *urb,
 			struct sk_buff *skb)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
 	struct ieee80211_tx_info *txinfo;
 
@@ -870,8 +858,7 @@ static int _usb_tx_post(struct ieee80211_hw *hw, struct urb *urb,
 	txinfo->flags |= IEEE80211_TX_STAT_ACK;
 
 	if (urb->status) {
-		RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-			 "Urb has error status 0x%X\n", urb->status);
+		pr_err("rtlwifi: Urb has error status 0x%X\n", urb->status);
 		goto out;
 	}
 	/*  TODO:	statistics */
@@ -919,7 +906,6 @@ static struct urb *_rtl_usb_tx_urb_setup(struct ieee80211_hw *hw,
 static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
 		       enum rtl_txq qnum)
 {
-	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
 	u32 ep_num;
 	struct urb *_urb = NULL;
@@ -927,8 +913,7 @@ static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
 
 	WARN_ON(NULL == rtlusb->usb_tx_aggregate_hdl);
 	if (unlikely(IS_USB_STOP(rtlusb))) {
-		RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG,
-			 "USB device is stopping...\n");
+		pr_err("rtlwifi: USB device is stopping...\n");
 		kfree_skb(skb);
 		return;
 	}
@@ -936,8 +921,7 @@ static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
 	_skb = skb;
 	_urb = _rtl_usb_tx_urb_setup(hw, _skb, ep_num);
 	if (unlikely(!_urb)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't allocate urb. Drop skb!\n");
+		pr_err("rtlwifi: Can't allocate urb. Drop skb!\n");
 		kfree_skb(skb);
 		return;
 	}
@@ -1102,20 +1086,18 @@ int rtl_usb_probe(struct usb_interface *intf,
 	/* Init mac80211 sw */
 	err = rtl_init_core(hw);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't allocate sw for mac80211\n");
+		pr_err("rtlwifi: Can't allocate sw for mac80211\n");
 		goto error_out;
 	}
 	if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
+		pr_err("rtlwifi: Can't init_sw_vars\n");
 		goto error_out;
 	}
 	rtlpriv->cfg->ops->init_sw_leds(hw);
 
 	err = ieee80211_register_hw(hw);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Can't register mac80211 hw.\n");
+		pr_err("rtlwifi: Can't register mac80211 hw.\n");
 		err = -ENODEV;
 		goto error_out;
 	}
-- 
2.10.2

^ permalink raw reply related

* [PATCH 01/14] rtlwifi: Replace local debug macro RT_ASSERT
From: Larry Finger @ 2016-12-11  5:44 UTC (permalink / raw)
  To: kvalo; +Cc: devel, linux-wireless, Larry Finger, Ping-Ke Shih
In-Reply-To: <20161211054523.7119-1-Larry.Finger@lwfinger.net>

This macro can be replaced with WARN_ONCE. In addition to using a
standard debugging macro for these critical errors, we also get
a stack dump.

In rtl8821ae/hw.c, a senseless comment was removed, and an incorrect
indentation was fixed.

This patch also fixes two places in each of rtl8192ee, rtl8723be,
and rtl8821ae where the logical condition was incorrect.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtlwifi/core.c          |  8 ++++----
 drivers/net/wireless/realtek/rtlwifi/debug.h         | 14 --------------
 drivers/net/wireless/realtek/rtlwifi/pci.c           | 12 ++++++------
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c | 10 +++++-----
 drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c |  8 ++++----
 .../wireless/realtek/rtlwifi/rtl8192c/fw_common.c    |  6 +++---
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c   | 14 +++++++-------
 drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c |  8 ++++----
 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 10 +++++-----
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c |  8 ++++----
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c | 14 +++++++-------
 drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c | 15 +++++++++------
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c |  6 +++---
 drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c |  8 ++++----
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 10 +++++-----
 drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c |  8 ++++----
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c  |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 12 ++++++------
 drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c | 14 +++++++-------
 .../wireless/realtek/rtlwifi/rtl8723com/phy_common.c |  2 +-
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c  |  4 ++--
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c  | 16 ++++++++--------
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c |  8 ++++----
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c | 20 ++++++++++++--------
 drivers/net/wireless/realtek/rtlwifi/usb.c           |  2 +-
 38 files changed, 133 insertions(+), 140 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
index 2caa4ad..7ae774d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -1613,8 +1613,8 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 			RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
 				 "set pairwise key\n");
 			if (!sta) {
-				RT_ASSERT(false,
-					  "pairwise key without mac_addr\n");
+				WARN_ONCE(true,
+					  "rtlwifi: pairwise key without mac_addr\n");
 
 				err = -EOPNOTSUPP;
 				goto out_unlock;
@@ -1804,8 +1804,8 @@ bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, u8 cut_version,
 					 "rtl_hal_pwrseqcmdparsing(): PWR_CMD_END\n");
 				return true;
 			default:
-				RT_ASSERT(false,
-					  "rtl_hal_pwrseqcmdparsing(): Unknown CMD!!\n");
+				WARN_ONCE(true,
+					  "rtlwifi: rtl_hal_pwrseqcmdparsing(): Unknown CMD!!\n");
 				break;
 			}
 		}
diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.h b/drivers/net/wireless/realtek/rtlwifi/debug.h
index 6156a79..6f2e2b9 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.h
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.h
@@ -166,15 +166,6 @@ enum dbgp_flag_e {
 
 #ifdef CONFIG_RTLWIFI_DEBUG
 
-#define RT_ASSERT(_exp, fmt, ...)					\
-do {									\
-	if (!(_exp)) {							\
-		printk(KERN_DEBUG KBUILD_MODNAME ":%s(): " fmt,		\
-		       __func__, ##__VA_ARGS__);			\
-	}								\
-} while (0)
-
-
 struct rtl_priv;
 
 __printf(5, 6)
@@ -210,11 +201,6 @@ do {									\
 
 struct rtl_priv;
 
-__printf(2, 3)
-static inline void RT_ASSERT(int exp, const char *fmt, ...)
-{
-}
-
 __printf(4, 5)
 static inline void RT_TRACE(struct rtl_priv *rtlpriv,
 			    int comp, int level,
diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c
index 8bfe020..bb767186 100644
--- a/drivers/net/wireless/realtek/rtlwifi/pci.c
+++ b/drivers/net/wireless/realtek/rtlwifi/pci.c
@@ -2174,15 +2174,15 @@ int rtl_pci_probe(struct pci_dev *pdev,
 
 	err = pci_enable_device(pdev);
 	if (err) {
-		RT_ASSERT(false, "%s : Cannot enable new PCI device\n",
+		WARN_ONCE(true, "%s : Cannot enable new PCI device\n",
 			  pci_name(pdev));
 		return err;
 	}
 
 	if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
 		if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
-			RT_ASSERT(false,
-				  "Unable to obtain 32bit DMA for consistent allocations\n");
+			WARN_ONCE(true,
+				  "rtlwifi: Unable to obtain 32bit DMA for consistent allocations\n");
 			err = -ENOMEM;
 			goto fail1;
 		}
@@ -2193,7 +2193,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
 	hw = ieee80211_alloc_hw(sizeof(struct rtl_pci_priv) +
 				sizeof(struct rtl_priv), &rtl_ops);
 	if (!hw) {
-		RT_ASSERT(false,
+		WARN_ONCE(true,
 			  "%s : ieee80211 alloc failed\n", pci_name(pdev));
 		err = -ENOMEM;
 		goto fail1;
@@ -2232,7 +2232,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
 	/* MEM map */
 	err = pci_request_regions(pdev, KBUILD_MODNAME);
 	if (err) {
-		RT_ASSERT(false, "Can't obtain PCI resources\n");
+		WARN_ONCE(true, "rtlwifi: Can't obtain PCI resources\n");
 		goto fail1;
 	}
 
@@ -2245,7 +2245,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
 			(unsigned long)pci_iomap(pdev,
 			rtlpriv->cfg->bar_id, pmem_len);
 	if (rtlpriv->io.pci_mem_start == 0) {
-		RT_ASSERT(false, "Can't map PCI mem\n");
+		WARN_ONCE(true, "rtlwifi: Can't map PCI mem\n");
 		err = -ENOMEM;
 		goto fail2;
 	}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
index c66a2d1..fbd3eea 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
@@ -434,8 +434,8 @@ void rtl88e_fill_h2c_cmd(struct ieee80211_hw *hw,
 	u32 tmp_cmdbuf[2];
 
 	if (!rtlhal->fw_ready) {
-		RT_ASSERT(false,
-			  "return H2C cmd because of Fw download fail!!!\n");
+		WARN_ONCE(true,
+			  "rtl8188ee: error H2C cmd because of Fw download fail!!!\n");
 		return;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
index 37d6efc..1a17dfe 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
@@ -1352,7 +1352,7 @@ void rtl88ee_set_qos(struct ieee80211_hw *hw, int aci)
 		rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
 		break;
 	default:
-		RT_ASSERT(false, "invalid aci: %d !\n", aci);
+		WARN_ONCE(true, "rtl8188ee: invalid aci: %d !\n", aci);
 		break;
 	}
 }
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
index fffaa92..ece8691 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
@@ -1231,8 +1231,8 @@ u8 rtl88e_phy_sw_chnl(struct ieee80211_hw *hw)
 		return 0;
 	if (rtlphy->set_bwmode_inprogress)
 		return 0;
-	RT_ASSERT((rtlphy->current_channel <= 14),
-		  "WIRELESS_MODE_G but channel>14");
+	WARN_ONCE((rtlphy->current_channel > 14),
+		  "rtl8188ee: WIRELESS_MODE_G but channel>14");
 	rtlphy->sw_chnl_inprogress = true;
 	rtlphy->sw_chnl_stage = 0;
 	rtlphy->sw_chnl_step = 0;
@@ -1280,8 +1280,8 @@ static bool _rtl88e_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 
 	rfdependcmdcnt = 0;
 
-	RT_ASSERT((channel >= 1 && channel <= 14),
-		  "illegal channel for Zebra: %d\n", channel);
+	WARN_ONCE((channel < 1 || channel > 14),
+		  "rtl8188ee: illegal channel for Zebra: %d\n", channel);
 
 	_rtl88e_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
 					 MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG,
@@ -1367,7 +1367,7 @@ static bool _rtl88e_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
 	struct swchnlcmd *pcmd;
 
 	if (cmdtable == NULL) {
-		RT_ASSERT(false, "cmdtable cannot be NULL.\n");
+		WARN_ONCE(true, "rtl8188ee: cmdtable cannot be NULL.\n");
 		return false;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c
index 3e3b886..09c908d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c
@@ -760,7 +760,7 @@ void rtl88ee_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
 			SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *)val);
 			break;
 		default:
-			RT_ASSERT(false, "ERR txdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8188ee: ERR txdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -779,7 +779,7 @@ void rtl88ee_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
 			SET_RX_DESC_EOR(pdesc, 1);
 			break;
 		default:
-			RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8188ee: ERR rxdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -799,7 +799,7 @@ u32 rtl88ee_get_desc(u8 *pdesc, bool istx, u8 desc_name)
 			ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc);
 			break;
 		default:
-			RT_ASSERT(false, "ERR txdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8188ee: ERR txdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -815,7 +815,7 @@ u32 rtl88ee_get_desc(u8 *pdesc, bool istx, u8 desc_name)
 			ret = GET_RX_DESC_BUFF_ADDR(pdesc);
 			break;
 		default:
-			RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8188ee: ERR rxdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
index ceacbf2..54fcf5a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
@@ -485,8 +485,8 @@ void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw,
 	u32 tmp_cmdbuf[2];
 
 	if (!rtlhal->fw_ready) {
-		RT_ASSERT(false,
-			  "return H2C cmd because of Fw download fail!!!\n");
+		WARN_ONCE(true,
+			  "rtl8192c-common: return H2C cmd because of Fw download fail!!!\n");
 		return;
 	}
 
@@ -510,7 +510,7 @@ void rtl92c_firmware_selfreset(struct ieee80211_hw *hw)
 	while (u1b_tmp & BIT(2)) {
 		delay--;
 		if (delay == 0) {
-			RT_ASSERT(false, "8051 reset fail.\n");
+			WARN_ONCE(true, "rtl8192c-common: 8051 reset fail.\n");
 			break;
 		}
 		udelay(50);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
index 94dd25c..32fc4b6 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
@@ -77,7 +77,7 @@ EXPORT_SYMBOL(rtl92c_phy_set_bb_reg);
 u32 _rtl92c_phy_fw_rf_serial_read(struct ieee80211_hw *hw,
 				  enum radio_path rfpath, u32 offset)
 {
-	RT_ASSERT(false, "deprecated!\n");
+	WARN_ONCE(true, "rtl8192c-common: _rtl92c_phy_fw_rf_serial_read deprecated!\n");
 	return 0;
 }
 EXPORT_SYMBOL(_rtl92c_phy_fw_rf_serial_read);
@@ -86,7 +86,7 @@ void _rtl92c_phy_fw_rf_serial_write(struct ieee80211_hw *hw,
 				    enum radio_path rfpath, u32 offset,
 				    u32 data)
 {
-	RT_ASSERT(false, "deprecated!\n");
+	WARN_ONCE(true, "rtl8192c-common: _rtl92c_phy_fw_rf_serial_write deprecated!\n");
 }
 EXPORT_SYMBOL(_rtl92c_phy_fw_rf_serial_write);
 
@@ -745,8 +745,8 @@ u8 rtl92c_phy_sw_chnl(struct ieee80211_hw *hw)
 		return 0;
 	if (rtlphy->set_bwmode_inprogress)
 		return 0;
-	RT_ASSERT((rtlphy->current_channel <= 14),
-		  "WIRELESS_MODE_G but channel>14");
+	WARN_ONCE((rtlphy->current_channel > 14),
+		  "rtl8192c-common: WIRELESS_MODE_G but channel>14");
 	rtlphy->sw_chnl_inprogress = true;
 	rtlphy->sw_chnl_stage = 0;
 	rtlphy->sw_chnl_step = 0;
@@ -792,7 +792,7 @@ static bool _rtl92c_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
 	struct swchnlcmd *pcmd;
 
 	if (cmdtable == NULL) {
-		RT_ASSERT(false, "cmdtable cannot be NULL.\n");
+		WARN_ONCE(true, "rtl8192c-common: cmdtable cannot be NULL.\n");
 		return false;
 	}
 
@@ -837,8 +837,8 @@ bool _rtl92c_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 
 	rfdependcmdcnt = 0;
 
-	RT_ASSERT((channel >= 1 && channel <= 14),
-		  "illegal channel for Zebra: %d\n", channel);
+	WARN_ONCE((channel < 1 || channel > 14),
+		  "rtl8192c-common: illegal channel for Zebra: %d\n", channel);
 
 	_rtl92c_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
 					 MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG,
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
index 4483d40..b757a74 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
@@ -1292,7 +1292,7 @@ void rtl92ce_set_qos(struct ieee80211_hw *hw, int aci)
 		rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
 		break;
 	default:
-		RT_ASSERT(false, "invalid aci: %d !\n", aci);
+		WARN_ONCE(true, "rtl8192ce: invalid aci: %d !\n", aci);
 		break;
 	}
 }
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
index 2ab4a00..3616ba2 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
@@ -670,7 +670,7 @@ void rtl92ce_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
 			SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
 			break;
 		default:
-			RT_ASSERT(false, "ERR txdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8192ce: ERR txdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -690,7 +690,7 @@ void rtl92ce_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
 			SET_RX_DESC_EOR(pdesc, 1);
 			break;
 		default:
-			RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8192ce: ERR rxdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -710,7 +710,7 @@ u32 rtl92ce_get_desc(u8 *p_desc, bool istx, u8 desc_name)
 			ret = GET_TX_DESC_TX_BUFFER_ADDRESS(p_desc);
 			break;
 		default:
-			RT_ASSERT(false, "ERR txdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8192ce: ERR txdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -726,7 +726,7 @@ u32 rtl92ce_get_desc(u8 *p_desc, bool istx, u8 desc_name)
 			ret = GET_RX_DESC_BUFF_ADDR(p_desc);
 			break;
 		default:
-			RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8192ce: ERR rxdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
index 5c7da0c..ddfcf994 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
@@ -1790,7 +1790,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
 						u4b_ac_param);
 				break;
 			default:
-				RT_ASSERT(false, "invalid aci: %d !\n",
+				WARN_ONCE(true, "rtl8192cu: invalid aci: %d !\n",
 					  e_aci);
 				break;
 			}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
index 1ea878f..6da6e2a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
@@ -241,7 +241,7 @@ u16 rtl8192cu_mq_to_hwq(__le16 fc, u16 mac80211_queue_index)
 		break;
 	default:
 		hw_queue_index = RTL_TXQ_BE;
-		RT_ASSERT(false, "QSLT_BE queue, skb_queue:%d\n",
+		WARN_ONCE(true, "rtl8192cu: QSLT_BE queue, skb_queue:%d\n",
 			  mac80211_queue_index);
 		break;
 	}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
index 83a87eb..452de25 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
@@ -182,7 +182,7 @@ void rtl92d_firmware_selfreset(struct ieee80211_hw *hw)
 		udelay(50);
 		u1b_tmp = rtl_read_byte(rtlpriv, REG_SYS_FUNC_EN + 1);
 	}
-	RT_ASSERT((delay > 0), "8051 reset failed!\n");
+	WARN_ONCE((delay <= 0), "rtl8192de: 8051 reset failed!\n");
 	RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
 		 "=====> 8051 reset success (%d)\n", delay);
 }
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
index 424f54b..b0dc189 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
@@ -2700,7 +2700,7 @@ static bool _rtl92d_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
 	struct swchnlcmd *pcmd;
 
 	if (cmdtable == NULL) {
-		RT_ASSERT(false, "cmdtable cannot be NULL\n");
+		WARN_ONCE(true, "rtl8192de: cmdtable cannot be NULL\n");
 		return false;
 	}
 	if (cmdtableidx >= cmdtablesz)
@@ -2893,17 +2893,17 @@ u8 rtl92d_phy_sw_chnl(struct ieee80211_hw *hw)
 		 * 5G and 2.4G band. */
 		if (channel <= 14)
 			return 0;
-		RT_ASSERT((channel > 14), "5G but channel<=14\n");
+		WARN_ONCE((channel <= 14), "rtl8192de: 5G but channel<=14\n");
 		break;
 	case BAND_ON_2_4G:
 		/* Get first channel error when change between
 		 * 5G and 2.4G band. */
 		if (channel > 14)
 			return 0;
-		RT_ASSERT((channel <= 14), "2G but channel>14\n");
+		WARN_ONCE((channel > 14), "rtl8192de: 2G but channel>14\n");
 		break;
 	default:
-		RT_ASSERT(false, "Invalid WirelessMode(%#x)!!\n",
+		WARN_ONCE(true, "rtl8192de: Invalid WirelessMode(%#x)!!\n",
 			  rtlpriv->mac80211.mode);
 		break;
 	}
@@ -3336,7 +3336,7 @@ void rtl92d_phy_set_poweron(struct ieee80211_hw *hw)
 			}
 		}
 		if (i == 200)
-			RT_ASSERT(false, "Another mac power off over time\n");
+			WARN_ONCE(true, "rtl8192de: Another mac power off over time\n");
 	}
 }
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
index 2d65e40..0d98b34 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
@@ -402,7 +402,7 @@ static int __init rtl92de_module_init(void)
 
 	ret = pci_register_driver(&rtl92de_driver);
 	if (ret)
-		RT_ASSERT(false, "No device found\n");
+		WARN_ONCE(true, "rtl8192de: No device found\n");
 	return ret;
 }
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
index 5fb3756..5c9c874 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
@@ -794,7 +794,7 @@ void rtl92de_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
 			SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
 			break;
 		default:
-			RT_ASSERT(false, "ERR txdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8192de: ERR txdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -814,7 +814,7 @@ void rtl92de_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
 			SET_RX_DESC_EOR(pdesc, 1);
 			break;
 		default:
-			RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8192de: ERR rxdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -834,7 +834,7 @@ u32 rtl92de_get_desc(u8 *p_desc, bool istx, u8 desc_name)
 			ret = GET_TX_DESC_TX_BUFFER_ADDRESS(p_desc);
 			break;
 		default:
-			RT_ASSERT(false, "ERR txdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8192de: ERR txdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -848,7 +848,7 @@ u32 rtl92de_get_desc(u8 *p_desc, bool istx, u8 desc_name)
 			ret = GET_RX_DESC_PKT_LEN(pdesc);
 			break;
 		default:
-			RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8192de: ERR rxdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
index a4aa239..9dfd74b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
@@ -462,8 +462,8 @@ void rtl92ee_fill_h2c_cmd(struct ieee80211_hw *hw,
 	u32 tmp_cmdbuf[2];
 
 	if (!rtlhal->fw_ready) {
-		RT_ASSERT(false,
-			  "return H2C cmd because of Fw download fail!!!\n");
+		WARN_ONCE(true,
+			  "rtl8192ee: error H2C cmd because of Fw download fail!!!\n");
 		return;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
index ebf663e..00b211b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
@@ -1582,7 +1582,7 @@ void rtl92ee_set_qos(struct ieee80211_hw *hw, int aci)
 		rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
 		break;
 	default:
-		RT_ASSERT(false, "invalid aci: %d !\n", aci);
+		WARN_ONCE(true, "rtl8192ee: invalid aci: %d !\n", aci);
 		break;
 	}
 }
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
index 5ad7e75..c35ba76 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
@@ -1176,7 +1176,7 @@ static u8 _rtl92ee_phy_get_ratesection_intxpower_byrate(enum radio_path path,
 		rate_section = 7;
 		break;
 	default:
-		RT_ASSERT(true, "Rate_Section is Illegal\n");
+		WARN_ONCE(true, "rtl8192ee: Rate_Section is Illegal\n");
 		break;
 	}
 	return rate_section;
@@ -1239,7 +1239,7 @@ static u8 _rtl92ee_get_txpower_by_rate(struct ieee80211_hw *hw,
 		shift = 24;
 		break;
 	default:
-		RT_ASSERT(true, "Rate_Section is Illegal\n");
+		WARN_ONCE(true, "rtl8192ee: Rate_Section is Illegal\n");
 		break;
 	}
 
@@ -1811,8 +1811,8 @@ u8 rtl92ee_phy_sw_chnl(struct ieee80211_hw *hw)
 		return 0;
 	if (rtlphy->set_bwmode_inprogress)
 		return 0;
-	RT_ASSERT((rtlphy->current_channel <= 14),
-		  "WIRELESS_MODE_G but channel>14");
+	WARN_ONCE((rtlphy->current_channel > 14),
+		  "rtl8192ee: WIRELESS_MODE_G but channel>14");
 	rtlphy->sw_chnl_inprogress = true;
 	rtlphy->sw_chnl_stage = 0;
 	rtlphy->sw_chnl_step = 0;
@@ -1860,8 +1860,8 @@ static bool _rtl92ee_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 
 	rfdependcmdcnt = 0;
 
-	RT_ASSERT((channel >= 1 && channel <= 14),
-		  "illegal channel for Zebra: %d\n", channel);
+	WARN_ONCE((channel < 1 || channel > 14),
+		  "rtl8192ee: illegal channel for Zebra: %d\n", channel);
 
 	_rtl92ee_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
 					  MAX_RFDEPENDCMD_CNT,
@@ -1948,7 +1948,7 @@ static bool _rtl92ee_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
 	struct swchnlcmd *pcmd;
 
 	if (cmdtable == NULL) {
-		RT_ASSERT(false, "cmdtable cannot be NULL.\n");
+		WARN_ONCE(true, "rtl8192ee: cmdtable cannot be NULL.\n");
 		return false;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
index 2d48ccd..07440e9 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
@@ -991,8 +991,9 @@ void rtl92ee_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
 			SET_RX_DESC_EOR(pdesc, 1);
 			break;
 		default:
-			RT_ASSERT(false,
-				  "ERR rxdesc :%d not process\n", desc_name);
+			WARN_ONCE(true,
+				  "rtl8192ee: ERR rxdesc :%d not processed\n",
+				  desc_name);
 			break;
 		}
 	}
@@ -1011,8 +1012,9 @@ u32 rtl92ee_get_desc(u8 *pdesc, bool istx, u8 desc_name)
 			ret = GET_TXBUFFER_DESC_ADDR_LOW(pdesc, 1);
 			break;
 		default:
-			RT_ASSERT(false,
-				  "ERR txdesc :%d not process\n", desc_name);
+			WARN_ONCE(true,
+				  "rtl8192ee: ERR txdesc :%d not processed\n",
+				  desc_name);
 			break;
 		}
 	} else {
@@ -1027,8 +1029,9 @@ u32 rtl92ee_get_desc(u8 *pdesc, bool istx, u8 desc_name)
 			ret = GET_RX_DESC_BUFF_ADDR(pdesc);
 			break;
 		default:
-			RT_ASSERT(false,
-				  "ERR rxdesc :%d not process\n", desc_name);
+			WARN_ONCE(true,
+				  "rtl8192ee: ERR rxdesc :%d not processed\n",
+				  desc_name);
 			break;
 		}
 	}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
index 26e06b2..f4ab721 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
@@ -1251,7 +1251,7 @@ void rtl92se_set_qos(struct ieee80211_hw *hw, int aci)
 		rtl_write_dword(rtlpriv, EDCAPARA_VO, 0x2f3222);
 		break;
 	default:
-		RT_ASSERT(false, "invalid aci: %d !\n", aci);
+		WARN_ONCE(true, "rtl8192se: invalid aci: %d !\n", aci);
 		break;
 	}
 }
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
index fcb9216..6299dc1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
@@ -330,7 +330,7 @@ static bool _rtl92s_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
 	struct swchnlcmd *pcmd;
 
 	if (cmdtable == NULL) {
-		RT_ASSERT(false, "cmdtable cannot be NULL\n");
+		WARN_ONCE(true, "rtl8192se: cmdtable cannot be NULL\n");
 		return false;
 	}
 
@@ -374,8 +374,8 @@ static bool _rtl92s_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 
 	rfdependcmdcnt = 0;
 
-	RT_ASSERT((channel >= 1 && channel <= 14),
-		  "invalid channel for Zebra: %d\n", channel);
+	WARN_ONCE((channel < 1 || channel > 14),
+		  "rtl8192se: invalid channel for Zebra: %d\n", channel);
 
 	_rtl92s_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
 					 MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG,
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c
index 9a5a113..12cef01 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c
@@ -583,7 +583,7 @@ void rtl92se_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
 			SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
 			break;
 		default:
-			RT_ASSERT(false, "ERR txdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8192se: ERR txdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -603,7 +603,7 @@ void rtl92se_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
 			SET_RX_STATUS_DESC_EOR(pdesc, 1);
 			break;
 		default:
-			RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8192se: ERR rxdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -623,7 +623,7 @@ u32 rtl92se_get_desc(u8 *desc, bool istx, u8 desc_name)
 			ret = GET_TX_DESC_TX_BUFFER_ADDRESS(desc);
 			break;
 		default:
-			RT_ASSERT(false, "ERR txdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8192se: ERR txdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -639,7 +639,7 @@ u32 rtl92se_get_desc(u8 *desc, bool istx, u8 desc_name)
 			ret = GET_RX_STATUS_DESC_BUFF_ADDR(desc);
 			break;
 		default:
-			RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8192se: ERR rxdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
index 1186755..164a27e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
@@ -259,8 +259,8 @@ void rtl8723e_fill_h2c_cmd(struct ieee80211_hw *hw,
 	u32 tmp_cmdbuf[2];
 
 	if (!rtlhal->fw_ready) {
-		RT_ASSERT(false,
-			  "return H2C cmd because of Fw download fail!!!\n");
+		WARN_ONCE(true,
+			  "rtl8723ae: error H2C cmd because of Fw download fail!!!\n");
 		return;
 	}
 	memset(tmp_cmdbuf, 0, 8);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
index f8be0bd..e0da8dc 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
@@ -1256,7 +1256,7 @@ void rtl8723e_set_qos(struct ieee80211_hw *hw, int aci)
 		rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
 		break;
 	default:
-		RT_ASSERT(false, "invalid aci: %d !\n", aci);
+		WARN_ONCE(true, "rtl8723ae: invalid aci: %d !\n", aci);
 		break;
 	}
 }
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
index 17b58cb..8001dce 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
@@ -133,7 +133,7 @@ static void _rtl8723e_phy_fw_rf_serial_write(struct ieee80211_hw *hw,
 					     enum radio_path rfpath, u32 offset,
 					     u32 data)
 {
-	RT_ASSERT(false, "deprecated!\n");
+	WARN_ONCE(true, "rtl8723ae: _rtl8723e_phy_fw_rf_serial_write deprecated!\n");
 }
 
 static void _rtl8723e_phy_bb_config_1t(struct ieee80211_hw *hw)
@@ -885,8 +885,8 @@ u8 rtl8723e_phy_sw_chnl(struct ieee80211_hw *hw)
 		return 0;
 	if (rtlphy->set_bwmode_inprogress)
 		return 0;
-	RT_ASSERT((rtlphy->current_channel <= 14),
-		  "WIRELESS_MODE_G but channel>14");
+	WARN_ONCE((rtlphy->current_channel > 14),
+		  "rtl8723ae: WIRELESS_MODE_G but channel>14");
 	rtlphy->sw_chnl_inprogress = true;
 	rtlphy->sw_chnl_stage = 0;
 	rtlphy->sw_chnl_step = 0;
@@ -954,8 +954,8 @@ static bool _rtl8723e_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 
 	rfdependcmdcnt = 0;
 
-	RT_ASSERT((channel >= 1 && channel <= 14),
-		  "illegal channel for Zebra: %d\n", channel);
+	WARN_ONCE((channel < 1 || channel > 14),
+		  "rtl8723ae: illegal channel for Zebra: %d\n", channel);
 
 	rtl8723_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
 					 MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG,
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c
index e93125e..c9838f5 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c
@@ -617,7 +617,7 @@ void rtl8723e_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
 			SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
 			break;
 		default:
-			RT_ASSERT(false, "ERR txdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8723ae: ERR txdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -636,7 +636,7 @@ void rtl8723e_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
 			SET_RX_DESC_EOR(pdesc, 1);
 			break;
 		default:
-			RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8723ae: ERR rxdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -656,7 +656,7 @@ u32 rtl8723e_get_desc(u8 *pdesc, bool istx, u8 desc_name)
 			ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc);
 			break;
 		default:
-			RT_ASSERT(false, "ERR txdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8723ae: ERR txdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
@@ -672,7 +672,7 @@ u32 rtl8723e_get_desc(u8 *pdesc, bool istx, u8 desc_name)
 			ret = GET_RX_DESC_BUFF_ADDR(pdesc);
 			break;
 		default:
-			RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8723ae: ERR rxdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
index 8c5c27c..6b03c7f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
@@ -224,8 +224,8 @@ void rtl8723be_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id,
 	u32 tmp_cmdbuf[2];
 
 	if (!rtlhal->fw_ready) {
-		RT_ASSERT(false,
-			  "return H2C cmd because of Fw download fail!!!\n");
+		WARN_ONCE(true,
+			  "rtl8723be: error H2C cmd because of Fw download fail!!!\n");
 		return;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
index aba60c3..56a1ae4 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
@@ -1631,7 +1631,7 @@ void rtl8723be_set_qos(struct ieee80211_hw *hw, int aci)
 		rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
 		break;
 	default:
-		RT_ASSERT(false, "invalid aci: %d !\n", aci);
+		WARN_ONCE(true, "rtl8723be: invalid aci: %d !\n", aci);
 		break;
 	}
 }
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
index 3cc2232..b4e0a58 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
@@ -939,7 +939,7 @@ static u8 _rtl8723be_phy_get_ratesection_intxpower_byrate(enum radio_path path,
 		break;
 
 	default:
-		RT_ASSERT(true, "Rate_Section is Illegal\n");
+		WARN_ONCE(true, "rtl8723be: Rate_Section is Illegal\n");
 		break;
 	}
 
@@ -1004,7 +1004,7 @@ static u8 _rtl8723be_get_txpower_by_rate(struct ieee80211_hw *hw,
 		shift = 24;
 		break;
 	default:
-		RT_ASSERT(true, "Rate_Section is Illegal\n");
+		WARN_ONCE(true, "rtl8723be: Rate_Section is Illegal\n");
 		break;
 	}
 	tx_pwr_diff = (u8)(rtlphy->tx_power_by_rate_offset[band][rfpath][tx_num]
@@ -1387,8 +1387,8 @@ u8 rtl8723be_phy_sw_chnl(struct ieee80211_hw *hw)
 		return 0;
 	if (rtlphy->set_bwmode_inprogress)
 		return 0;
-	RT_ASSERT((rtlphy->current_channel <= 14),
-		  "WIRELESS_MODE_G but channel>14");
+	WARN_ONCE((rtlphy->current_channel > 14),
+		  "rtl8723be: WIRELESS_MODE_G but channel>14");
 	rtlphy->sw_chnl_inprogress = true;
 	rtlphy->sw_chnl_stage = 0;
 	rtlphy->sw_chnl_step = 0;
@@ -1438,8 +1438,8 @@ static bool _rtl8723be_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 
 	rfdependcmdcnt = 0;
 
-	RT_ASSERT((channel >= 1 && channel <= 14),
-		  "illegal channel for Zebra: %d\n", channel);
+	WARN_ONCE((channel < 1 || channel > 14),
+		  "rtl8723be: illegal channel for Zebra: %d\n", channel);
 
 	rtl8723_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
 					 MAX_RFDEPENDCMD_CNT,
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c
index 2175aec..6f65003 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c
@@ -666,8 +666,8 @@ void rtl8723be_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
 			SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *)val);
 			break;
 		default:
-			RT_ASSERT(false, "ERR txdesc :%d not process\n",
-					  desc_name);
+			WARN_ONCE(true, "rtl8723be: ERR txdesc :%d not processed\n",
+				  desc_name);
 			break;
 		}
 	} else {
@@ -685,8 +685,8 @@ void rtl8723be_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
 			SET_RX_DESC_EOR(pdesc, 1);
 			break;
 		default:
-			RT_ASSERT(false, "ERR rxdesc :%d not process\n",
-					  desc_name);
+			WARN_ONCE(true, "rtl8723be: ERR rxdesc :%d not process\n",
+				  desc_name);
 			break;
 		}
 	}
@@ -705,8 +705,8 @@ u32 rtl8723be_get_desc(u8 *pdesc, bool istx, u8 desc_name)
 			ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc);
 			break;
 		default:
-			RT_ASSERT(false, "ERR txdesc :%d not process\n",
-					  desc_name);
+			WARN_ONCE(true, "rtl8723be: ERR txdesc :%d not process\n",
+				  desc_name);
 			break;
 		}
 	} else {
@@ -721,7 +721,7 @@ u32 rtl8723be_get_desc(u8 *pdesc, bool istx, u8 desc_name)
 			ret = GET_RX_DESC_BUFF_ADDR(pdesc);
 			break;
 		default:
-			RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+			WARN_ONCE(true, "rtl8723be: ERR rxdesc :%d not processed\n",
 				  desc_name);
 			break;
 		}
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
index 75cbd15..6b80ddc 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
@@ -283,7 +283,7 @@ bool rtl8723_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
 	struct swchnlcmd *pcmd;
 
 	if (cmdtable == NULL) {
-		RT_ASSERT(false, "cmdtable cannot be NULL.\n");
+		WARN_ONCE(true, "rtl8723-common: cmdtable cannot be NULL.\n");
 		return false;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
index 2f598dd..e8688f4 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
@@ -510,8 +510,8 @@ void rtl8821ae_fill_h2c_cmd(struct ieee80211_hw *hw,
 	u32 tmp_cmdbuf[2];
 
 	if (!rtlhal->fw_ready) {
-		RT_ASSERT(false,
-			  "return H2C cmd because of Fw download fail!!!\n");
+		WARN_ONCE(true,
+			  "rtl8821ae: error H2C cmd because of Fw download fail!!!\n");
 		return;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
index 1281ebe..b045dd0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
@@ -2249,7 +2249,7 @@ void rtl8821ae_set_qos(struct ieee80211_hw *hw, int aci)
 		rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
 		break;
 	default:
-		RT_ASSERT(false, "invalid aci: %d !\n", aci);
+		WARN_ONCE(true, "rtl8821ae: invalid aci: %d !\n", aci);
 		break;
 	}
 }
@@ -2601,11 +2601,10 @@ static u8 _rtl8821ae_get_chnl_group(u8 chnl)
 			group = 12;
 	else if (173 <= chnl && chnl <= 177)
 			group = 13;
-		else
-			/*RT_TRACE(rtlpriv, COMP_EFUSE,DBG_LOUD,
-				"5G, Channel %d in Group not found\n",chnl);*/
-			RT_ASSERT(!COMP_EFUSE,
-				"5G, Channel %d in Group not found\n", chnl);
+	else
+		WARN_ONCE(true,
+			  "rtl8821ae: 5G, Channel %d in Group not found\n",
+			  chnl);
 	}
 	return group;
 }
@@ -4135,8 +4134,9 @@ void rtl8821ae_add_wowlan_pattern(struct ieee80211_hw *hw,
 			count++;
 		} while (tmp && count < 100);
 
-		RT_ASSERT((count < 100),
-			  "Write wake up frame mask FAIL %d value!\n", tmp);
+		WARN_ONCE((count >= 100),
+			  "rtl8821ae: Write wake up frame mask FAIL %d value!\n",
+			  tmp);
 	}
 	/* Disable Rx packet buffer access. */
 	rtl_write_byte(rtlpriv, REG_PKT_BUFF_ACCESS_CTRL,
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
index 5dad402..7e2f7b0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
@@ -1870,8 +1870,8 @@ static u8 _rtl8821ae_get_rate_section_index(u32 regaddr)
 	else if (regaddr >= 0xE20 && regaddr <= 0xE4C)
 		index = (u8)((regaddr - 0xE20) / 4);
 	else
-		RT_ASSERT(!COMP_INIT,
-			  "Invalid RegAddr 0x%x\n", regaddr);
+		WARN_ONCE(true,
+			  "rtl8821ae: Invalid RegAddr 0x%x\n", regaddr);
 	return index;
 }
 
@@ -2322,7 +2322,7 @@ static s8 _rtl8821ae_phy_get_ratesection_intxpower_byrate(u8 path, u8 rate)
 		rate_section = 11;
 		break;
 	default:
-		RT_ASSERT(true, "Rate_Section is Illegal\n");
+		WARN_ONCE(true, "rtl8821ae: Rate_Section is Illegal\n");
 		break;
 	}
 
@@ -2588,7 +2588,7 @@ static s8 _rtl8821ae_phy_get_txpower_by_rate(struct ieee80211_hw *hw,
 		shift = 24;
 		break;
 	default:
-		RT_ASSERT(true, "Rate_Section is Illegal\n");
+		WARN_ONCE(true, "rtl8821ae: Rate_Section is Illegal\n");
 		break;
 	}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c
index 2772718..1080981 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c
@@ -904,8 +904,9 @@ void rtl8821ae_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
 			SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *)val);
 			break;
 		default:
-			RT_ASSERT(false,
-				  "ERR txdesc :%d not process\n", desc_name);
+			WARN_ONCE(true,
+				  "rtl8821ae: ERR txdesc :%d not processed\n",
+				  desc_name);
 			break;
 		}
 	} else {
@@ -923,8 +924,9 @@ void rtl8821ae_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
 			SET_RX_DESC_EOR(pdesc, 1);
 			break;
 		default:
-			RT_ASSERT(false,
-				  "ERR rxdesc :%d not process\n", desc_name);
+			WARN_ONCE(true,
+				  "rtl8821ae: ERR rxdesc :%d not processed\n",
+				  desc_name);
 			break;
 		}
 	}
@@ -943,8 +945,9 @@ u32 rtl8821ae_get_desc(u8 *pdesc, bool istx, u8 desc_name)
 			ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc);
 			break;
 		default:
-			RT_ASSERT(false,
-				  "ERR txdesc :%d not process\n", desc_name);
+			WARN_ONCE(true,
+				  "rtl8821ae: ERR txdesc :%d not processed\n",
+				  desc_name);
 			break;
 		}
 	} else {
@@ -959,8 +962,9 @@ u32 rtl8821ae_get_desc(u8 *pdesc, bool istx, u8 desc_name)
 			ret = GET_RX_DESC_BUFF_ADDR(pdesc);
 			break;
 		default:
-			RT_ASSERT(false,
-				  "ERR rxdesc :%d not process\n", desc_name);
+			WARN_ONCE(true,
+				  "rtl8821ae: ERR rxdesc :%d not processed\n",
+				  desc_name);
 			break;
 		}
 	}
diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c
index 0a508649..1558f54 100644
--- a/drivers/net/wireless/realtek/rtlwifi/usb.c
+++ b/drivers/net/wireless/realtek/rtlwifi/usb.c
@@ -1059,7 +1059,7 @@ int rtl_usb_probe(struct usb_interface *intf,
 	hw = ieee80211_alloc_hw(sizeof(struct rtl_priv) +
 				sizeof(struct rtl_usb_priv), &rtl_ops);
 	if (!hw) {
-		RT_ASSERT(false, "ieee80211 alloc failed\n");
+		WARN_ONCE(true, "rtl_usb: ieee80211 alloc failed\n");
 		return -ENOMEM;
 	}
 	rtlpriv = hw->priv;
-- 
2.10.2

^ permalink raw reply related

* [PATCH 00/14] rtlwifi: Start reworking of debug system
From: Larry Finger @ 2016-12-11  5:44 UTC (permalink / raw)
  To: kvalo; +Cc: devel, linux-wireless, Larry Finger, Ping-Ke Shih

Following the discussion regarding the patch entitled "rtlwifi: Add
BTC_TRACE_STRING to new btcoex", we are reworking the entire debug
system. This set of patches does the following:

1. Replaces every invocation of RT_ASSERT with WARN_ON. With this
   change, triggering these conditions with now give a stack dump.
   Note that the logical condition between RT_ASSERT and WARN_ON
   is inverted. In making these changes, 6 logic errors were found.
2. Replaces every call of RT_TRACE with the level set to DBG_EMERG
   with the equivalent pr_err() call.
3. Removes some redundant logged conditions. For example, when the
   failure of firmware to start is logged, it is not necessary to
   log that the firmware did start.

The previous two patch sequences "[PATCH 00/14] rtlwifi: Various updates"
and "[PATCH 0/7] rtlwifi: btcoexist: Rewrite BT coexistence routines"
should be discarded. That material will be resubmitted later.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>

Larry Finger (14):
  rtlwifi: Replace local debug macro RT_ASSERT
  rtlwifi_new: Remove RT_TRACE messages that use DBG_EMERG
  rtlwifi_new: rtl8821ae: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8723be: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8723ae: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192ee: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8723-common: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192se: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192de: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192cu: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192ce: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8192c-common: Remove all instances of DBG_EMERG
  rtlwifi_new: rtl8188ee: Remove all instances of DBG_EMERG
  rtlwifi: Remove some redundant code

 drivers/net/wireless/realtek/rtlwifi/base.c        | 15 +++----
 drivers/net/wireless/realtek/rtlwifi/cam.c         | 14 +++---
 drivers/net/wireless/realtek/rtlwifi/core.c        | 29 +++++-------
 drivers/net/wireless/realtek/rtlwifi/debug.c       |  9 ++--
 drivers/net/wireless/realtek/rtlwifi/debug.h       | 18 +-------
 drivers/net/wireless/realtek/rtlwifi/efuse.c       |  3 +-
 drivers/net/wireless/realtek/rtlwifi/pci.c         | 48 ++++++++------------
 drivers/net/wireless/realtek/rtlwifi/ps.c          |  3 +-
 drivers/net/wireless/realtek/rtlwifi/rc.c          |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/fw.c    | 43 +++++-------------
 .../net/wireless/realtek/rtlwifi/rtl8188ee/hw.c    | 32 +++++---------
 .../net/wireless/realtek/rtlwifi/rtl8188ee/phy.c   | 32 ++++++--------
 .../net/wireless/realtek/rtlwifi/rtl8188ee/rf.c    |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8188ee/sw.c    |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8188ee/trx.c   |  8 ++--
 .../wireless/realtek/rtlwifi/rtl8192c/fw_common.c  | 45 ++++++-------------
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c | 27 ++++++------
 .../net/wireless/realtek/rtlwifi/rtl8192ce/hw.c    | 38 ++++++----------
 .../net/wireless/realtek/rtlwifi/rtl8192ce/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c   | 13 +++---
 .../net/wireless/realtek/rtlwifi/rtl8192ce/rf.c    |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ce/sw.c    |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ce/trx.c   |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/hw.c    | 35 +++++----------
 .../net/wireless/realtek/rtlwifi/rtl8192cu/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/mac.c   | 12 ++---
 .../net/wireless/realtek/rtlwifi/rtl8192cu/phy.c   | 12 ++---
 .../net/wireless/realtek/rtlwifi/rtl8192cu/rf.c    |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192cu/sw.c    |  5 +--
 .../net/wireless/realtek/rtlwifi/rtl8192cu/trx.c   |  2 +-
 .../net/wireless/realtek/rtlwifi/rtl8192de/fw.c    | 31 ++++---------
 .../net/wireless/realtek/rtlwifi/rtl8192de/hw.c    | 34 +++++----------
 .../net/wireless/realtek/rtlwifi/rtl8192de/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192de/phy.c   | 41 ++++++++---------
 .../net/wireless/realtek/rtlwifi/rtl8192de/rf.c    |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192de/sw.c    | 10 ++---
 .../net/wireless/realtek/rtlwifi/rtl8192de/trx.c   |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ee/fw.c    | 40 +++++------------
 .../net/wireless/realtek/rtlwifi/rtl8192ee/hw.c    | 13 +++---
 .../net/wireless/realtek/rtlwifi/rtl8192ee/phy.c   | 36 +++++++--------
 .../net/wireless/realtek/rtlwifi/rtl8192ee/rf.c    |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192ee/sw.c    |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192ee/trx.c   | 15 ++++---
 .../net/wireless/realtek/rtlwifi/rtl8192se/fw.c    | 46 ++++++++-----------
 .../net/wireless/realtek/rtlwifi/rtl8192se/hw.c    | 42 +++++++-----------
 .../net/wireless/realtek/rtlwifi/rtl8192se/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8192se/phy.c   | 42 +++++++-----------
 .../net/wireless/realtek/rtlwifi/rtl8192se/rf.c    |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8192se/sw.c    |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8192se/trx.c   |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8723ae/fw.c    | 13 +++---
 .../net/wireless/realtek/rtlwifi/rtl8723ae/hw.c    | 21 ++++-----
 .../net/wireless/realtek/rtlwifi/rtl8723ae/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8723ae/phy.c   | 28 +++++-------
 .../net/wireless/realtek/rtlwifi/rtl8723ae/rf.c    |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8723ae/sw.c    |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8723ae/trx.c   |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8723be/fw.c    | 13 +++---
 .../net/wireless/realtek/rtlwifi/rtl8723be/hw.c    | 18 +++-----
 .../net/wireless/realtek/rtlwifi/rtl8723be/led.c   |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8723be/phy.c   | 30 ++++++-------
 .../net/wireless/realtek/rtlwifi/rtl8723be/rf.c    |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8723be/sw.c    |  8 ++--
 .../net/wireless/realtek/rtlwifi/rtl8723be/trx.c   | 14 +++---
 .../realtek/rtlwifi/rtl8723com/fw_common.c         | 25 +++--------
 .../realtek/rtlwifi/rtl8723com/phy_common.c        |  6 +--
 .../net/wireless/realtek/rtlwifi/rtl8821ae/dm.c    |  3 +-
 .../net/wireless/realtek/rtlwifi/rtl8821ae/fw.c    | 28 ++++--------
 .../net/wireless/realtek/rtlwifi/rtl8821ae/hw.c    | 31 ++++++-------
 .../net/wireless/realtek/rtlwifi/rtl8821ae/phy.c   | 51 +++++++++-------------
 .../net/wireless/realtek/rtlwifi/rtl8821ae/rf.c    |  5 +--
 .../net/wireless/realtek/rtlwifi/rtl8821ae/sw.c    | 14 +++---
 .../net/wireless/realtek/rtlwifi/rtl8821ae/trx.c   | 20 +++++----
 drivers/net/wireless/realtek/rtlwifi/usb.c         | 48 +++++++-------------
 74 files changed, 488 insertions(+), 816 deletions(-)

-- 
2.10.2

^ permalink raw reply

* Could we have request_firmware_nowait with FW_OPT_NO_WARN?
From: Rafał Miłecki @ 2016-12-10 15:54 UTC (permalink / raw)
  To: Ming Lei, Luis R. Rodriguez, Linux Kernel Mailing List
  Cc: linux-wireless@vger.kernel.org, brcm80211 development

Hi,

In brcmfmac we use request_firmware_nowait and if fetching firmware
with NVRAM variables fails then we try to fallback to the platform one
(see brcmf_fw_request_code_done & brcmf_fw_request_nvram_done).

Some problem for us is that on devices with platform NVRAM we get this erro=
r:
Direct firmware load for brcm/brcmfmac43602-pcie.txt failed with error -2
(which is harmless if getting platform NVRAM succeeds). This error is
quite confusing for users. They think something went wrong, they
expect problems & they report it back to us. Obviously I don't want
ugly hacks like:
pr_info("Got platform NVRAM, ignore above error\n");

So it would be nice to have version of request_firmware_nowait with
FW_OPT_NO_WARN. If requesting firmware NVRAM fails *and* getting
platform NVRAM fails, then I could to print error on my own.
Does it make sense? Can you see a point of my request?

Do you have any suggestion for this? If and how I could proceed with
implementation?

request_firmware_nowait already has "bool uevent" argument, I don't
want it to have argument per every available option. I was thinking
about moving FW_OPT_* defines to the include/linux/firmware.h but I'm
not sure if it's OK as they depend on:
CONFIG_FW_LOADER_USER_HELPER
and
CONFIG_FW_LOADER_USER_HELPER_FALLBACK
With defines placed in firmware.h I could replace "bool uevent" with
"unsigned int opt_flags".
Does it sound like a good plan? Or do you have any better idea?

--=20
Rafa=C5=82

^ permalink raw reply

* RE: ATH9 driver issues on ARM64
From: Bharat Kumar Gogada @ 2016-12-10 14:40 UTC (permalink / raw)
  To: Tobias Klausmann, Kalle Valo
  Cc: Bjorn Helgaas, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, Marc Zyngier,
	Janusz.Dziedzic@tieto.com, rmanohar@qti.qualcomm.com,
	ath9k-devel@qca.qualcomm.com, linux-wireless@vger.kernel.org
In-Reply-To: <8b348550-d909-cd98-4c04-dcf37b41f1ee@mni.thm.de>

Hi,

After taking some more lecroy traces, we see that after 2nd ASSERT from EP =
on ARM64 we see continuous data movement of 32 dwords or 12 dwords and neve=
r sign of DEASSERT.
Comparatively on working traces (x86) after 2nd assert there are only BAR r=
egister reads and writes and then DEASSERT, for almost most of the interrup=
ts and we haven't seen 12 or 32 dwords data movement on this trace.

I did not work on EP wifi/network drivers, any help why EP needs those many=
 number of data at scan time ?

Regards,
Bharat

=20
> Hello there,
>=20
> as this is a thread about ath9k and ARM64, i'm not sure if i should answe=
r here
> or not, but i have similar "stalls" with ath9k on x86_64 (starting with 4=
.9rc), stack
> trace is posted down below where the original ARM64 stall traces are.
>=20
> Greetings,
>=20
> Tobias
>=20
>=20
> On 08.12.2016 18:36, Kalle Valo wrote:
> > Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com> writes:
> >
> >>   > [+cc Kalle, ath9k list]
> > Thanks, but please also CC linux-wireless. Full thread below for the
> > folks there.
> >
> >>> On Thu, Dec 08, 2016 at 01:49:42PM +0000, Bharat Kumar Gogada wrote:
> >>>> Hi,
> >>>>
> >>>> Did anyone test Atheros ATH9
> >>>> driver(drivers/net/wireless/ath/ath9k/)
> >>>> on ARM64.  The end point is TP link wifi card with which supports
> >>>> only legacy interrupts.
> >>> If it works on other arches and the arm64 PCI enumeration works, my
> >>> first guess would be an INTx issue, e.g., maybe the driver is
> >>> waiting for an interrupt that never arrives.
> >> We are not sure for now.
> >>>> We are trying to test it on ARM64 with
> >>>> (drivers/pci/host/pcie-xilinx-nwl.c) as root port.
> >>>>
> >>>> EP is getting enumerated and able to link up.
> >>>>
> >>>> But when we start scan system gets hanged.
> >>> When you say the system hangs when you start a scan, I assume you
> >>> mean a wifi scan, not the PCI enumeration.  A problem with a wifi
> >>> scan might cause a *process* to hang, but it shouldn't hang the
> >>> entire system.
> >>>
> >> Yes wifi scan.
> >>>> When we took trace we see that after we start scan assert message
> >>>> is sent but there is no de assert from end point.
> >>> Are you talking about a trace from a PCIe analyzer?  Do you see an
> >>> Assert_INTx PCIe message on the link?
> >>>
> >> Yes lecroy trace, yes we do see Assert_INTx and Deassert_INTx happenin=
g
> when we do interface link up.
> >> When we have less debug prints in Atheros driver, and do wifi scan we
> >> see Assert_INTx but never Deassert_INTx,
> >>>> What might cause end point not sending de assert ?
> >>> If the endpoint doesn't send a Deassert_INTx message, I expect that
> >>> would mean the driver didn't service the interrupt and remove the
> >>> condition that caused the device to assert the interrupt in the
> >>> first place.
> >>>
> >>> If the driver didn't receive the interrupt, it couldn't service it,
> >>> of course.  You could add a printk in the ath9k interrupt service
> >>> routine to see if you ever get there.
> >>>
> >> The interrupt behavior is changing w.r.t amount of debug prints we
> >> add. (I kept many prints to aid debug) root@Xilinx-ZCU102-2016_3:~# iw=
 dev
> wlan0 scan
> >> [   83.064675] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.069486] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.074257] ath9k_hw_kill_interrupts	 793
> >> [   83.078260] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.083107] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.087882] ath9k_hw_kill_interrupts	 793
> >> [   83.095450] ath9k_hw_enable_interrupts	 821
> >> [   83.099557] ath9k_hw_enable_interrupts	 825
> >> [   83.103721] ath9k_hw_enable_interrupts	 832
> >> [   83.107887] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.112748] AR_SREV_9100 0
> >> [   83.115438] ath9k_hw_enable_interrupts	 848
> >> [   83.119607] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.124389] ath9k_hw_intrpend	 762
> >> [   83.127761] (AR_SREV_9340(ah) val 0
> >> [   83.131234] ath9k_hw_intrpend	 767
> >> [   83.134628] ath_isr	 603
> >> [   83.137134] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.141995] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.146771] ath9k_hw_kill_interrupts	 793
> >> [   83.150864] ath9k_hw_enable_interrupts	 821
> >> [   83.154971] ath9k_hw_enable_interrupts	 825
> >> [   83.159135] ath9k_hw_enable_interrupts	 832
> >> [   83.163300] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.168161] AR_SREV_9100 0
> >> [   83.170852] ath9k_hw_enable_interrupts	 848
> >> [   83.170855] ath9k_hw_intrpend	 762
> >> [   83.178398] (AR_SREV_9340(ah) val 0
> >> [   83.181873] ath9k_hw_intrpend	 767
> >> [   83.185265] ath_isr	 603
> >> [   83.187773] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.192635] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.197411] ath9k_hw_kill_interrupts	 793
> >> [   83.201414] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.206258] ath9k_hw_enable_interrupts	 821
> >> [   83.210368] ath9k_hw_enable_interrupts	 825
> >> [   83.214531] ath9k_hw_enable_interrupts	 832
> >> [   83.218698] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.223558] AR_SREV_9100 0
> >> [   83.226243] ath9k_hw_enable_interrupts	 848
> >> [   83.226246] ath9k_hw_intrpend	 762
> >> [   83.233794] (AR_SREV_9340(ah) val 0
> >> [   83.237268] ath9k_hw_intrpend	 767
> >> [   83.240661] ath_isr	 603
> >> [   83.243169] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.248030] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.252806] ath9k_hw_kill_interrupts	 793
> >> [   83.256811] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.261651] ath9k_hw_enable_interrupts	 821
> >> [   83.265753] ath9k_hw_enable_interrupts	 825
> >> [   83.269919] ath9k_hw_enable_interrupts	 832
> >> [   83.274083] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.278945] AR_SREV_9100 0
> >> [   83.281630] ath9k_hw_enable_interrupts	 848
> >> [   83.281633] ath9k_hw_intrpend	 762
> >> [   83.281634] (AR_SREV_9340(ah) val 0
> >> [   83.281637] ath9k_hw_intrpend	 767
> >> [   83.281648] ath_isr	 603
> >> [   83.281649] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.281651] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.281654] ath9k_hw_kill_interrupts	 793
> >> [   83.312192] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.317030] ath9k_hw_enable_interrupts	 821
> >> [   83.321132] ath9k_hw_enable_interrupts	 825
> >> [   83.325297] ath9k_hw_enable_interrupts	 832
> >> [   83.329463] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.334324] AR_SREV_9100 0
> >> [   83.337014] ath9k_hw_enable_interrupts	 848
> >> ..
> >> ..
> >> This log continues until I turn off board without obtaining scanning r=
esult.
> >>
> >> In between I get following cpu stall outputs :
> >>    230.457179] INFO: rcu_sched self-detected stall on CPU
> >> [  230.457185] 	2-...: (31314 ticks this GP)
> idle=3D2d1/140000000000001/0 softirq=3D1400/1400 fqs=3D36713
> >> [  230.457189] 	 (t=3D36756 jiffies g=3D161 c=3D160 q=3D16169)
> >> [  230.457191] Task dump for CPU 2:
> >> [  230.457196] kworker/u8:4    R  running task        0  1342      2 0=
x00000002
> >> [  230.457207] Workqueue: phy0 ieee80211_scan_work [  230.457208]
> >> Call trace:
> >> [  230.457214] [<ffffff8008089860>] dump_backtrace+0x0/0x198 [
> >> 230.457219] [<ffffff8008089a0c>] show_stack+0x14/0x20 [  230.457224]
> >> [<ffffff80080c0930>] sched_show_task+0x98/0xf8 [  230.457228]
> >> [<ffffff80080c2628>] dump_cpu_task+0x40/0x50 [  230.457233]
> >> [<ffffff80080e14a8>] rcu_dump_cpu_stacks+0xa0/0xf0 [  230.457239]
> >> [<ffffff80080e4cd8>] rcu_check_callbacks+0x468/0x748 [  230.457243]
> >> [<ffffff80080e7cfc>] update_process_times+0x3c/0x68 [  230.457249]
> >> [<ffffff80080f6dfc>] tick_sched_handle.isra.5+0x3c/0x50
> >> [  230.457253] [<ffffff80080f6e54>] tick_sched_timer+0x44/0x90 [
> >> 230.457257] [<ffffff80080e86b0>] __hrtimer_run_queues+0xf0/0x178
> >> ** 10 printk messages dropped ** [  230.457302] f8c0:
> >> 0000000000000000 0000000005f5e0ff 000000000001379a
> 3866666666666620 [
> >> 230.457306] f8e0: ffffff800a1b4065 0000000000000006 ffffff800a129000
> >> ffffffc87b8010a8 [  230.457310] f900: ffffff808a1b4057
> >> ffffff800a1c3000 ffffff800a1b3000 ffffff800a13b000 [  230.457314]
> >> f920: 0000000000000140 0000000000000006 ffffff800a1b3b10
> >> ffffff800a1c39e8 [  230.457318] f940: 000000000000002f
> >> ffffff800a1b8a98 ffffff800a1b3ae8 ffffffc87b07f990 [  230.457322]
> >> f960: ffffff80080d6230 ffffffc87b07f990 ffffff80080d6234
> >> 0000000060000145
> >> ** 1 printk messages dropped ** [  230.457329] [<ffffff8008085720>]
> >> el1_irq+0xa0/0x100
> >> ** 9 printk messages dropped ** [  230.457373] [<ffffff800885ad60>]
> >> ieee80211_hw_config+0x50/0x290 [  230.457377] [<ffffff8008863690>]
> >> ieee80211_scan_work+0x1f8/0x480 [  230.457383] [<ffffff80080b15d0>]
> >> process_one_work+0x120/0x378 [  230.457386] [<ffffff80080b1870>]
> >> worker_thread+0x48/0x4b0 [  230.457391] [<ffffff80080b7108>]
> >> kthread+0xd0/0xe8 [  230.457395] [<ffffff8008085dd0>]
> ret_from_fork+0x10/0x40
> >> [  230.480389] ath9k_hw_intrpend	 762
> >>
> >>
> >> [  545.487987] ath9k: ath9k_ioread32 ffffff800a400024 [  545.526189]
> >> INFO: rcu_sched self-detected stall on CPU
> >> [  545.526195] 	2-...: (97636 ticks this GP)
> idle=3D2d1/140000000000001/0 softirq=3D1400/1400 fqs=3D115374
> >> [  545.526199] 	 (t=3D115523 jiffies g=3D161 c=3D160 q=3D51066)
> >> [  545.526201] Task dump for CPU 2:
> >> [  545.526206] kworker/u8:4    R  running task        0  1342      2 0=
x00000002
> >> ** 3 printk messages dropped ** [  545.526231] [<ffffff8008089a0c>]
> >> show_stack+0x14/0x20
> >> ** 9 printk messages dropped ** [  545.526280] [<ffffff80086a71e8>]
> >> arch_timer_handler_phys+0x30/0x40 [  545.526284] [<ffffff80080dbe18>]
> >> handle_percpu_devid_irq+0x78/0xa0 [  545.526291] [<ffffff80080d760c>]
> >> generic_handle_irq+0x24/0x38 [  545.526296] [<ffffff80080d7944>]
> >> __handle_domain_irq+0x5c/0xb8 [  545.526299] [<ffffff80080824bc>]
> >> gic_handle_irq+0x64/0xc0 [  545.526302] Exception stack(0xffffffc87b07=
f870
> to 0xffffffc87b07f990)
> >> [  545.526306] f860:                                   000000000000973=
2 ffffff800a1eaaa8
> >> ** 8 printk messages dropped ** [  545.526341] f980: ffffff800a1c39e8
> >> 0000000000000036 [  545.526345] [<ffffff8008085720>]
> >> el1_irq+0xa0/0x100 [  545.526349] [<ffffff80080d6234>]
> >> console_unlock+0x384/0x5b0 [  545.526353] [<ffffff80080d673c>]
> >> vprintk_emit+0x2dc/0x4b0 [  545.526357] [<ffffff80080d6a50>]
> >> vprintk_default+0x38/0x40 [  545.526362] [<ffffff8008129704>]
> >> printk+0x58/0x60 [  545.526366] [<ffffff800859e3e4>]
> >> ath9k_iowrite32+0x9c/0xa8 [  545.526372] [<ffffff80085c7ca8>]
> >> ath9k_hw_kill_interrupts+0x28/0xf0
> >> [  545.526376] [<ffffff80085a18ec>] ath_reset+0x24/0x68
> >> ** 2 printk messages dropped ** [  545.526391] [<ffffff800885ad60>]
> ieee80211_hw_config+0x50/0x290
> >> ** 11 printk messages dropped ** [  545.532834] ath9k_hw_kill_interrup=
ts
> 	 793
> >> [  545.532890] ath9k_hw_enable_interrupts	 821
>=20
> [   81.876902] INFO: rcu_preempt detected stalls on CPUs/tasks:
> [   81.876912]     Tasks blocked on level-0 rcu_node (CPUs 0-7): P0
> [   81.876932]     (detected by 4, t=3D60002 jiffies, g=3D1873, c=3D1872,=
 q=3D4967)
> [   81.876936] swapper/4       R  running task        0     0      1
> 0x00000000
> [   81.876941]  0000000000000001 ffffffff810725f6 ffff88017edbc240
> ffffffff81a3dc40
> [   81.876945]  ffffffff81101e46 ffff88025ef173c0 ffffffff81a3dc40
> ffffffff81a3dc40
> [   81.876948]  00000000ffffffff ffffffff810a7333 ffff88017ecee698
> ffff88017edbc240
> [   81.876951] Call Trace:
> [   81.876970]  <IRQ>
> [   81.876979]  [<ffffffff810725f6>] ? sched_show_task+0xd6/0x140
> [   81.876983]  [<ffffffff81101e46>] ?
> rcu_print_detail_task_stall_rnp+0x40/0x61
> [   81.876989]  [<ffffffff810a7333>] ? rcu_check_callbacks+0x6b3/0x8c0
> [   81.876993]  [<ffffffff810b8350>] ? tick_sched_handle.isra.14+0x40/0x4=
0
> [   81.876996]  [<ffffffff810aa4c3>] ? update_process_times+0x23/0x50
> [   81.876999]  [<ffffffff810b8383>] ? tick_sched_timer+0x33/0x60
> [   81.877002]  [<ffffffff810aaf09>] ? __hrtimer_run_queues+0xb9/0x150
> [   81.877004]  [<ffffffff810ab198>] ? hrtimer_interrupt+0x98/0x1a0
> [   81.877008]  [<ffffffff81031b1e>] ?
> smp_trace_apic_timer_interrupt+0x5e/0x90
> [   81.877012]  [<ffffffff815b31bf>] ? apic_timer_interrupt+0x7f/0x90
> [   81.877013]  <EOI>
> [   81.877017]  [<ffffffff8147f28d>] ? cpuidle_enter_state+0x13d/0x1f0
> [   81.877019]  [<ffffffff8147f289>] ? cpuidle_enter_state+0x139/0x1f0
> [   81.877021]  [<ffffffff81088c19>] ? cpu_startup_entry+0x139/0x210
> [   81.877027]  [<ffffffff8102fc9e>] ? start_secondary+0x13e/0x170
> [   81.877029] swapper/4       R  running task        0     0      1
> 0x00000000
> [   81.877032]  0000000000000001 ffffffff810725f6 ffff88017edbc240
> ffffffff81a3dc40
> [   81.877035]  ffffffff81101e46 ffff88025ef173c0 ffffffff81a3dc40
> ffffffff81a3dc40
> [   81.877038]  00000000ffffffff ffffffff810a7368 ffff88017ecee698
> ffff88017edbc240
> [   81.877041] Call Trace:
> [   81.877045]  <IRQ>
> [   81.877049]  [<ffffffff810725f6>] ? sched_show_task+0xd6/0x140
> [   81.877051]  [<ffffffff81101e46>] ?
> rcu_print_detail_task_stall_rnp+0x40/0x61
> [   81.877055]  [<ffffffff810a7368>] ? rcu_check_callbacks+0x6e8/0x8c0
> [   81.877058]  [<ffffffff810b8350>] ? tick_sched_handle.isra.14+0x40/0x4=
0
> [   81.877060]  [<ffffffff810aa4c3>] ? update_process_times+0x23/0x50
> [   81.877063]  [<ffffffff810b8383>] ? tick_sched_timer+0x33/0x60
> [   81.877065]  [<ffffffff810aaf09>] ? __hrtimer_run_queues+0xb9/0x150
> [   81.877068]  [<ffffffff810ab198>] ? hrtimer_interrupt+0x98/0x1a0
> [   81.877070]  [<ffffffff81031b1e>] ?
> smp_trace_apic_timer_interrupt+0x5e/0x90
> [   81.877073]  [<ffffffff815b31bf>] ? apic_timer_interrupt+0x7f/0x90
> [   81.877074]  <EOI>
> [   81.877076]  [<ffffffff8147f28d>] ? cpuidle_enter_state+0x13d/0x1f0
> [   81.877078]  [<ffffffff8147f289>] ? cpuidle_enter_state+0x139/0x1f0
> [   81.877080]  [<ffffffff81088c19>] ? cpu_startup_entry+0x139/0x210
> [   81.877084]  [<ffffffff8102fc9e>] ? start_secondary+0x13e/0x170
> [   91.132787] INFO: rcu_preempt detected expedited stalls on
> CPUs/tasks: { P0 } 63785 jiffies s: 505 root: 0x0/T
> [   91.132796] blocking rcu_node structures:
>=20
> >>
> >>
> >> But if we have less debug prints it does not reach EP handler
> >> sometimes, due to following Condition in "kernel/irq/chip.c" in
> >> function handle_simple_irq
> >>
> >> if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) {
> >>                  desc->istate |=3D IRQS_PENDING;
> >>                  goto out_unlock;
> >>          }
> >> Here irqd_irq_disabled is being set to 1.
> >>
> >> With lesser debug prints it stops after following prints:
> >> root@Xilinx-ZCU102-2016_3:~# iw dev wlan0 scan
> >> [   54.781045] ath9k_hw_kill_interrupts	 793
> >> [   54.785007] ath9k_hw_kill_interrupts	 793
> >> [   54.792535] ath9k_hw_enable_interrupts	 821
> >> [   54.796642] ath9k_hw_enable_interrupts	 825
> >> [   54.800807] ath9k_hw_enable_interrupts	 832
> >> [   54.804973] AR_SREV_9100 0
> >> [   54.807663] ath9k_hw_enable_interrupts	 848
> >> [   54.811843] ath9k_hw_intrpend	 762
> >> [   54.815211] (AR_SREV_9340(ah) val 0
> >> [   54.818684] ath9k_hw_intrpend	 767
> >> [   54.822078] ath_isr	 603
> >> [   54.824587] ath9k_hw_kill_interrupts	 793
> >> [   54.828601] ath9k_hw_enable_interrupts	 821
> >> [   54.832750] ath9k_hw_enable_interrupts	 825
> >> [   54.836916] ath9k_hw_enable_interrupts	 832
> >> [   54.841082] AR_SREV_9100 0
> >> [   54.843772] ath9k_hw_enable_interrupts	 848
> >> [   54.843775] ath9k_hw_intrpend	 762
> >> [   54.851319] (AR_SREV_9340(ah) val 0
> >> [   54.854793] ath9k_hw_intrpend	 767
> >> [   54.858185] ath_isr	 603
> >> [   54.860696] ath9k_hw_kill_interrupts	 793
> >> [   54.864776] ath9k_hw_enable_interrupts	 821
> >> [   54.867061] ath9k_hw_kill_interrupts	 793
> >> [   54.872870] ath9k_hw_enable_interrupts	 825
> >> [   54.877036] ath9k_hw_enable_interrupts	 832
> >> [   54.881202] AR_SREV_9100 0
> >> [   54.883892] ath9k_hw_enable_interrupts	 848
> >> [   75.963129] INFO: rcu_sched detected stalls on CPUs/tasks:
> >> [   75.968602] 	0-...: (2 GPs behind) idle=3D9d5/140000000000001/0
> softirq=3D1103/1109 fqs=3D519
> >> [   75.976675] 	(detected by 2, t=3D5274 jiffies, g=3D64, c=3D63, q=3D=
11)
> >> [   75.982485] Task dump for CPU 0:
> >> [   75.985696] ksoftirqd/0     R  running task        0     3      2 0=
x00000002
> >> [   75.992726] Call trace:
> >> [   75.995165] [<ffffff8008086b3c>] __switch_to+0xc4/0xd0
> >> [   76.000281] [<ffffffc87b830500>] 0xffffffc87b830500
> >> [  139.059027] INFO: rcu_sched detected stalls on CPUs/tasks:
> >> [  139.064430] 	0-...: (2 GPs behind) idle=3D9d5/140000000000001/0
> softirq=3D1103/1109 fqs=3D2097
> >> [  139.072593] 	(detected by 2, t=3D21049 jiffies, g=3D64, c=3D63, q=
=3D11)
> >> [  139.078489] Task dump for CPU 0:
> >> [  139.081700] ksoftirqd/0     R  running task        0     3      2 0=
x00000002
> >> [  139.088731] Call trace:
> >> [  139.091165] [<ffffff8008086b3c>] __switch_to+0xc4/0xd0 [
> >> 139.096285] [<ffffffc87b830500>] 0xffffffc87b830500
> >>
> >>
> >>>> We are not seeing any issues on 32-bit ARM platform and X86
> >>>> platform.
> >>> Can you collect a dmesg log (or, if the system hang means you can't
> >>> collect that, a console log with "ignore_loglevel"), and "lspci -vv"
> >>> output as root?  That should have clues about whether the INTx got
> >>> routed correctly.  /proc/interrupts should also show whether we're
> >>> receiving interrupts from the device.
> >> Here is the lspci output:
> >> 00:00.0 PCI bridge: Xilinx Corporation Device d022 (prog-if 00 [Normal
> decode])
> >> 	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
> >> 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=3Dfast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
> >> 	Latency: 0
> >> 	Interrupt: pin A routed to IRQ 224
> >> 	Bus: primary=3D00, secondary=3D01, subordinate=3D0c, sec-latency=3D0
> >> 	I/O behind bridge: 00000000-00000fff
> >> 	Memory behind bridge: e0000000-e00fffff
> >> 	Prefetchable memory behind bridge: 00000000fff00000-
> 00000000000fffff
> >> 	Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=3Dfast >TAbort-
> <TAbort- <MAbort- <SERR- <PERR-
> >> 	BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
> >> 		PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
> >> 	Capabilities: [40] Power Management version 3
> >> 		Flags: PMEClk- DSI- D1- D2- AuxCurrent=3D0mA
> PME(D0+,D1+,D2+,D3hot+,D3cold-)
> >> 		Status: D0 NoSoftRst+ PME-Enable- DSel=3D0 DScale=3D0 PME-
> >> 	Capabilities: [60] Express (v2) Root Port (Slot-), MSI 00
> >> 		DevCap:	MaxPayload 256 bytes, PhantFunc 0
> >> 			ExtTag- RBE+
> >> 		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal-
> Unsupported-
> >> 			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
> >> 			MaxPayload 128 bytes, MaxReadReq 512 bytes
> >> 		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr-
> TransPend+
> >> 		LnkCap:	Port #0, Speed 5GT/s, Width x2, ASPM not supported,
> Exit Latency L0s unlimited, L1 unlimited
> >> 			ClockPM- Surprise- LLActRep- BwNot+ ASPMOptComp+
> >> 		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk-
> >> 			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
> >> 		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
> DLActive- BWMgmt- ABWMgmt-
> >> 		RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna-
> CRSVisible+
> >> 		RootCap: CRSVisible+
> >> 		RootSta: PME ReqID 0000, PMEStatus- PMEPending-
> >> 		DevCap2: Completion Timeout: Range B, TimeoutDis+, LTR-,
> OBFF Not Supported ARIFwd-
> >> 		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-,
> OBFF Disabled ARIFwd-
> >> 		LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
> >> 			 Transmit Margin: Normal Operating Range,
> EnterModifiedCompliance- ComplianceSOS-
> >> 			 Compliance De-emphasis: -6dB
> >> 		LnkSta2: Current De-emphasis Level: -3.5dB,
> EqualizationComplete-, EqualizationPhase1-
> >> 			 EqualizationPhase2-, EqualizationPhase3-,
> LinkEqualizationRequest-
> >> 	Capabilities: [100 v1] Device Serial Number 00-00-00-00-00-00-00-00
> >> 	Capabilities: [10c v1] Virtual Channel
> >> 		Caps:	LPEVC=3D0 RefClk=3D100ns PATEntryBits=3D1
> >> 		Arb:	Fixed- WRR32- WRR64- WRR128-
> >> 		Ctrl:	ArbSelect=3DFixed
> >> 		Status:	InProgress-
> >> 		VC0:	Caps:	PATOffset=3D00 MaxTimeSlots=3D1 RejSnoopTrans-
> >> 			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128-
> WRR256-
> >> 			Ctrl:	Enable+ ID=3D0 ArbSelect=3DFixed TC/VC=3Dff
> >> 			Status:	NegoPending- InProgress-
> >> 	Capabilities: [128 v1] Vendor Specific Information: ID=3D1234 Rev=3D1
> >> Len=3D018 <?>
> >>
> >> 01:00.0 Network controller: Qualcomm Atheros AR93xx Wireless Network
> Adapter (rev 01)
> >> 	Subsystem: Qualcomm Atheros Device 3112
> >> 	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
> >> 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=3Dfast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
> >> 	Latency: 0, Cache Line Size: 128 bytes
> >> 	Interrupt: pin A routed to IRQ 224
> >> 	Region 0: Memory at e0000000 (64-bit, non-prefetchable) [size=3D128K]
> >> 	[virtual] Expansion ROM at e0020000 [disabled] [size=3D64K]
> >> 	Capabilities: [40] Power Management version 3
> >> 		Flags: PMEClk- DSI- D1+ D2- AuxCurrent=3D375mA
> PME(D0+,D1+,D2-,D3hot+,D3cold-)
> >> 		Status: D0 NoSoftRst- PME-Enable- DSel=3D0 DScale=3D0 PME-
> >> 	Capabilities: [50] MSI: Enable- Count=3D1/4 Maskable+ 64bit+
> >> 		Address: 0000000000000000  Data: 0000
> >> 		Masking: 00000000  Pending: 00000000
> >> 	Capabilities: [70] Express (v2) Endpoint, MSI 00
> >> 		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency
> L0s <1us, L1 <8us
> >> 			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
> SlotPowerLimit 0.000W
> >> 		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal-
> Unsupported-
> >> 			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
> >> 			MaxPayload 128 bytes, MaxReadReq 512 bytes
> >> 		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr-
> TransPend-
> >> 		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
> Latency L0s <2us, L1 <64us
> >> 			ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
> >> 		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk-
> >> 			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
> >> 		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
> DLActive- BWMgmt- ABWMgmt-
> >> 		DevCap2: Completion Timeout: Not Supported, TimeoutDis+,
> LTR-, OBFF Not Supported
> >> 		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-,
> OBFF Disabled
> >> 		LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance-
> SpeedDis-
> >> 			 Transmit Margin: Normal Operating Range,
> EnterModifiedCompliance- ComplianceSOS-
> >> 			 Compliance De-emphasis: -6dB
> >> 		LnkSta2: Current De-emphasis Level: -6dB,
> EqualizationComplete-, EqualizationPhase1-
> >> 			 EqualizationPhase2-, EqualizationPhase3-,
> LinkEqualizationRequest-
> >> 	Capabilities: [100 v1] Advanced Error Reporting
> >> 		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
> >> 		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
> >> 		UESvrt:	DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
> >> 		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout-
> NonFatalErr-
> >> 		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout-
> NonFatalErr+
> >> 		AERCap:	First Error Pointer: 00, GenCap- CGenEn-
> ChkCap- ChkEn-
> >> 	Capabilities: [140 v1] Virtual Channel
> >> 		Caps:	LPEVC=3D0 RefClk=3D100ns PATEntryBits=3D1
> >> 		Arb:	Fixed- WRR32- WRR64- WRR128-
> >> 		Ctrl:	ArbSelect=3DFixed
> >> 		Status:	InProgress-
> >> 		VC0:	Caps:	PATOffset=3D00 MaxTimeSlots=3D1 RejSnoopTrans-
> >> 			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128-
> WRR256-
> >> 			Ctrl:	Enable+ ID=3D0 ArbSelect=3DFixed TC/VC=3Dff
> >> 			Status:	NegoPending- InProgress-
> >> 	Capabilities: [300 v1] Device Serial Number 00-00-00-00-00-00-00-00
> >> 	Kernel driver in use: ath9k
> >>
> >> Here is the cat /proc/interrupts (after we do interface up):
> >>
> >> root@:~# ifconfig wlan0 up
> >> [ 1548.926601] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
> >> root@Xilinx-ZCU102-2016_3:~# cat /proc/interrupts
> >>             CPU0       CPU1       CPU2       CPU3
> >>    1:          0          0          0          0     GICv2  29 Edge  =
    arch_timer
> >>    2:      19873      20058      19089      17435     GICv2  30 Edge  =
    arch_timer
> >>   12:          0          0          0          0     GICv2 156 Level =
    zynqmp-dma
> >>   13:          0          0          0          0     GICv2 157 Level =
    zynqmp-dma
> >>   14:          0          0          0          0     GICv2 158 Level =
    zynqmp-dma
> >>   15:          0          0          0          0     GICv2 159 Level =
    zynqmp-dma
> >>   16:          0          0          0          0     GICv2 160 Level =
    zynqmp-dma
> >>   17:          0          0          0          0     GICv2 161 Level =
    zynqmp-dma
> >>   18:          0          0          0          0     GICv2 162 Level =
    zynqmp-dma
> >>   19:          0          0          0          0     GICv2 163 Level =
    zynqmp-dma
> >>   20:          0          0          0          0     GICv2 164 Level =
    Mali_GP_MMU,
> Mali_GP, Mali_PP0_MMU, Mali_PP0, Mali_PP1_MMU, Mali_PP1
> >>   30:          0          0          0          0     GICv2  95 Level =
    eth0, eth0
> >> 206:        314          0          0          0     GICv2  49 Level  =
   cdns-i2c
> >> 207:         40          0          0          0     GICv2  50 Level  =
   cdns-i2c
> >> 209:          0          0          0          0     GICv2 150 Level  =
   nwl_pcie:misc
> >> 214:         12          0          0          0     GICv2  47 Level  =
   ff0f0000.spi
> >> 215:          0          0          0          0     GICv2  58 Level  =
   ffa60000.rtc
> >> 216:          0          0          0          0     GICv2  59 Level  =
   ffa60000.rtc
> >> 217:          0          0          0          0     GICv2 165 Level  =
   ahci-
> ceva[fd0c0000.ahci]
> >> 218:         61          0          0          0     GICv2  81 Level  =
   mmc0
> >> 219:          0          0          0          0     GICv2 187 Level  =
   arm-smmu global fault
> >> 220:        471          0          0          0     GICv2  53 Level  =
   xuartps
> >> 223:          0          0          0          0     GICv2 154 Level  =
   fd4c0000.dma
> >> 224:          3          0          0          0     dummy   1 Edge   =
   ath9k
> >> 225:          0          0          0          0     GICv2  97 Level  =
   xhci-hcd:usb1
> >>
> >> Regards,
> >> Bharat

^ permalink raw reply

* [PATCH 2/2] ath10k: htc: Simplified credit distribution.
From: Erik Stromdahl @ 2016-12-10 12:58 UTC (permalink / raw)
  To: kvalo, linux-wireless, ath10k; +Cc: Erik Stromdahl
In-Reply-To: <1481374721-16354-1-git-send-email-erik.stromdahl@gmail.com>

Simplified transmit credit distribution code somewhat.
Since the WMI control service will get assigned all credits
there is no need for having a credit_allocation array in
struct ath10k_htc.

Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
---
 drivers/net/wireless/ath/ath10k/htc.c |   29 +++++------------------------
 drivers/net/wireless/ath/ath10k/htc.h |    1 -
 2 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
index f2e0659..9f6a915 100644
--- a/drivers/net/wireless/ath/ath10k/htc.c
+++ b/drivers/net/wireless/ath/ath10k/htc.c
@@ -474,33 +474,16 @@ static void ath10k_htc_reset_endpoint_states(struct ath10k_htc *htc)
 	}
 }
 
-static void ath10k_htc_setup_target_buffer_assignments(struct ath10k_htc *htc)
-{
-	struct ath10k_htc_svc_tx_credits *entry;
-
-	entry = &htc->service_tx_alloc[0];
-
-	/*
-	 * for PCIE allocate all credists/HTC buffers to WMI.
-	 * no buffers are used/required for data. data always
-	 * remains on host.
-	 */
-	entry++;
-	entry->service_id = ATH10K_HTC_SVC_ID_WMI_CONTROL;
-	entry->credit_allocation = htc->total_transmit_credits;
-}
-
 static u8 ath10k_htc_get_credit_allocation(struct ath10k_htc *htc,
 					   u16 service_id)
 {
 	u8 allocation = 0;
-	int i;
 
-	for (i = 0; i < ATH10K_HTC_EP_COUNT; i++) {
-		if (htc->service_tx_alloc[i].service_id == service_id)
-			allocation =
-			    htc->service_tx_alloc[i].credit_allocation;
-	}
+	/* The WMI control service is the only service with flow control.
+	 * Let it have all transmit credits.
+	 */
+	if (service_id == ATH10K_HTC_SVC_ID_WMI_CONTROL)
+		allocation = htc->total_transmit_credits;
 
 	return allocation;
 }
@@ -574,8 +557,6 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc)
 		return -ECOMM;
 	}
 
-	ath10k_htc_setup_target_buffer_assignments(htc);
-
 	/* setup our pseudo HTC control endpoint connection */
 	memset(&conn_req, 0, sizeof(conn_req));
 	memset(&conn_resp, 0, sizeof(conn_resp));
diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h
index ca150c9..6ababa3 100644
--- a/drivers/net/wireless/ath/ath10k/htc.h
+++ b/drivers/net/wireless/ath/ath10k/htc.h
@@ -337,7 +337,6 @@ struct ath10k_htc {
 	struct completion ctl_resp;
 
 	int total_transmit_credits;
-	struct ath10k_htc_svc_tx_credits service_tx_alloc[ATH10K_HTC_EP_COUNT];
 	int target_credit_size;
 };
 
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH 1/2] ath10k: htc: Removal of unused struct members
From: Erik Stromdahl @ 2016-12-10 12:58 UTC (permalink / raw)
  To: kvalo, linux-wireless, ath10k; +Cc: Erik Stromdahl

Removed tx_credits_per_max_message and tx_credit_size
from struct ath10k_htc_ep since they are not used
anywhere in the code.

They are just written, never read.

Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
---
 drivers/net/wireless/ath/ath10k/htc.c |    6 ------
 drivers/net/wireless/ath/ath10k/htc.h |    2 --
 2 files changed, 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c
index 175aae3..f2e0659 100644
--- a/drivers/net/wireless/ath/ath10k/htc.c
+++ b/drivers/net/wireless/ath/ath10k/htc.c
@@ -726,12 +726,6 @@ int ath10k_htc_connect_service(struct ath10k_htc *htc,
 	ep->max_tx_queue_depth = conn_req->max_send_queue_depth;
 	ep->max_ep_message_len = __le16_to_cpu(resp_msg->max_msg_size);
 	ep->tx_credits = tx_alloc;
-	ep->tx_credit_size = htc->target_credit_size;
-	ep->tx_credits_per_max_message = ep->max_ep_message_len /
-					 htc->target_credit_size;
-
-	if (ep->max_ep_message_len % htc->target_credit_size)
-		ep->tx_credits_per_max_message++;
 
 	/* copy all the callbacks */
 	ep->ep_ops = conn_req->ep_ops;
diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h
index 0c55cd9..ca150c9 100644
--- a/drivers/net/wireless/ath/ath10k/htc.h
+++ b/drivers/net/wireless/ath/ath10k/htc.h
@@ -314,8 +314,6 @@ struct ath10k_htc_ep {
 
 	u8 seq_no; /* for debugging */
 	int tx_credits;
-	int tx_credit_size;
-	int tx_credits_per_max_message;
 	bool tx_credit_flow_enabled;
 };
 
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH 10/14] rtlwifi: Add BTC_TRACE_STRING to new btcoex
From: Joe Perches @ 2016-12-10  6:39 UTC (permalink / raw)
  To: Markus Böhme, Kalle Valo, Dan Carpenter
  Cc: devel, Ping-Ke Shih, linux-wireless, Larry Finger
In-Reply-To: <77555ffb-de05-2837-2e13-aaf4ec710fc3@mailbox.org>

On Sat, 2016-12-10 at 00:56 +0100, Markus Böhme wrote:
> On 12/09/2016 09:50 AM, Kalle Valo wrote:
> > Dan Carpenter <dan.carpenter@oracle.com> writes:
> > 
> > > On Thu, Dec 08, 2016 at 02:50:49PM +0300, Dan Carpenter wrote:
> > > > On Thu, Dec 08, 2016 at 01:43:42PM +0200, Kalle Valo wrote:
> > > > > But it would make me very happy if someone would add a similar grouping
> > > > > functionality to dyndbg to make it easy to enable a set of debug
> > > > > messages in a driver.
> > > > 
> > > > Thats seems like a reasonable thing as well.
> > > 
> > > I actually like the ath code...  We could easily change it to be more
> > > generic and make it a top level function for everyone to use.
> > 
> > That would be great. And maybe add a sysfs file with a description
> > different levels, like module parameters have. Too bad that I can't work
> > on that, too much stuff on my plate right now.
> > 
> 
> In this case I would like to step in and try to implement grouping of
> messages in the dynamic debug code. This seems to be an interesting
> learning opportunity.

Use bitmaps and levels.

^ permalink raw reply

* Re: pull-request: mac80211-next 2016-12-09
From: David Miller @ 2016-12-10  3:59 UTC (permalink / raw)
  To: johannes; +Cc: netdev, linux-wireless
In-Reply-To: <20161209120014.20292-1-johannes@sipsolutions.net>

From: Johannes Berg <johannes@sipsolutions.net>
Date: Fri,  9 Dec 2016 13:00:13 +0100

> Closing net-next caught me by surprise, so I had to rebase a bit,
> but these three patches really should go in soon. I'm not sending
> them for 4.9 this late though.
> 
> Please pull and let me know if there's any problem.

Pulled, thanks Johannes.

^ permalink raw reply

* Re: [PATCH 10/14] rtlwifi: Add BTC_TRACE_STRING to new btcoex
From: Markus Böhme @ 2016-12-09 23:56 UTC (permalink / raw)
  To: Kalle Valo, Dan Carpenter
  Cc: devel, Ping-Ke Shih, linux-wireless, Larry Finger
In-Reply-To: <87vaut32qd.fsf@kamboji.qca.qualcomm.com>

On 12/09/2016 09:50 AM, Kalle Valo wrote:
> Dan Carpenter <dan.carpenter@oracle.com> writes:
> 
>> On Thu, Dec 08, 2016 at 02:50:49PM +0300, Dan Carpenter wrote:
>>> On Thu, Dec 08, 2016 at 01:43:42PM +0200, Kalle Valo wrote:
>>>> But it would make me very happy if someone would add a similar grouping
>>>> functionality to dyndbg to make it easy to enable a set of debug
>>>> messages in a driver.
>>>
>>> Thats seems like a reasonable thing as well.
>>
>> I actually like the ath code...  We could easily change it to be more
>> generic and make it a top level function for everyone to use.
> 
> That would be great. And maybe add a sysfs file with a description
> different levels, like module parameters have. Too bad that I can't work
> on that, too much stuff on my plate right now.
> 

In this case I would like to step in and try to implement grouping of
messages in the dynamic debug code. This seems to be an interesting
learning opportunity.

Regards,
Markus

^ permalink raw reply

* RE: ATH9 driver issues on ARM64
From: Bharat Kumar Gogada @ 2016-12-09 14:35 UTC (permalink / raw)
  To: Tobias Klausmann, Kalle Valo
  Cc: Bjorn Helgaas, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, Marc Zyngier,
	Janusz.Dziedzic@tieto.com, rmanohar@qti.qualcomm.com,
	ath9k-devel@qca.qualcomm.com, linux-wireless@vger.kernel.org,
	Kalle Valo, rmanohar@qca.qualcomm.com
In-Reply-To: <8b348550-d909-cd98-4c04-dcf37b41f1ee@mni.thm.de>

 Correcting Manohar Mail ID.

> Hello there,
>=20
> as this is a thread about ath9k and ARM64, i'm not sure if i should
> answer here or not, but i have similar "stalls" with ath9k on x86_64
> (starting with 4.9rc), stack trace is posted down below where the
> original ARM64 stall traces are.
>=20
> Greetings,
>=20
> Tobias
>=20
>=20
> On 08.12.2016 18:36, Kalle Valo wrote:
> > Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com> writes:
> >
> >>   > [+cc Kalle, ath9k list]
> > Thanks, but please also CC linux-wireless. Full thread below for the
> > folks there.
> >
> >>> On Thu, Dec 08, 2016 at 01:49:42PM +0000, Bharat Kumar Gogada wrote:
> >>>> Hi,
> >>>>
> >>>> Did anyone test Atheros ATH9 driver(drivers/net/wireless/ath/ath9k/)
> >>>> on ARM64.  The end point is TP link wifi card with which supports
> >>>> only legacy interrupts.
> >>> If it works on other arches and the arm64 PCI enumeration works, my
> >>> first guess would be an INTx issue, e.g., maybe the driver is waiting
> >>> for an interrupt that never arrives.
> >> We are not sure for now.
> >>>> We are trying to test it on ARM64 with
> >>>> (drivers/pci/host/pcie-xilinx-nwl.c) as root port.
> >>>>
> >>>> EP is getting enumerated and able to link up.
> >>>>
> >>>> But when we start scan system gets hanged.
> >>> When you say the system hangs when you start a scan, I assume you mea=
n
> >>> a wifi scan, not the PCI enumeration.  A problem with a wifi scan
> >>> might cause a *process* to hang, but it shouldn't hang the entire
> >>> system.
> >>>
> >> Yes wifi scan.
> >>>> When we took trace we see that after we start scan assert message is
> >>>> sent but there is no de assert from end point.
> >>> Are you talking about a trace from a PCIe analyzer?  Do you see an
> >>> Assert_INTx PCIe message on the link?
> >>>
> >> Yes lecroy trace, yes we do see Assert_INTx and Deassert_INTx happenin=
g
> when we do interface link up.
> >> When we have less debug prints in Atheros driver, and do wifi scan we =
see
> Assert_INTx but never Deassert_INTx,
> >>>> What might cause end point not sending de assert ?
> >>> If the endpoint doesn't send a Deassert_INTx message, I expect that
> >>> would mean the driver didn't service the interrupt and remove the
> >>> condition that caused the device to assert the interrupt in the first
> >>> place.
> >>>
> >>> If the driver didn't receive the interrupt, it couldn't service it, o=
f
> >>> course.  You could add a printk in the ath9k interrupt service
> >>> routine to see if you ever get there.
> >>>
> >> The interrupt behavior is changing w.r.t amount of debug prints we add=
. (I
> kept many prints to aid debug)
> >> root@Xilinx-ZCU102-2016_3:~# iw dev wlan0 scan
> >> [   83.064675] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.069486] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.074257] ath9k_hw_kill_interrupts	 793
> >> [   83.078260] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.083107] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.087882] ath9k_hw_kill_interrupts	 793
> >> [   83.095450] ath9k_hw_enable_interrupts	 821
> >> [   83.099557] ath9k_hw_enable_interrupts	 825
> >> [   83.103721] ath9k_hw_enable_interrupts	 832
> >> [   83.107887] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.112748] AR_SREV_9100 0
> >> [   83.115438] ath9k_hw_enable_interrupts	 848
> >> [   83.119607] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.124389] ath9k_hw_intrpend	 762
> >> [   83.127761] (AR_SREV_9340(ah) val 0
> >> [   83.131234] ath9k_hw_intrpend	 767
> >> [   83.134628] ath_isr	 603
> >> [   83.137134] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.141995] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.146771] ath9k_hw_kill_interrupts	 793
> >> [   83.150864] ath9k_hw_enable_interrupts	 821
> >> [   83.154971] ath9k_hw_enable_interrupts	 825
> >> [   83.159135] ath9k_hw_enable_interrupts	 832
> >> [   83.163300] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.168161] AR_SREV_9100 0
> >> [   83.170852] ath9k_hw_enable_interrupts	 848
> >> [   83.170855] ath9k_hw_intrpend	 762
> >> [   83.178398] (AR_SREV_9340(ah) val 0
> >> [   83.181873] ath9k_hw_intrpend	 767
> >> [   83.185265] ath_isr	 603
> >> [   83.187773] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.192635] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.197411] ath9k_hw_kill_interrupts	 793
> >> [   83.201414] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.206258] ath9k_hw_enable_interrupts	 821
> >> [   83.210368] ath9k_hw_enable_interrupts	 825
> >> [   83.214531] ath9k_hw_enable_interrupts	 832
> >> [   83.218698] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.223558] AR_SREV_9100 0
> >> [   83.226243] ath9k_hw_enable_interrupts	 848
> >> [   83.226246] ath9k_hw_intrpend	 762
> >> [   83.233794] (AR_SREV_9340(ah) val 0
> >> [   83.237268] ath9k_hw_intrpend	 767
> >> [   83.240661] ath_isr	 603
> >> [   83.243169] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.248030] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.252806] ath9k_hw_kill_interrupts	 793
> >> [   83.256811] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.261651] ath9k_hw_enable_interrupts	 821
> >> [   83.265753] ath9k_hw_enable_interrupts	 825
> >> [   83.269919] ath9k_hw_enable_interrupts	 832
> >> [   83.274083] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.278945] AR_SREV_9100 0
> >> [   83.281630] ath9k_hw_enable_interrupts	 848
> >> [   83.281633] ath9k_hw_intrpend	 762
> >> [   83.281634] (AR_SREV_9340(ah) val 0
> >> [   83.281637] ath9k_hw_intrpend	 767
> >> [   83.281648] ath_isr	 603
> >> [   83.281649] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.281651] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.281654] ath9k_hw_kill_interrupts	 793
> >> [   83.312192] ath9k: ath9k_ioread32 ffffff800a400024
> >> [   83.317030] ath9k_hw_enable_interrupts	 821
> >> [   83.321132] ath9k_hw_enable_interrupts	 825
> >> [   83.325297] ath9k_hw_enable_interrupts	 832
> >> [   83.329463] ath9k: ath9k_iowrite32 ffffff800a400024
> >> [   83.334324] AR_SREV_9100 0
> >> [   83.337014] ath9k_hw_enable_interrupts	 848
> >> ..
> >> ..
> >> This log continues until I turn off board without obtaining scanning r=
esult.
> >>
> >> In between I get following cpu stall outputs :
> >>    230.457179] INFO: rcu_sched self-detected stall on CPU
> >> [  230.457185] 	2-...: (31314 ticks this GP)
> idle=3D2d1/140000000000001/0 softirq=3D1400/1400 fqs=3D36713
> >> [  230.457189] 	 (t=3D36756 jiffies g=3D161 c=3D160 q=3D16169)
> >> [  230.457191] Task dump for CPU 2:
> >> [  230.457196] kworker/u8:4    R  running task        0  1342      2 0=
x00000002
> >> [  230.457207] Workqueue: phy0 ieee80211_scan_work
> >> [  230.457208] Call trace:
> >> [  230.457214] [<ffffff8008089860>] dump_backtrace+0x0/0x198
> >> [  230.457219] [<ffffff8008089a0c>] show_stack+0x14/0x20
> >> [  230.457224] [<ffffff80080c0930>] sched_show_task+0x98/0xf8
> >> [  230.457228] [<ffffff80080c2628>] dump_cpu_task+0x40/0x50
> >> [  230.457233] [<ffffff80080e14a8>] rcu_dump_cpu_stacks+0xa0/0xf0
> >> [  230.457239] [<ffffff80080e4cd8>] rcu_check_callbacks+0x468/0x748
> >> [  230.457243] [<ffffff80080e7cfc>] update_process_times+0x3c/0x68
> >> [  230.457249] [<ffffff80080f6dfc>] tick_sched_handle.isra.5+0x3c/0x50
> >> [  230.457253] [<ffffff80080f6e54>] tick_sched_timer+0x44/0x90
> >> [  230.457257] [<ffffff80080e86b0>] __hrtimer_run_queues+0xf0/0x178
> >> ** 10 printk messages dropped ** [  230.457302] f8c0: 0000000000000000
> 0000000005f5e0ff 000000000001379a 3866666666666620
> >> [  230.457306] f8e0: ffffff800a1b4065 0000000000000006 ffffff800a12900=
0
> ffffffc87b8010a8
> >> [  230.457310] f900: ffffff808a1b4057 ffffff800a1c3000 ffffff800a1b300=
0
> ffffff800a13b000
> >> [  230.457314] f920: 0000000000000140 0000000000000006
> ffffff800a1b3b10 ffffff800a1c39e8
> >> [  230.457318] f940: 000000000000002f ffffff800a1b8a98 ffffff800a1b3ae=
8
> ffffffc87b07f990
> >> [  230.457322] f960: ffffff80080d6230 ffffffc87b07f990 ffffff80080d623=
4
> 0000000060000145
> >> ** 1 printk messages dropped ** [  230.457329] [<ffffff8008085720>]
> el1_irq+0xa0/0x100
> >> ** 9 printk messages dropped ** [  230.457373] [<ffffff800885ad60>]
> ieee80211_hw_config+0x50/0x290
> >> [  230.457377] [<ffffff8008863690>] ieee80211_scan_work+0x1f8/0x480
> >> [  230.457383] [<ffffff80080b15d0>] process_one_work+0x120/0x378
> >> [  230.457386] [<ffffff80080b1870>] worker_thread+0x48/0x4b0
> >> [  230.457391] [<ffffff80080b7108>] kthread+0xd0/0xe8
> >> [  230.457395] [<ffffff8008085dd0>] ret_from_fork+0x10/0x40
> >> [  230.480389] ath9k_hw_intrpend	 762
> >>
> >>
> >> [  545.487987] ath9k: ath9k_ioread32 ffffff800a400024
> >> [  545.526189] INFO: rcu_sched self-detected stall on CPU
> >> [  545.526195] 	2-...: (97636 ticks this GP)
> idle=3D2d1/140000000000001/0 softirq=3D1400/1400 fqs=3D115374
> >> [  545.526199] 	 (t=3D115523 jiffies g=3D161 c=3D160 q=3D51066)
> >> [  545.526201] Task dump for CPU 2:
> >> [  545.526206] kworker/u8:4    R  running task        0  1342      2 0=
x00000002
> >> ** 3 printk messages dropped ** [  545.526231] [<ffffff8008089a0c>]
> show_stack+0x14/0x20
> >> ** 9 printk messages dropped ** [  545.526280] [<ffffff80086a71e8>]
> arch_timer_handler_phys+0x30/0x40
> >> [  545.526284] [<ffffff80080dbe18>] handle_percpu_devid_irq+0x78/0xa0
> >> [  545.526291] [<ffffff80080d760c>] generic_handle_irq+0x24/0x38
> >> [  545.526296] [<ffffff80080d7944>] __handle_domain_irq+0x5c/0xb8
> >> [  545.526299] [<ffffff80080824bc>] gic_handle_irq+0x64/0xc0
> >> [  545.526302] Exception stack(0xffffffc87b07f870 to 0xffffffc87b07f99=
0)
> >> [  545.526306] f860:                                   000000000000973=
2 ffffff800a1eaaa8
> >> ** 8 printk messages dropped ** [  545.526341] f980: ffffff800a1c39e8
> 0000000000000036
> >> [  545.526345] [<ffffff8008085720>] el1_irq+0xa0/0x100
> >> [  545.526349] [<ffffff80080d6234>] console_unlock+0x384/0x5b0
> >> [  545.526353] [<ffffff80080d673c>] vprintk_emit+0x2dc/0x4b0
> >> [  545.526357] [<ffffff80080d6a50>] vprintk_default+0x38/0x40
> >> [  545.526362] [<ffffff8008129704>] printk+0x58/0x60
> >> [  545.526366] [<ffffff800859e3e4>] ath9k_iowrite32+0x9c/0xa8
> >> [  545.526372] [<ffffff80085c7ca8>] ath9k_hw_kill_interrupts+0x28/0xf0
> >> [  545.526376] [<ffffff80085a18ec>] ath_reset+0x24/0x68
> >> ** 2 printk messages dropped ** [  545.526391] [<ffffff800885ad60>]
> ieee80211_hw_config+0x50/0x290
> >> ** 11 printk messages dropped ** [  545.532834] ath9k_hw_kill_interrup=
ts
> 	 793
> >> [  545.532890] ath9k_hw_enable_interrupts	 821
>=20
> [   81.876902] INFO: rcu_preempt detected stalls on CPUs/tasks:
> [   81.876912]     Tasks blocked on level-0 rcu_node (CPUs 0-7): P0
> [   81.876932]     (detected by 4, t=3D60002 jiffies, g=3D1873, c=3D1872,=
 q=3D4967)
> [   81.876936] swapper/4       R  running task        0     0      1
> 0x00000000
> [   81.876941]  0000000000000001 ffffffff810725f6 ffff88017edbc240
> ffffffff81a3dc40
> [   81.876945]  ffffffff81101e46 ffff88025ef173c0 ffffffff81a3dc40
> ffffffff81a3dc40
> [   81.876948]  00000000ffffffff ffffffff810a7333 ffff88017ecee698
> ffff88017edbc240
> [   81.876951] Call Trace:
> [   81.876970]  <IRQ>
> [   81.876979]  [<ffffffff810725f6>] ? sched_show_task+0xd6/0x140
> [   81.876983]  [<ffffffff81101e46>] ?
> rcu_print_detail_task_stall_rnp+0x40/0x61
> [   81.876989]  [<ffffffff810a7333>] ? rcu_check_callbacks+0x6b3/0x8c0
> [   81.876993]  [<ffffffff810b8350>] ? tick_sched_handle.isra.14+0x40/0x4=
0
> [   81.876996]  [<ffffffff810aa4c3>] ? update_process_times+0x23/0x50
> [   81.876999]  [<ffffffff810b8383>] ? tick_sched_timer+0x33/0x60
> [   81.877002]  [<ffffffff810aaf09>] ? __hrtimer_run_queues+0xb9/0x150
> [   81.877004]  [<ffffffff810ab198>] ? hrtimer_interrupt+0x98/0x1a0
> [   81.877008]  [<ffffffff81031b1e>] ?
> smp_trace_apic_timer_interrupt+0x5e/0x90
> [   81.877012]  [<ffffffff815b31bf>] ? apic_timer_interrupt+0x7f/0x90
> [   81.877013]  <EOI>
> [   81.877017]  [<ffffffff8147f28d>] ? cpuidle_enter_state+0x13d/0x1f0
> [   81.877019]  [<ffffffff8147f289>] ? cpuidle_enter_state+0x139/0x1f0
> [   81.877021]  [<ffffffff81088c19>] ? cpu_startup_entry+0x139/0x210
> [   81.877027]  [<ffffffff8102fc9e>] ? start_secondary+0x13e/0x170
> [   81.877029] swapper/4       R  running task        0     0      1
> 0x00000000
> [   81.877032]  0000000000000001 ffffffff810725f6 ffff88017edbc240
> ffffffff81a3dc40
> [   81.877035]  ffffffff81101e46 ffff88025ef173c0 ffffffff81a3dc40
> ffffffff81a3dc40
> [   81.877038]  00000000ffffffff ffffffff810a7368 ffff88017ecee698
> ffff88017edbc240
> [   81.877041] Call Trace:
> [   81.877045]  <IRQ>
> [   81.877049]  [<ffffffff810725f6>] ? sched_show_task+0xd6/0x140
> [   81.877051]  [<ffffffff81101e46>] ?
> rcu_print_detail_task_stall_rnp+0x40/0x61
> [   81.877055]  [<ffffffff810a7368>] ? rcu_check_callbacks+0x6e8/0x8c0
> [   81.877058]  [<ffffffff810b8350>] ? tick_sched_handle.isra.14+0x40/0x4=
0
> [   81.877060]  [<ffffffff810aa4c3>] ? update_process_times+0x23/0x50
> [   81.877063]  [<ffffffff810b8383>] ? tick_sched_timer+0x33/0x60
> [   81.877065]  [<ffffffff810aaf09>] ? __hrtimer_run_queues+0xb9/0x150
> [   81.877068]  [<ffffffff810ab198>] ? hrtimer_interrupt+0x98/0x1a0
> [   81.877070]  [<ffffffff81031b1e>] ?
> smp_trace_apic_timer_interrupt+0x5e/0x90
> [   81.877073]  [<ffffffff815b31bf>] ? apic_timer_interrupt+0x7f/0x90
> [   81.877074]  <EOI>
> [   81.877076]  [<ffffffff8147f28d>] ? cpuidle_enter_state+0x13d/0x1f0
> [   81.877078]  [<ffffffff8147f289>] ? cpuidle_enter_state+0x139/0x1f0
> [   81.877080]  [<ffffffff81088c19>] ? cpu_startup_entry+0x139/0x210
> [   81.877084]  [<ffffffff8102fc9e>] ? start_secondary+0x13e/0x170
> [   91.132787] INFO: rcu_preempt detected expedited stalls on
> CPUs/tasks: { P0 } 63785 jiffies s: 505 root: 0x0/T
> [   91.132796] blocking rcu_node structures:
>=20
> >>
> >>
> >> But if we have less debug prints it does not reach EP handler sometime=
s, due
> to following
> >> Condition in "kernel/irq/chip.c" in function handle_simple_irq
> >>
> >> if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) {
> >>                  desc->istate |=3D IRQS_PENDING;
> >>                  goto out_unlock;
> >>          }
> >> Here irqd_irq_disabled is being set to 1.
> >>
> >> With lesser debug prints it stops after following prints:
> >> root@Xilinx-ZCU102-2016_3:~# iw dev wlan0 scan
> >> [   54.781045] ath9k_hw_kill_interrupts	 793
> >> [   54.785007] ath9k_hw_kill_interrupts	 793
> >> [   54.792535] ath9k_hw_enable_interrupts	 821
> >> [   54.796642] ath9k_hw_enable_interrupts	 825
> >> [   54.800807] ath9k_hw_enable_interrupts	 832
> >> [   54.804973] AR_SREV_9100 0
> >> [   54.807663] ath9k_hw_enable_interrupts	 848
> >> [   54.811843] ath9k_hw_intrpend	 762
> >> [   54.815211] (AR_SREV_9340(ah) val 0
> >> [   54.818684] ath9k_hw_intrpend	 767
> >> [   54.822078] ath_isr	 603
> >> [   54.824587] ath9k_hw_kill_interrupts	 793
> >> [   54.828601] ath9k_hw_enable_interrupts	 821
> >> [   54.832750] ath9k_hw_enable_interrupts	 825
> >> [   54.836916] ath9k_hw_enable_interrupts	 832
> >> [   54.841082] AR_SREV_9100 0
> >> [   54.843772] ath9k_hw_enable_interrupts	 848
> >> [   54.843775] ath9k_hw_intrpend	 762
> >> [   54.851319] (AR_SREV_9340(ah) val 0
> >> [   54.854793] ath9k_hw_intrpend	 767
> >> [   54.858185] ath_isr	 603
> >> [   54.860696] ath9k_hw_kill_interrupts	 793
> >> [   54.864776] ath9k_hw_enable_interrupts	 821
> >> [   54.867061] ath9k_hw_kill_interrupts	 793
> >> [   54.872870] ath9k_hw_enable_interrupts	 825
> >> [   54.877036] ath9k_hw_enable_interrupts	 832
> >> [   54.881202] AR_SREV_9100 0
> >> [   54.883892] ath9k_hw_enable_interrupts	 848
> >> [   75.963129] INFO: rcu_sched detected stalls on CPUs/tasks:
> >> [   75.968602] 	0-...: (2 GPs behind) idle=3D9d5/140000000000001/0
> softirq=3D1103/1109 fqs=3D519
> >> [   75.976675] 	(detected by 2, t=3D5274 jiffies, g=3D64, c=3D63, q=3D=
11)
> >> [   75.982485] Task dump for CPU 0:
> >> [   75.985696] ksoftirqd/0     R  running task        0     3      2 0=
x00000002
> >> [   75.992726] Call trace:
> >> [   75.995165] [<ffffff8008086b3c>] __switch_to+0xc4/0xd0
> >> [   76.000281] [<ffffffc87b830500>] 0xffffffc87b830500
> >> [  139.059027] INFO: rcu_sched detected stalls on CPUs/tasks:
> >> [  139.064430] 	0-...: (2 GPs behind) idle=3D9d5/140000000000001/0
> softirq=3D1103/1109 fqs=3D2097
> >> [  139.072593] 	(detected by 2, t=3D21049 jiffies, g=3D64, c=3D63, q=
=3D11)
> >> [  139.078489] Task dump for CPU 0:
> >> [  139.081700] ksoftirqd/0     R  running task        0     3      2 0=
x00000002
> >> [  139.088731] Call trace:
> >> [  139.091165] [<ffffff8008086b3c>] __switch_to+0xc4/0xd0
> >> [  139.096285] [<ffffffc87b830500>] 0xffffffc87b830500
> >>
> >>
> >>>> We are not seeing any issues on 32-bit ARM platform and X86
> >>>> platform.
> >>> Can you collect a dmesg log (or, if the system hang means you can't
> >>> collect that, a console log with "ignore_loglevel"), and "lspci -vv"
> >>> output as root?  That should have clues about whether the INTx got
> >>> routed correctly.  /proc/interrupts should also show whether we're
> >>> receiving interrupts from the device.
> >> Here is the lspci output:
> >> 00:00.0 PCI bridge: Xilinx Corporation Device d022 (prog-if 00 [Normal
> decode])
> >> 	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
> >> 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=3Dfast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
> >> 	Latency: 0
> >> 	Interrupt: pin A routed to IRQ 224
> >> 	Bus: primary=3D00, secondary=3D01, subordinate=3D0c, sec-latency=3D0
> >> 	I/O behind bridge: 00000000-00000fff
> >> 	Memory behind bridge: e0000000-e00fffff
> >> 	Prefetchable memory behind bridge: 00000000fff00000-
> 00000000000fffff
> >> 	Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=3Dfast >TAbort-
> <TAbort- <MAbort- <SERR- <PERR-
> >> 	BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
> >> 		PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
> >> 	Capabilities: [40] Power Management version 3
> >> 		Flags: PMEClk- DSI- D1- D2- AuxCurrent=3D0mA
> PME(D0+,D1+,D2+,D3hot+,D3cold-)
> >> 		Status: D0 NoSoftRst+ PME-Enable- DSel=3D0 DScale=3D0 PME-
> >> 	Capabilities: [60] Express (v2) Root Port (Slot-), MSI 00
> >> 		DevCap:	MaxPayload 256 bytes, PhantFunc 0
> >> 			ExtTag- RBE+
> >> 		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal-
> Unsupported-
> >> 			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
> >> 			MaxPayload 128 bytes, MaxReadReq 512 bytes
> >> 		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr-
> TransPend+
> >> 		LnkCap:	Port #0, Speed 5GT/s, Width x2, ASPM not supported,
> Exit Latency L0s unlimited, L1 unlimited
> >> 			ClockPM- Surprise- LLActRep- BwNot+ ASPMOptComp+
> >> 		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk-
> >> 			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
> >> 		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
> DLActive- BWMgmt- ABWMgmt-
> >> 		RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna-
> CRSVisible+
> >> 		RootCap: CRSVisible+
> >> 		RootSta: PME ReqID 0000, PMEStatus- PMEPending-
> >> 		DevCap2: Completion Timeout: Range B, TimeoutDis+, LTR-,
> OBFF Not Supported ARIFwd-
> >> 		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-,
> OBFF Disabled ARIFwd-
> >> 		LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
> >> 			 Transmit Margin: Normal Operating Range,
> EnterModifiedCompliance- ComplianceSOS-
> >> 			 Compliance De-emphasis: -6dB
> >> 		LnkSta2: Current De-emphasis Level: -3.5dB,
> EqualizationComplete-, EqualizationPhase1-
> >> 			 EqualizationPhase2-, EqualizationPhase3-,
> LinkEqualizationRequest-
> >> 	Capabilities: [100 v1] Device Serial Number 00-00-00-00-00-00-00-00
> >> 	Capabilities: [10c v1] Virtual Channel
> >> 		Caps:	LPEVC=3D0 RefClk=3D100ns PATEntryBits=3D1
> >> 		Arb:	Fixed- WRR32- WRR64- WRR128-
> >> 		Ctrl:	ArbSelect=3DFixed
> >> 		Status:	InProgress-
> >> 		VC0:	Caps:	PATOffset=3D00 MaxTimeSlots=3D1 RejSnoopTrans-
> >> 			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128-
> WRR256-
> >> 			Ctrl:	Enable+ ID=3D0 ArbSelect=3DFixed TC/VC=3Dff
> >> 			Status:	NegoPending- InProgress-
> >> 	Capabilities: [128 v1] Vendor Specific Information: ID=3D1234 Rev=3D1
> Len=3D018 <?>
> >>
> >> 01:00.0 Network controller: Qualcomm Atheros AR93xx Wireless Network
> Adapter (rev 01)
> >> 	Subsystem: Qualcomm Atheros Device 3112
> >> 	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
> >> 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=3Dfast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
> >> 	Latency: 0, Cache Line Size: 128 bytes
> >> 	Interrupt: pin A routed to IRQ 224
> >> 	Region 0: Memory at e0000000 (64-bit, non-prefetchable) [size=3D128K]
> >> 	[virtual] Expansion ROM at e0020000 [disabled] [size=3D64K]
> >> 	Capabilities: [40] Power Management version 3
> >> 		Flags: PMEClk- DSI- D1+ D2- AuxCurrent=3D375mA
> PME(D0+,D1+,D2-,D3hot+,D3cold-)
> >> 		Status: D0 NoSoftRst- PME-Enable- DSel=3D0 DScale=3D0 PME-
> >> 	Capabilities: [50] MSI: Enable- Count=3D1/4 Maskable+ 64bit+
> >> 		Address: 0000000000000000  Data: 0000
> >> 		Masking: 00000000  Pending: 00000000
> >> 	Capabilities: [70] Express (v2) Endpoint, MSI 00
> >> 		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency
> L0s <1us, L1 <8us
> >> 			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
> SlotPowerLimit 0.000W
> >> 		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal-
> Unsupported-
> >> 			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
> >> 			MaxPayload 128 bytes, MaxReadReq 512 bytes
> >> 		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr-
> TransPend-
> >> 		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
> Latency L0s <2us, L1 <64us
> >> 			ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
> >> 		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk-
> >> 			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
> >> 		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
> DLActive- BWMgmt- ABWMgmt-
> >> 		DevCap2: Completion Timeout: Not Supported, TimeoutDis+,
> LTR-, OBFF Not Supported
> >> 		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-,
> OBFF Disabled
> >> 		LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance-
> SpeedDis-
> >> 			 Transmit Margin: Normal Operating Range,
> EnterModifiedCompliance- ComplianceSOS-
> >> 			 Compliance De-emphasis: -6dB
> >> 		LnkSta2: Current De-emphasis Level: -6dB,
> EqualizationComplete-, EqualizationPhase1-
> >> 			 EqualizationPhase2-, EqualizationPhase3-,
> LinkEqualizationRequest-
> >> 	Capabilities: [100 v1] Advanced Error Reporting
> >> 		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
> >> 		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
> >> 		UESvrt:	DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
> >> 		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout-
> NonFatalErr-
> >> 		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout-
> NonFatalErr+
> >> 		AERCap:	First Error Pointer: 00, GenCap- CGenEn-
> ChkCap- ChkEn-
> >> 	Capabilities: [140 v1] Virtual Channel
> >> 		Caps:	LPEVC=3D0 RefClk=3D100ns PATEntryBits=3D1
> >> 		Arb:	Fixed- WRR32- WRR64- WRR128-
> >> 		Ctrl:	ArbSelect=3DFixed
> >> 		Status:	InProgress-
> >> 		VC0:	Caps:	PATOffset=3D00 MaxTimeSlots=3D1 RejSnoopTrans-
> >> 			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128-
> WRR256-
> >> 			Ctrl:	Enable+ ID=3D0 ArbSelect=3DFixed TC/VC=3Dff
> >> 			Status:	NegoPending- InProgress-
> >> 	Capabilities: [300 v1] Device Serial Number 00-00-00-00-00-00-00-00
> >> 	Kernel driver in use: ath9k
> >>
> >> Here is the cat /proc/interrupts (after we do interface up):
> >>
> >> root@:~# ifconfig wlan0 up
> >> [ 1548.926601] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
> >> root@Xilinx-ZCU102-2016_3:~# cat /proc/interrupts
> >>             CPU0       CPU1       CPU2       CPU3
> >>    1:          0          0          0          0     GICv2  29 Edge  =
    arch_timer
> >>    2:      19873      20058      19089      17435     GICv2  30 Edge  =
    arch_timer
> >>   12:          0          0          0          0     GICv2 156 Level =
    zynqmp-dma
> >>   13:          0          0          0          0     GICv2 157 Level =
    zynqmp-dma
> >>   14:          0          0          0          0     GICv2 158 Level =
    zynqmp-dma
> >>   15:          0          0          0          0     GICv2 159 Level =
    zynqmp-dma
> >>   16:          0          0          0          0     GICv2 160 Level =
    zynqmp-dma
> >>   17:          0          0          0          0     GICv2 161 Level =
    zynqmp-dma
> >>   18:          0          0          0          0     GICv2 162 Level =
    zynqmp-dma
> >>   19:          0          0          0          0     GICv2 163 Level =
    zynqmp-dma
> >>   20:          0          0          0          0     GICv2 164 Level =
    Mali_GP_MMU,
> Mali_GP, Mali_PP0_MMU, Mali_PP0, Mali_PP1_MMU, Mali_PP1
> >>   30:          0          0          0          0     GICv2  95 Level =
    eth0, eth0
> >> 206:        314          0          0          0     GICv2  49 Level  =
   cdns-i2c
> >> 207:         40          0          0          0     GICv2  50 Level  =
   cdns-i2c
> >> 209:          0          0          0          0     GICv2 150 Level  =
   nwl_pcie:misc
> >> 214:         12          0          0          0     GICv2  47 Level  =
   ff0f0000.spi
> >> 215:          0          0          0          0     GICv2  58 Level  =
   ffa60000.rtc
> >> 216:          0          0          0          0     GICv2  59 Level  =
   ffa60000.rtc
> >> 217:          0          0          0          0     GICv2 165 Level  =
   ahci-
> ceva[fd0c0000.ahci]
> >> 218:         61          0          0          0     GICv2  81 Level  =
   mmc0
> >> 219:          0          0          0          0     GICv2 187 Level  =
   arm-smmu global fault
> >> 220:        471          0          0          0     GICv2  53 Level  =
   xuartps
> >> 223:          0          0          0          0     GICv2 154 Level  =
   fd4c0000.dma
> >> 224:          3          0          0          0     dummy   1 Edge   =
   ath9k
> >> 225:          0          0          0          0     GICv2  97 Level  =
   xhci-hcd:usb1
> >>
> >> Regards,
> >> Bharat

^ permalink raw reply

* Re: ATH9 driver issues on ARM64
From: Tobias Klausmann @ 2016-12-09 14:22 UTC (permalink / raw)
  To: Kalle Valo, Bharat Kumar Gogada
  Cc: Bjorn Helgaas, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, Marc Zyngier,
	Janusz.Dziedzic@tieto.com, rmanohar@qti.qualcomm.com,
	ath9k-devel@qca.qualcomm.com, linux-wireless
In-Reply-To: <874m2emif9.fsf@purkki.adurom.net>

Hello there,

as this is a thread about ath9k and ARM64, i'm not sure if i should 
answer here or not, but i have similar "stalls" with ath9k on x86_64 
(starting with 4.9rc), stack trace is posted down below where the 
original ARM64 stall traces are.

Greetings,

Tobias


On 08.12.2016 18:36, Kalle Valo wrote:
> Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com> writes:
>
>>   > [+cc Kalle, ath9k list]
> Thanks, but please also CC linux-wireless. Full thread below for the
> folks there.
>
>>> On Thu, Dec 08, 2016 at 01:49:42PM +0000, Bharat Kumar Gogada wrote:
>>>> Hi,
>>>>
>>>> Did anyone test Atheros ATH9 driver(drivers/net/wireless/ath/ath9k/)
>>>> on ARM64.  The end point is TP link wifi card with which supports
>>>> only legacy interrupts.
>>> If it works on other arches and the arm64 PCI enumeration works, my
>>> first guess would be an INTx issue, e.g., maybe the driver is waiting
>>> for an interrupt that never arrives.
>> We are not sure for now.
>>>> We are trying to test it on ARM64 with
>>>> (drivers/pci/host/pcie-xilinx-nwl.c) as root port.
>>>>
>>>> EP is getting enumerated and able to link up.
>>>>
>>>> But when we start scan system gets hanged.
>>> When you say the system hangs when you start a scan, I assume you mean
>>> a wifi scan, not the PCI enumeration.  A problem with a wifi scan
>>> might cause a *process* to hang, but it shouldn't hang the entire
>>> system.
>>>
>> Yes wifi scan.
>>>> When we took trace we see that after we start scan assert message is
>>>> sent but there is no de assert from end point.
>>> Are you talking about a trace from a PCIe analyzer?  Do you see an
>>> Assert_INTx PCIe message on the link?
>>>
>> Yes lecroy trace, yes we do see Assert_INTx and Deassert_INTx happening when we do interface link up.
>> When we have less debug prints in Atheros driver, and do wifi scan we see Assert_INTx but never Deassert_INTx,
>>>> What might cause end point not sending de assert ?
>>> If the endpoint doesn't send a Deassert_INTx message, I expect that
>>> would mean the driver didn't service the interrupt and remove the
>>> condition that caused the device to assert the interrupt in the first
>>> place.
>>>
>>> If the driver didn't receive the interrupt, it couldn't service it, of
>>> course.  You could add a printk in the ath9k interrupt service
>>> routine to see if you ever get there.
>>>
>> The interrupt behavior is changing w.r.t amount of debug prints we add. (I kept many prints to aid debug)
>> root@Xilinx-ZCU102-2016_3:~# iw dev wlan0 scan
>> [   83.064675] ath9k: ath9k_iowrite32 ffffff800a400024
>> [   83.069486] ath9k: ath9k_ioread32 ffffff800a400024
>> [   83.074257] ath9k_hw_kill_interrupts	 793
>> [   83.078260] ath9k: ath9k_iowrite32 ffffff800a400024
>> [   83.083107] ath9k: ath9k_ioread32 ffffff800a400024
>> [   83.087882] ath9k_hw_kill_interrupts	 793
>> [   83.095450] ath9k_hw_enable_interrupts	 821
>> [   83.099557] ath9k_hw_enable_interrupts	 825
>> [   83.103721] ath9k_hw_enable_interrupts	 832
>> [   83.107887] ath9k: ath9k_iowrite32 ffffff800a400024
>> [   83.112748] AR_SREV_9100 0
>> [   83.115438] ath9k_hw_enable_interrupts	 848
>> [   83.119607] ath9k: ath9k_ioread32 ffffff800a400024
>> [   83.124389] ath9k_hw_intrpend	 762
>> [   83.127761] (AR_SREV_9340(ah) val 0
>> [   83.131234] ath9k_hw_intrpend	 767
>> [   83.134628] ath_isr	 603
>> [   83.137134] ath9k: ath9k_iowrite32 ffffff800a400024
>> [   83.141995] ath9k: ath9k_ioread32 ffffff800a400024
>> [   83.146771] ath9k_hw_kill_interrupts	 793
>> [   83.150864] ath9k_hw_enable_interrupts	 821
>> [   83.154971] ath9k_hw_enable_interrupts	 825
>> [   83.159135] ath9k_hw_enable_interrupts	 832
>> [   83.163300] ath9k: ath9k_iowrite32 ffffff800a400024
>> [   83.168161] AR_SREV_9100 0
>> [   83.170852] ath9k_hw_enable_interrupts	 848
>> [   83.170855] ath9k_hw_intrpend	 762
>> [   83.178398] (AR_SREV_9340(ah) val 0
>> [   83.181873] ath9k_hw_intrpend	 767
>> [   83.185265] ath_isr	 603
>> [   83.187773] ath9k: ath9k_iowrite32 ffffff800a400024
>> [   83.192635] ath9k: ath9k_ioread32 ffffff800a400024
>> [   83.197411] ath9k_hw_kill_interrupts	 793
>> [   83.201414] ath9k: ath9k_ioread32 ffffff800a400024
>> [   83.206258] ath9k_hw_enable_interrupts	 821
>> [   83.210368] ath9k_hw_enable_interrupts	 825
>> [   83.214531] ath9k_hw_enable_interrupts	 832
>> [   83.218698] ath9k: ath9k_iowrite32 ffffff800a400024
>> [   83.223558] AR_SREV_9100 0
>> [   83.226243] ath9k_hw_enable_interrupts	 848
>> [   83.226246] ath9k_hw_intrpend	 762
>> [   83.233794] (AR_SREV_9340(ah) val 0
>> [   83.237268] ath9k_hw_intrpend	 767
>> [   83.240661] ath_isr	 603
>> [   83.243169] ath9k: ath9k_iowrite32 ffffff800a400024
>> [   83.248030] ath9k: ath9k_ioread32 ffffff800a400024
>> [   83.252806] ath9k_hw_kill_interrupts	 793
>> [   83.256811] ath9k: ath9k_ioread32 ffffff800a400024
>> [   83.261651] ath9k_hw_enable_interrupts	 821
>> [   83.265753] ath9k_hw_enable_interrupts	 825
>> [   83.269919] ath9k_hw_enable_interrupts	 832
>> [   83.274083] ath9k: ath9k_iowrite32 ffffff800a400024
>> [   83.278945] AR_SREV_9100 0
>> [   83.281630] ath9k_hw_enable_interrupts	 848
>> [   83.281633] ath9k_hw_intrpend	 762
>> [   83.281634] (AR_SREV_9340(ah) val 0
>> [   83.281637] ath9k_hw_intrpend	 767
>> [   83.281648] ath_isr	 603
>> [   83.281649] ath9k: ath9k_iowrite32 ffffff800a400024
>> [   83.281651] ath9k: ath9k_ioread32 ffffff800a400024
>> [   83.281654] ath9k_hw_kill_interrupts	 793
>> [   83.312192] ath9k: ath9k_ioread32 ffffff800a400024
>> [   83.317030] ath9k_hw_enable_interrupts	 821
>> [   83.321132] ath9k_hw_enable_interrupts	 825
>> [   83.325297] ath9k_hw_enable_interrupts	 832
>> [   83.329463] ath9k: ath9k_iowrite32 ffffff800a400024
>> [   83.334324] AR_SREV_9100 0
>> [   83.337014] ath9k_hw_enable_interrupts	 848
>> ..
>> ..
>> This log continues until I turn off board without obtaining scanning result.
>>
>> In between I get following cpu stall outputs :
>>    230.457179] INFO: rcu_sched self-detected stall on CPU
>> [  230.457185] 	2-...: (31314 ticks this GP) idle=2d1/140000000000001/0 softirq=1400/1400 fqs=36713
>> [  230.457189] 	 (t=36756 jiffies g=161 c=160 q=16169)
>> [  230.457191] Task dump for CPU 2:
>> [  230.457196] kworker/u8:4    R  running task        0  1342      2 0x00000002
>> [  230.457207] Workqueue: phy0 ieee80211_scan_work
>> [  230.457208] Call trace:
>> [  230.457214] [<ffffff8008089860>] dump_backtrace+0x0/0x198
>> [  230.457219] [<ffffff8008089a0c>] show_stack+0x14/0x20
>> [  230.457224] [<ffffff80080c0930>] sched_show_task+0x98/0xf8
>> [  230.457228] [<ffffff80080c2628>] dump_cpu_task+0x40/0x50
>> [  230.457233] [<ffffff80080e14a8>] rcu_dump_cpu_stacks+0xa0/0xf0
>> [  230.457239] [<ffffff80080e4cd8>] rcu_check_callbacks+0x468/0x748
>> [  230.457243] [<ffffff80080e7cfc>] update_process_times+0x3c/0x68
>> [  230.457249] [<ffffff80080f6dfc>] tick_sched_handle.isra.5+0x3c/0x50
>> [  230.457253] [<ffffff80080f6e54>] tick_sched_timer+0x44/0x90
>> [  230.457257] [<ffffff80080e86b0>] __hrtimer_run_queues+0xf0/0x178
>> ** 10 printk messages dropped ** [  230.457302] f8c0: 0000000000000000 0000000005f5e0ff 000000000001379a 3866666666666620
>> [  230.457306] f8e0: ffffff800a1b4065 0000000000000006 ffffff800a129000 ffffffc87b8010a8
>> [  230.457310] f900: ffffff808a1b4057 ffffff800a1c3000 ffffff800a1b3000 ffffff800a13b000
>> [  230.457314] f920: 0000000000000140 0000000000000006 ffffff800a1b3b10 ffffff800a1c39e8
>> [  230.457318] f940: 000000000000002f ffffff800a1b8a98 ffffff800a1b3ae8 ffffffc87b07f990
>> [  230.457322] f960: ffffff80080d6230 ffffffc87b07f990 ffffff80080d6234 0000000060000145
>> ** 1 printk messages dropped ** [  230.457329] [<ffffff8008085720>] el1_irq+0xa0/0x100
>> ** 9 printk messages dropped ** [  230.457373] [<ffffff800885ad60>] ieee80211_hw_config+0x50/0x290
>> [  230.457377] [<ffffff8008863690>] ieee80211_scan_work+0x1f8/0x480
>> [  230.457383] [<ffffff80080b15d0>] process_one_work+0x120/0x378
>> [  230.457386] [<ffffff80080b1870>] worker_thread+0x48/0x4b0
>> [  230.457391] [<ffffff80080b7108>] kthread+0xd0/0xe8
>> [  230.457395] [<ffffff8008085dd0>] ret_from_fork+0x10/0x40
>> [  230.480389] ath9k_hw_intrpend	 762
>>
>>
>> [  545.487987] ath9k: ath9k_ioread32 ffffff800a400024
>> [  545.526189] INFO: rcu_sched self-detected stall on CPU
>> [  545.526195] 	2-...: (97636 ticks this GP) idle=2d1/140000000000001/0 softirq=1400/1400 fqs=115374
>> [  545.526199] 	 (t=115523 jiffies g=161 c=160 q=51066)
>> [  545.526201] Task dump for CPU 2:
>> [  545.526206] kworker/u8:4    R  running task        0  1342      2 0x00000002
>> ** 3 printk messages dropped ** [  545.526231] [<ffffff8008089a0c>] show_stack+0x14/0x20
>> ** 9 printk messages dropped ** [  545.526280] [<ffffff80086a71e8>] arch_timer_handler_phys+0x30/0x40
>> [  545.526284] [<ffffff80080dbe18>] handle_percpu_devid_irq+0x78/0xa0
>> [  545.526291] [<ffffff80080d760c>] generic_handle_irq+0x24/0x38
>> [  545.526296] [<ffffff80080d7944>] __handle_domain_irq+0x5c/0xb8
>> [  545.526299] [<ffffff80080824bc>] gic_handle_irq+0x64/0xc0
>> [  545.526302] Exception stack(0xffffffc87b07f870 to 0xffffffc87b07f990)
>> [  545.526306] f860:                                   0000000000009732 ffffff800a1eaaa8
>> ** 8 printk messages dropped ** [  545.526341] f980: ffffff800a1c39e8 0000000000000036
>> [  545.526345] [<ffffff8008085720>] el1_irq+0xa0/0x100
>> [  545.526349] [<ffffff80080d6234>] console_unlock+0x384/0x5b0
>> [  545.526353] [<ffffff80080d673c>] vprintk_emit+0x2dc/0x4b0
>> [  545.526357] [<ffffff80080d6a50>] vprintk_default+0x38/0x40
>> [  545.526362] [<ffffff8008129704>] printk+0x58/0x60
>> [  545.526366] [<ffffff800859e3e4>] ath9k_iowrite32+0x9c/0xa8
>> [  545.526372] [<ffffff80085c7ca8>] ath9k_hw_kill_interrupts+0x28/0xf0
>> [  545.526376] [<ffffff80085a18ec>] ath_reset+0x24/0x68
>> ** 2 printk messages dropped ** [  545.526391] [<ffffff800885ad60>] ieee80211_hw_config+0x50/0x290
>> ** 11 printk messages dropped ** [  545.532834] ath9k_hw_kill_interrupts	 793
>> [  545.532890] ath9k_hw_enable_interrupts	 821

[   81.876902] INFO: rcu_preempt detected stalls on CPUs/tasks:
[   81.876912]     Tasks blocked on level-0 rcu_node (CPUs 0-7): P0
[   81.876932]     (detected by 4, t=60002 jiffies, g=1873, c=1872, q=4967)
[   81.876936] swapper/4       R  running task        0     0      1 
0x00000000
[   81.876941]  0000000000000001 ffffffff810725f6 ffff88017edbc240 
ffffffff81a3dc40
[   81.876945]  ffffffff81101e46 ffff88025ef173c0 ffffffff81a3dc40 
ffffffff81a3dc40
[   81.876948]  00000000ffffffff ffffffff810a7333 ffff88017ecee698 
ffff88017edbc240
[   81.876951] Call Trace:
[   81.876970]  <IRQ>
[   81.876979]  [<ffffffff810725f6>] ? sched_show_task+0xd6/0x140
[   81.876983]  [<ffffffff81101e46>] ? 
rcu_print_detail_task_stall_rnp+0x40/0x61
[   81.876989]  [<ffffffff810a7333>] ? rcu_check_callbacks+0x6b3/0x8c0
[   81.876993]  [<ffffffff810b8350>] ? tick_sched_handle.isra.14+0x40/0x40
[   81.876996]  [<ffffffff810aa4c3>] ? update_process_times+0x23/0x50
[   81.876999]  [<ffffffff810b8383>] ? tick_sched_timer+0x33/0x60
[   81.877002]  [<ffffffff810aaf09>] ? __hrtimer_run_queues+0xb9/0x150
[   81.877004]  [<ffffffff810ab198>] ? hrtimer_interrupt+0x98/0x1a0
[   81.877008]  [<ffffffff81031b1e>] ? 
smp_trace_apic_timer_interrupt+0x5e/0x90
[   81.877012]  [<ffffffff815b31bf>] ? apic_timer_interrupt+0x7f/0x90
[   81.877013]  <EOI>
[   81.877017]  [<ffffffff8147f28d>] ? cpuidle_enter_state+0x13d/0x1f0
[   81.877019]  [<ffffffff8147f289>] ? cpuidle_enter_state+0x139/0x1f0
[   81.877021]  [<ffffffff81088c19>] ? cpu_startup_entry+0x139/0x210
[   81.877027]  [<ffffffff8102fc9e>] ? start_secondary+0x13e/0x170
[   81.877029] swapper/4       R  running task        0     0      1 
0x00000000
[   81.877032]  0000000000000001 ffffffff810725f6 ffff88017edbc240 
ffffffff81a3dc40
[   81.877035]  ffffffff81101e46 ffff88025ef173c0 ffffffff81a3dc40 
ffffffff81a3dc40
[   81.877038]  00000000ffffffff ffffffff810a7368 ffff88017ecee698 
ffff88017edbc240
[   81.877041] Call Trace:
[   81.877045]  <IRQ>
[   81.877049]  [<ffffffff810725f6>] ? sched_show_task+0xd6/0x140
[   81.877051]  [<ffffffff81101e46>] ? 
rcu_print_detail_task_stall_rnp+0x40/0x61
[   81.877055]  [<ffffffff810a7368>] ? rcu_check_callbacks+0x6e8/0x8c0
[   81.877058]  [<ffffffff810b8350>] ? tick_sched_handle.isra.14+0x40/0x40
[   81.877060]  [<ffffffff810aa4c3>] ? update_process_times+0x23/0x50
[   81.877063]  [<ffffffff810b8383>] ? tick_sched_timer+0x33/0x60
[   81.877065]  [<ffffffff810aaf09>] ? __hrtimer_run_queues+0xb9/0x150
[   81.877068]  [<ffffffff810ab198>] ? hrtimer_interrupt+0x98/0x1a0
[   81.877070]  [<ffffffff81031b1e>] ? 
smp_trace_apic_timer_interrupt+0x5e/0x90
[   81.877073]  [<ffffffff815b31bf>] ? apic_timer_interrupt+0x7f/0x90
[   81.877074]  <EOI>
[   81.877076]  [<ffffffff8147f28d>] ? cpuidle_enter_state+0x13d/0x1f0
[   81.877078]  [<ffffffff8147f289>] ? cpuidle_enter_state+0x139/0x1f0
[   81.877080]  [<ffffffff81088c19>] ? cpu_startup_entry+0x139/0x210
[   81.877084]  [<ffffffff8102fc9e>] ? start_secondary+0x13e/0x170
[   91.132787] INFO: rcu_preempt detected expedited stalls on 
CPUs/tasks: { P0 } 63785 jiffies s: 505 root: 0x0/T
[   91.132796] blocking rcu_node structures:

>>
>>
>> But if we have less debug prints it does not reach EP handler sometimes, due to following
>> Condition in "kernel/irq/chip.c" in function handle_simple_irq
>>
>> if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) {
>>                  desc->istate |= IRQS_PENDING;
>>                  goto out_unlock;
>>          }
>> Here irqd_irq_disabled is being set to 1.
>>
>> With lesser debug prints it stops after following prints:
>> root@Xilinx-ZCU102-2016_3:~# iw dev wlan0 scan
>> [   54.781045] ath9k_hw_kill_interrupts	 793
>> [   54.785007] ath9k_hw_kill_interrupts	 793
>> [   54.792535] ath9k_hw_enable_interrupts	 821
>> [   54.796642] ath9k_hw_enable_interrupts	 825
>> [   54.800807] ath9k_hw_enable_interrupts	 832
>> [   54.804973] AR_SREV_9100 0
>> [   54.807663] ath9k_hw_enable_interrupts	 848
>> [   54.811843] ath9k_hw_intrpend	 762
>> [   54.815211] (AR_SREV_9340(ah) val 0
>> [   54.818684] ath9k_hw_intrpend	 767
>> [   54.822078] ath_isr	 603
>> [   54.824587] ath9k_hw_kill_interrupts	 793
>> [   54.828601] ath9k_hw_enable_interrupts	 821
>> [   54.832750] ath9k_hw_enable_interrupts	 825
>> [   54.836916] ath9k_hw_enable_interrupts	 832
>> [   54.841082] AR_SREV_9100 0
>> [   54.843772] ath9k_hw_enable_interrupts	 848
>> [   54.843775] ath9k_hw_intrpend	 762
>> [   54.851319] (AR_SREV_9340(ah) val 0
>> [   54.854793] ath9k_hw_intrpend	 767
>> [   54.858185] ath_isr	 603
>> [   54.860696] ath9k_hw_kill_interrupts	 793
>> [   54.864776] ath9k_hw_enable_interrupts	 821
>> [   54.867061] ath9k_hw_kill_interrupts	 793
>> [   54.872870] ath9k_hw_enable_interrupts	 825
>> [   54.877036] ath9k_hw_enable_interrupts	 832
>> [   54.881202] AR_SREV_9100 0
>> [   54.883892] ath9k_hw_enable_interrupts	 848
>> [   75.963129] INFO: rcu_sched detected stalls on CPUs/tasks:
>> [   75.968602] 	0-...: (2 GPs behind) idle=9d5/140000000000001/0 softirq=1103/1109 fqs=519
>> [   75.976675] 	(detected by 2, t=5274 jiffies, g=64, c=63, q=11)
>> [   75.982485] Task dump for CPU 0:
>> [   75.985696] ksoftirqd/0     R  running task        0     3      2 0x00000002
>> [   75.992726] Call trace:
>> [   75.995165] [<ffffff8008086b3c>] __switch_to+0xc4/0xd0
>> [   76.000281] [<ffffffc87b830500>] 0xffffffc87b830500
>> [  139.059027] INFO: rcu_sched detected stalls on CPUs/tasks:
>> [  139.064430] 	0-...: (2 GPs behind) idle=9d5/140000000000001/0 softirq=1103/1109 fqs=2097
>> [  139.072593] 	(detected by 2, t=21049 jiffies, g=64, c=63, q=11)
>> [  139.078489] Task dump for CPU 0:
>> [  139.081700] ksoftirqd/0     R  running task        0     3      2 0x00000002
>> [  139.088731] Call trace:
>> [  139.091165] [<ffffff8008086b3c>] __switch_to+0xc4/0xd0
>> [  139.096285] [<ffffffc87b830500>] 0xffffffc87b830500
>>
>>
>>>> We are not seeing any issues on 32-bit ARM platform and X86
>>>> platform.
>>> Can you collect a dmesg log (or, if the system hang means you can't
>>> collect that, a console log with "ignore_loglevel"), and "lspci -vv"
>>> output as root?  That should have clues about whether the INTx got
>>> routed correctly.  /proc/interrupts should also show whether we're
>>> receiving interrupts from the device.
>> Here is the lspci output:
>> 00:00.0 PCI bridge: Xilinx Corporation Device d022 (prog-if 00 [Normal decode])
>> 	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
>> 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>> 	Latency: 0
>> 	Interrupt: pin A routed to IRQ 224
>> 	Bus: primary=00, secondary=01, subordinate=0c, sec-latency=0
>> 	I/O behind bridge: 00000000-00000fff
>> 	Memory behind bridge: e0000000-e00fffff
>> 	Prefetchable memory behind bridge: 00000000fff00000-00000000000fffff
>> 	Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
>> 	BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
>> 		PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
>> 	Capabilities: [40] Power Management version 3
>> 		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-)
>> 		Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
>> 	Capabilities: [60] Express (v2) Root Port (Slot-), MSI 00
>> 		DevCap:	MaxPayload 256 bytes, PhantFunc 0
>> 			ExtTag- RBE+
>> 		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
>> 			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
>> 			MaxPayload 128 bytes, MaxReadReq 512 bytes
>> 		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend+
>> 		LnkCap:	Port #0, Speed 5GT/s, Width x2, ASPM not supported, Exit Latency L0s unlimited, L1 unlimited
>> 			ClockPM- Surprise- LLActRep- BwNot+ ASPMOptComp+
>> 		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk-
>> 			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>> 		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
>> 		RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible+
>> 		RootCap: CRSVisible+
>> 		RootSta: PME ReqID 0000, PMEStatus- PMEPending-
>> 		DevCap2: Completion Timeout: Range B, TimeoutDis+, LTR-, OBFF Not Supported ARIFwd-
>> 		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled ARIFwd-
>> 		LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
>> 			 Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
>> 			 Compliance De-emphasis: -6dB
>> 		LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete-, EqualizationPhase1-
>> 			 EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
>> 	Capabilities: [100 v1] Device Serial Number 00-00-00-00-00-00-00-00
>> 	Capabilities: [10c v1] Virtual Channel
>> 		Caps:	LPEVC=0 RefClk=100ns PATEntryBits=1
>> 		Arb:	Fixed- WRR32- WRR64- WRR128-
>> 		Ctrl:	ArbSelect=Fixed
>> 		Status:	InProgress-
>> 		VC0:	Caps:	PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>> 			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>> 			Ctrl:	Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
>> 			Status:	NegoPending- InProgress-
>> 	Capabilities: [128 v1] Vendor Specific Information: ID=1234 Rev=1 Len=018 <?>
>>
>> 01:00.0 Network controller: Qualcomm Atheros AR93xx Wireless Network Adapter (rev 01)
>> 	Subsystem: Qualcomm Atheros Device 3112
>> 	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
>> 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>> 	Latency: 0, Cache Line Size: 128 bytes
>> 	Interrupt: pin A routed to IRQ 224
>> 	Region 0: Memory at e0000000 (64-bit, non-prefetchable) [size=128K]
>> 	[virtual] Expansion ROM at e0020000 [disabled] [size=64K]
>> 	Capabilities: [40] Power Management version 3
>> 		Flags: PMEClk- DSI- D1+ D2- AuxCurrent=375mA PME(D0+,D1+,D2-,D3hot+,D3cold-)
>> 		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
>> 	Capabilities: [50] MSI: Enable- Count=1/4 Maskable+ 64bit+
>> 		Address: 0000000000000000  Data: 0000
>> 		Masking: 00000000  Pending: 00000000
>> 	Capabilities: [70] Express (v2) Endpoint, MSI 00
>> 		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency L0s <1us, L1 <8us
>> 			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 0.000W
>> 		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
>> 			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
>> 			MaxPayload 128 bytes, MaxReadReq 512 bytes
>> 		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
>> 		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <2us, L1 <64us
>> 			ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
>> 		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk-
>> 			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
>> 		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
>> 		DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR-, OBFF Not Supported
>> 		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
>> 		LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
>> 			 Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
>> 			 Compliance De-emphasis: -6dB
>> 		LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete-, EqualizationPhase1-
>> 			 EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
>> 	Capabilities: [100 v1] Advanced Error Reporting
>> 		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>> 		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
>> 		UESvrt:	DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
>> 		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
>> 		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
>> 		AERCap:	First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-
>> 	Capabilities: [140 v1] Virtual Channel
>> 		Caps:	LPEVC=0 RefClk=100ns PATEntryBits=1
>> 		Arb:	Fixed- WRR32- WRR64- WRR128-
>> 		Ctrl:	ArbSelect=Fixed
>> 		Status:	InProgress-
>> 		VC0:	Caps:	PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
>> 			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
>> 			Ctrl:	Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
>> 			Status:	NegoPending- InProgress-
>> 	Capabilities: [300 v1] Device Serial Number 00-00-00-00-00-00-00-00
>> 	Kernel driver in use: ath9k
>>
>> Here is the cat /proc/interrupts (after we do interface up):
>>
>> root@:~# ifconfig wlan0 up
>> [ 1548.926601] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
>> root@Xilinx-ZCU102-2016_3:~# cat /proc/interrupts
>>             CPU0       CPU1       CPU2       CPU3
>>    1:          0          0          0          0     GICv2  29 Edge      arch_timer
>>    2:      19873      20058      19089      17435     GICv2  30 Edge      arch_timer
>>   12:          0          0          0          0     GICv2 156 Level     zynqmp-dma
>>   13:          0          0          0          0     GICv2 157 Level     zynqmp-dma
>>   14:          0          0          0          0     GICv2 158 Level     zynqmp-dma
>>   15:          0          0          0          0     GICv2 159 Level     zynqmp-dma
>>   16:          0          0          0          0     GICv2 160 Level     zynqmp-dma
>>   17:          0          0          0          0     GICv2 161 Level     zynqmp-dma
>>   18:          0          0          0          0     GICv2 162 Level     zynqmp-dma
>>   19:          0          0          0          0     GICv2 163 Level     zynqmp-dma
>>   20:          0          0          0          0     GICv2 164 Level     Mali_GP_MMU, Mali_GP, Mali_PP0_MMU, Mali_PP0, Mali_PP1_MMU, Mali_PP1
>>   30:          0          0          0          0     GICv2  95 Level     eth0, eth0
>> 206:        314          0          0          0     GICv2  49 Level     cdns-i2c
>> 207:         40          0          0          0     GICv2  50 Level     cdns-i2c
>> 209:          0          0          0          0     GICv2 150 Level     nwl_pcie:misc
>> 214:         12          0          0          0     GICv2  47 Level     ff0f0000.spi
>> 215:          0          0          0          0     GICv2  58 Level     ffa60000.rtc
>> 216:          0          0          0          0     GICv2  59 Level     ffa60000.rtc
>> 217:          0          0          0          0     GICv2 165 Level     ahci-ceva[fd0c0000.ahci]
>> 218:         61          0          0          0     GICv2  81 Level     mmc0
>> 219:          0          0          0          0     GICv2 187 Level     arm-smmu global fault
>> 220:        471          0          0          0     GICv2  53 Level     xuartps
>> 223:          0          0          0          0     GICv2 154 Level     fd4c0000.dma
>> 224:          3          0          0          0     dummy   1 Edge      ath9k
>> 225:          0          0          0          0     GICv2  97 Level     xhci-hcd:usb1
>>
>> Regards,
>> Bharat

^ permalink raw reply

* pull-request: mac80211-next 2016-12-09
From: Johannes Berg @ 2016-12-09 12:00 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-wireless

Hi Dave,

Closing net-next caught me by surprise, so I had to rebase a bit,
but these three patches really should go in soon. I'm not sending
them for 4.9 this late though.

Please pull and let me know if there's any problem.

Thanks,
johannes



The following changes since commit f81a8a02bb3b3e882ba6aa580230c13b5be64849:

  Merge branch 'mV88e6xxx-interrupt-fixes' (2016-11-20 21:16:14 -0500)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git tags/mac80211-next-for-davem-2016-12-09

for you to fetch changes up to e6f462df9acd2a3295e5d34eb29e2823220cf129:

  cfg80211/mac80211: fix BSS leaks when abandoning assoc attempts (2016-12-09 12:57:49 +0100)

----------------------------------------------------------------
Three fixes:
 * fix a logic bug introduced by a previous cleanup
 * fix nl80211 attribute confusing (trying to use
   a single attribute for two purposes)
 * fix a long-standing BSS leak that happens when an
   association attempt is abandoned

----------------------------------------------------------------
Johannes Berg (2):
      nl80211: fix logic inversion in start_nan()
      cfg80211/mac80211: fix BSS leaks when abandoning assoc attempts

Vamsi Krishna (1):
      nl80211: Use different attrs for BSSID and random MAC addr in scan req

 include/net/cfg80211.h       | 11 +++++++++++
 include/uapi/linux/nl80211.h |  7 ++++++-
 net/mac80211/mlme.c          | 21 ++++++++++++---------
 net/wireless/core.h          |  1 +
 net/wireless/mlme.c          | 12 ++++++++++++
 net/wireless/nl80211.c       | 18 ++++++++++++++++--
 net/wireless/sme.c           | 14 ++++++++++++++
 7 files changed, 72 insertions(+), 12 deletions(-)

^ permalink raw reply

* [PATCH for-4.10 2/2] brcmfmac: fix uninitialized field in scheduled scan ssid configuration
From: Arend van Spriel @ 2016-12-09 11:34 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, Arend van Spriel
In-Reply-To: <1481283254-17883-1-git-send-email-arend.vanspriel@broadcom.com>

The scheduled scan ssid configuration in firmware has a flags field that
was not initialized resulting in unexpected behaviour.

Fixes: e3bdb7cc0300 ("brcmfmac: fix handling ssids in .sched_scan_start() callback")
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
index f273cab..9a25e79 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
@@ -137,6 +137,7 @@ static int brcmf_pno_add_ssid(struct brcmf_if *ifp, struct cfg80211_ssid *ssid,
 	pfn.wpa_auth = cpu_to_le32(BRCMF_PNO_WPA_AUTH_ANY);
 	pfn.wsec = cpu_to_le32(0);
 	pfn.infra = cpu_to_le32(1);
+	pfn.flags = 0;
 	if (active)
 		pfn.flags = cpu_to_le32(1 << BRCMF_PNO_HIDDEN_BIT);
 	pfn.ssid.SSID_len = cpu_to_le32(ssid->ssid_len);
--
1.9.1

^ permalink raw reply related

* [PATCH for-4.10 1/2] brcmfmac: fix memory leak in brcmf_cfg80211_attach()
From: Arend van Spriel @ 2016-12-09 11:34 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, Arend van Spriel
In-Reply-To: <1481283254-17883-1-git-send-email-arend.vanspriel@broadcom.com>

In brcmf_cfg80211_attach() there was one error path not properly
handled as it leaked memory allocated in brcmf_btcoex_attach().

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index ccae3bb..7ffc4ab 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -6868,7 +6868,7 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,

 	err = brcmf_p2p_attach(cfg, p2pdev_forced);
 	if (err) {
-		brcmf_err("P2P initilisation failed (%d)\n", err);
+		brcmf_err("P2P initialisation failed (%d)\n", err);
 		goto wiphy_unreg_out;
 	}
 	err = brcmf_btcoex_attach(cfg);
@@ -6893,7 +6893,7 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
 	err = brcmf_fweh_activate_events(ifp);
 	if (err) {
 		brcmf_err("FWEH activation failed (%d)\n", err);
-		goto wiphy_unreg_out;
+		goto detach;
 	}

 	/* Fill in some of the advertised nl80211 supported features */
@@ -6908,6 +6908,9 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,

 	return cfg;

+detach:
+	brcmf_btcoex_detach(cfg);
+	brcmf_p2p_detach(&cfg->p2p);
 wiphy_unreg_out:
 	wiphy_unregister(cfg->wiphy);
 priv_out:
--
1.9.1

^ permalink raw reply related

* [PATCH for-4.10 0/2] brcmfmac: small fixes for after merge window
From: Arend van Spriel @ 2016-12-09 11:34 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, Arend van Spriel

Two issues found during more testing. The first patch fixes a memory leak
in error path. The second one fixes a regression introduced by a change
that currently sits in wireless-drivers-next.

These patches have been applied on top of wireless-drivers-next/master branch
so it can apply on wireless-drivers/master after the merge window (fingers
crossed).

Arend van Spriel (2):
  brcmfmac: fix memory leak in brcmf_cfg80211_attach()
  brcmfmac: fix uninitialized field in scheduled scan ssid configuration

 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 7 +++++--
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c      | 1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

--
1.9.1

^ permalink raw reply

* Re: [PATCH] RFC: Universal scan proposal
From: Arend Van Spriel @ 2016-12-09 11:10 UTC (permalink / raw)
  To: Dmitry Shmidt; +Cc: Johannes Berg, linux-wireless
In-Reply-To: <CAH7ZN-wGseBVzV3Vuq+6=kgaSL7e0UnndGXPdu4PQKZw8H47YQ@mail.gmail.com>

On 8-12-2016 23:35, Dmitry Shmidt wrote:
> On Wed, Dec 7, 2016 at 12:51 PM, Arend Van Spriel
> <arend.vanspriel@broadcom.com> wrote:
>> On 7-12-2016 19:39, Dmitry Shmidt wrote:
>>> On Tue, Dec 6, 2016 at 10:44 PM, Johannes Berg
>>> <johannes@sipsolutions.net> wrote:
>>>>
>>>>> Indeed, results are results. I just want to take care of two things:
>>>>> 1) Memory consumption - we can clear stale scan results for
>>>>> connection, but not for location if we are using history scan.
>>>>
>>>> Well eventually we also have to clear for location if we run out of
>>>> memory, that usually means dumping them out to the host, no?
>>>
>>> Being out of memory and consuming more memory are different
>>> things, but I agree - maybe we don't need to worry about it.

So does location use all information from the scan history or is it
interested in some specific information, eg. rssi.

>>>>> 2) Use of insufficient results for connection - in case we had
>>>>> history or hotlist scan only for very limited amount of channels,
>>>>> then we may not have enough APs in our result for "sterling"
>>>>> connection decision.
>>>>
>>>> I'm not entirely sure about this case - surely noticing "we can do
>>>> better now" is still better than waiting for being able to make the
>>>> perfect decision?
>>>
>>> Maybe we can just keep flag saying that currently available results
>>> were not received by usual full scan.
>>>
>>>>>>> Report: none / batch / immediate
>>>>>>
>>>>>> Not sure I see much point in "none"??
>>>>>>
>>>>>> Can you define these more clearly? Do you think "batch" reporting
>>>>>> should be like the gscan buckets? Or actually have full
>>>>>> information?
>>>>>
>>>>> None - means that there is not need to report. It can be useful
>>>>> in case of roaming scan, scheduling or hotlist scan - you didn't find
>>>>> anything suitable - don't report that there is no scan results.
>>>>
>>>> But that seems more of a filtering thing, combined with "immediate" for
>>>> anything passing the filter?
>>>
>>> We can use this approach as well.
>>>
>>>>>>>    Request may have priority and can be inserted into
>>>>>>> the head of the queue.
>>>>>>>    Types of scans:
>>>>>>> - Normal scan
>>>>>>> - Scheduled scan
>>>>>>> - Hotlist (BSSID scan)
>>>>>>> - Roaming
>>>>>>> - AutoJoin
>>>>>>
>>>>>> I think somebody else said this but I didn't find it now - I think
>>>>>> this would make more sense to define in terms of expected behaviour
>>>>>> than use cases for each type of scan.
>>>>>
>>>>> I think Luca made this statement.
>>>>
>>>> Yeah - I just couldn't find it again on re-reading the thread :)
>>>>
>>>>> It is totally ok from SW point of
>>>>> view - especially due to the fact that scan is scan. However,
>>>>> I suspect it will be harder to handle from user experience. I mean
>>>>> at the end wireless framework / driver / FW will convert special
>>>>> scan type to usual scan with special params and response, but why
>>>>> to put this burden on user?
>>
>> I don't think this will put burden on the user although it depends
>> who/what you mean by this. If you mean the mere mortal end-user I would
>> say no as indeed there must be some software entity (in user-space) that
>> will have to initiate a nl80211 command with appropriate attributes
>> according to whatever user-space is trying to accomplish.
>>
>>>> I just think it's more flexible and open-ended. The actual definition
>>>> of the resulting parameters needs to be somewhere anyway - putting it
>>>> into driver/firmware (vs. wifi framework or so) seems to duplicate it
>>>> and certainly makes it harder to modify/extend in the future, no?
>>>
>>> So, let's summarize:
>>> Instead of creating new type of generic scan with special types,
>>> we want to go with additional expansion of scheduled scan options and
>>> parameters (in order not to "multiply entities"), including ability to send
>>> new scheduled scan request without stopping previous one.
>>>
>>> Is it Ok?
>>
>> Sounds ok. To me a generic scan command with type attribute is
>> equivalent to having seperate commands for each type so there seems to
>> be no gain. Now whether this all can be accomplished by extending the
>> scheduled scan depends on the problem that you are trying to solve.
>>
>> Main purpose seems to be offloading different scanning tasks which could
>> make scheduled scan a good candidate. Now I want to add gscan to this
>> mix as it seems some concepts for that are in play in this discussion as
>> well, eg. hotlist. gscan is like scheduled scan, but it supports
>> multiple schedules. However, it is still a single request from a single
>> user-space process. I think Luca mentioned supporting requests from
>> different user-space processes. Is that also what you mean by "ability
>> to send new scheduled scan request without stopping previous one" or is
>> that still from a single user-space process. Do we need a limit to the
>> amount of scheduled scan requests that can be handled simultaneously.
> 
> Supporting requests (or more precisely requests and results) differentiated
> by user-space entity can be tricky. Right now we are not checking current
> caller pid, right? Maybe it is also good idea - or maybe we can just
> make result filtering per user-space caller?

There is already struct cfg80211_sched_scan_request::owner_nlportid

 * @owner_nlportid: netlink portid of owner (if this should is a request
 *	owned by a particular socket)

It is set in nl80211_start_sched_scan():

	if (info->attrs[NL80211_ATTR_SOCKET_OWNER])
		sched_scan_req->owner_nlportid = info->snd_portid;

It basically links the life-time of the request to the socket connection
if requested to do so. It is just not very useful with tools like iw.

>> A maybe more important aspect of gscan is user-space control of result
>> reporting and thus the frequency of waking up host and/or user-space. I
>> suspect this would be needed in the scheduled scan extension as well, right?
> 
> It will be always up to user-space caller to make system more or less
> power-efficient, right?

That depends on the API, right? If the API provides the knobs, than
user-space can indeed make the decision.

Regards,
Arend

>> Regards,
>> Arend

^ permalink raw reply

* Re: [PATCH 10/14] rtlwifi: Add BTC_TRACE_STRING to new btcoex
From: Kalle Valo @ 2016-12-09  8:50 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: devel, Ping-Ke Shih, linux-wireless, Larry Finger
In-Reply-To: <20161208115450.GK8244@mwanda>

Dan Carpenter <dan.carpenter@oracle.com> writes:

> On Thu, Dec 08, 2016 at 02:50:49PM +0300, Dan Carpenter wrote:
>> On Thu, Dec 08, 2016 at 01:43:42PM +0200, Kalle Valo wrote:
>> > But it would make me very happy if someone would add a similar grouping
>> > functionality to dyndbg to make it easy to enable a set of debug
>> > messages in a driver.
>> 
>> Thats seems like a reasonable thing as well.
>
> I actually like the ath code...  We could easily change it to be more
> generic and make it a top level function for everyone to use.

That would be great. And maybe add a sysfs file with a description
different levels, like module parameters have. Too bad that I can't work
on that, too much stuff on my plate right now.

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH 10/14] rtlwifi: Add BTC_TRACE_STRING to new btcoex
From: Kalle Valo @ 2016-12-09  8:48 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: devel, Ping-Ke Shih, linux-wireless, Larry Finger
In-Reply-To: <20161208115049.GR8176@mwanda>

Dan Carpenter <dan.carpenter@oracle.com> writes:

> I don't have a problem with the ath debug printks.  Larry asked me for
> examples of better debug functions and the ath code is an example.
> Literally, any existing debug functions are better than the
> BTC_TRACE_STRING() stuff.

Sure, I agree with that. My point was just that sometimes it's ok to
have own logging wrappers and there's no hard rule for this.

-- 
Kalle Valo

^ permalink raw reply

* RE: ATH9 driver issues on ARM64
From: Bharat Kumar Gogada @ 2016-12-09  6:55 UTC (permalink / raw)
  To: Bharat Kumar Gogada, Kalle Valo
  Cc: Bjorn Helgaas, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, Marc Zyngier,
	Janusz.Dziedzic@tieto.com, ath9k-devel@qca.qualcomm.com,
	linux-wireless@vger.kernel.org, rmanohar@qca.qualcomm.com
In-Reply-To: <8520D5D51A55D047800579B094147198263A7A64@XAP-PVEXMBX02.xlnx.xilinx.com>

Sorry, Forgot to add kernel version, we are using 4.6 kernel.=20

> Hi,
> Can any one tell, when exactly the chip sends ASSERT & DEASSERT in driver=
.
> It might help us to debug issue further.
>=20
> Thanks & Regards,
> Bharat
>=20
> > >  > [+cc Kalle, ath9k list]
> >
> > Thanks, but please also CC linux-wireless. Full thread below for the fo=
lks there.
> >
> > >> On Thu, Dec 08, 2016 at 01:49:42PM +0000, Bharat Kumar Gogada wrote:
> > >> > Hi,
> > >> >
> > >> > Did anyone test Atheros ATH9
> > >> > driver(drivers/net/wireless/ath/ath9k/)
> > >> > on ARM64.  The end point is TP link wifi card with which supports
> > >> > only legacy interrupts.
> > >>
> > >> If it works on other arches and the arm64 PCI enumeration works, my
> > >> first guess would be an INTx issue, e.g., maybe the driver is
> > >> waiting for an interrupt that never arrives.
> > > We are not sure for now.
> > >>
> > >> > We are trying to test it on ARM64 with
> > >> > (drivers/pci/host/pcie-xilinx-nwl.c) as root port.
> > >> >
> > >> > EP is getting enumerated and able to link up.
> > >> >
> > >> > But when we start scan system gets hanged.
> > >>
> > >> When you say the system hangs when you start a scan, I assume you
> > >> mean a wifi scan, not the PCI enumeration.  A problem with a wifi
> > >> scan might cause a *process* to hang, but it shouldn't hang the
> > >> entire system.
> > >>
> > > Yes wifi scan.
> > >> > When we took trace we see that after we start scan assert message
> > >> > is sent but there is no de assert from end point.
> > >>
> > >> Are you talking about a trace from a PCIe analyzer?  Do you see an
> > >> Assert_INTx PCIe message on the link?
> > >>
> > > Yes lecroy trace, yes we do see Assert_INTx and Deassert_INTx
> > > happening
> > when we do interface link up.
> > > When we have less debug prints in Atheros driver, and do wifi scan
> > > we see Assert_INTx but never Deassert_INTx,
> > >> > What might cause end point not sending de assert ?
> > >>
> > >> If the endpoint doesn't send a Deassert_INTx message, I expect that
> > >> would mean the driver didn't service the interrupt and remove the
> > >> condition that caused the device to assert the interrupt in the
> > >> first place.
> > >>
> > >> If the driver didn't receive the interrupt, it couldn't service it,
> > >> of course.  You could add a printk in the ath9k interrupt service
> > >> routine to see if you ever get there.
> > >>
> > > The interrupt behavior is changing w.r.t amount of debug prints we
> > > add. (I kept many prints to aid debug) root@Xilinx-ZCU102-2016_3:~#
> > > iw dev
> > wlan0 scan
> > > [   83.064675] ath9k: ath9k_iowrite32 ffffff800a400024
> > > [   83.069486] ath9k: ath9k_ioread32 ffffff800a400024
> > > [   83.074257] ath9k_hw_kill_interrupts	 793
> > > [   83.078260] ath9k: ath9k_iowrite32 ffffff800a400024
> > > [   83.083107] ath9k: ath9k_ioread32 ffffff800a400024
> > > [   83.087882] ath9k_hw_kill_interrupts	 793
> > > [   83.095450] ath9k_hw_enable_interrupts	 821
> > > [   83.099557] ath9k_hw_enable_interrupts	 825
> > > [   83.103721] ath9k_hw_enable_interrupts	 832
> > > [   83.107887] ath9k: ath9k_iowrite32 ffffff800a400024
> > > [   83.112748] AR_SREV_9100 0
> > > [   83.115438] ath9k_hw_enable_interrupts	 848
> > > [   83.119607] ath9k: ath9k_ioread32 ffffff800a400024
> > > [   83.124389] ath9k_hw_intrpend	 762
> > > [   83.127761] (AR_SREV_9340(ah) val 0
> > > [   83.131234] ath9k_hw_intrpend	 767
> > > [   83.134628] ath_isr	 603
> > > [   83.137134] ath9k: ath9k_iowrite32 ffffff800a400024
> > > [   83.141995] ath9k: ath9k_ioread32 ffffff800a400024
> > > [   83.146771] ath9k_hw_kill_interrupts	 793
> > > [   83.150864] ath9k_hw_enable_interrupts	 821
> > > [   83.154971] ath9k_hw_enable_interrupts	 825
> > > [   83.159135] ath9k_hw_enable_interrupts	 832
> > > [   83.163300] ath9k: ath9k_iowrite32 ffffff800a400024
> > > [   83.168161] AR_SREV_9100 0
> > > [   83.170852] ath9k_hw_enable_interrupts	 848
> > > [   83.170855] ath9k_hw_intrpend	 762
> > > [   83.178398] (AR_SREV_9340(ah) val 0
> > > [   83.181873] ath9k_hw_intrpend	 767
> > > [   83.185265] ath_isr	 603
> > > [   83.187773] ath9k: ath9k_iowrite32 ffffff800a400024
> > > [   83.192635] ath9k: ath9k_ioread32 ffffff800a400024
> > > [   83.197411] ath9k_hw_kill_interrupts	 793
> > > [   83.201414] ath9k: ath9k_ioread32 ffffff800a400024
> > > [   83.206258] ath9k_hw_enable_interrupts	 821
> > > [   83.210368] ath9k_hw_enable_interrupts	 825
> > > [   83.214531] ath9k_hw_enable_interrupts	 832
> > > [   83.218698] ath9k: ath9k_iowrite32 ffffff800a400024
> > > [   83.223558] AR_SREV_9100 0
> > > [   83.226243] ath9k_hw_enable_interrupts	 848
> > > [   83.226246] ath9k_hw_intrpend	 762
> > > [   83.233794] (AR_SREV_9340(ah) val 0
> > > [   83.237268] ath9k_hw_intrpend	 767
> > > [   83.240661] ath_isr	 603
> > > [   83.243169] ath9k: ath9k_iowrite32 ffffff800a400024
> > > [   83.248030] ath9k: ath9k_ioread32 ffffff800a400024
> > > [   83.252806] ath9k_hw_kill_interrupts	 793
> > > [   83.256811] ath9k: ath9k_ioread32 ffffff800a400024
> > > [   83.261651] ath9k_hw_enable_interrupts	 821
> > > [   83.265753] ath9k_hw_enable_interrupts	 825
> > > [   83.269919] ath9k_hw_enable_interrupts	 832
> > > [   83.274083] ath9k: ath9k_iowrite32 ffffff800a400024
> > > [   83.278945] AR_SREV_9100 0
> > > [   83.281630] ath9k_hw_enable_interrupts	 848
> > > [   83.281633] ath9k_hw_intrpend	 762
> > > [   83.281634] (AR_SREV_9340(ah) val 0
> > > [   83.281637] ath9k_hw_intrpend	 767
> > > [   83.281648] ath_isr	 603
> > > [   83.281649] ath9k: ath9k_iowrite32 ffffff800a400024
> > > [   83.281651] ath9k: ath9k_ioread32 ffffff800a400024
> > > [   83.281654] ath9k_hw_kill_interrupts	 793
> > > [   83.312192] ath9k: ath9k_ioread32 ffffff800a400024
> > > [   83.317030] ath9k_hw_enable_interrupts	 821
> > > [   83.321132] ath9k_hw_enable_interrupts	 825
> > > [   83.325297] ath9k_hw_enable_interrupts	 832
> > > [   83.329463] ath9k: ath9k_iowrite32 ffffff800a400024
> > > [   83.334324] AR_SREV_9100 0
> > > [   83.337014] ath9k_hw_enable_interrupts	 848
> > > ..
> > > ..
> > > This log continues until I turn off board without obtaining scanning =
result.
> > >
> > > In between I get following cpu stall outputs :
> > >   230.457179] INFO: rcu_sched self-detected stall on CPU
> > > [  230.457185] 	2-...: (31314 ticks this GP)
> > idle=3D2d1/140000000000001/0 softirq=3D1400/1400 fqs=3D36713
> > > [  230.457189] 	 (t=3D36756 jiffies g=3D161 c=3D160 q=3D16169)
> > > [  230.457191] Task dump for CPU 2:
> > > [  230.457196] kworker/u8:4    R  running task        0  1342      2 =
0x00000002
> > > [  230.457207] Workqueue: phy0 ieee80211_scan_work [  230.457208]
> > > Call
> > > trace:
> > > [  230.457214] [<ffffff8008089860>] dump_backtrace+0x0/0x198 [
> > > 230.457219] [<ffffff8008089a0c>] show_stack+0x14/0x20 [  230.457224]
> > > [<ffffff80080c0930>] sched_show_task+0x98/0xf8 [  230.457228]
> > > [<ffffff80080c2628>] dump_cpu_task+0x40/0x50 [  230.457233]
> > > [<ffffff80080e14a8>] rcu_dump_cpu_stacks+0xa0/0xf0 [  230.457239]
> > > [<ffffff80080e4cd8>] rcu_check_callbacks+0x468/0x748 [  230.457243]
> > > [<ffffff80080e7cfc>] update_process_times+0x3c/0x68 [  230.457249]
> > > [<ffffff80080f6dfc>] tick_sched_handle.isra.5+0x3c/0x50
> > > [  230.457253] [<ffffff80080f6e54>] tick_sched_timer+0x44/0x90 [
> > > 230.457257] [<ffffff80080e86b0>] __hrtimer_run_queues+0xf0/0x178
> > > ** 10 printk messages dropped ** [  230.457302] f8c0:
> > > 0000000000000000 0000000005f5e0ff 000000000001379a
> 3866666666666620
> > > [  230.457306]
> > > f8e0: ffffff800a1b4065 0000000000000006 ffffff800a129000
> > > ffffffc87b8010a8 [  230.457310] f900: ffffff808a1b4057
> > > ffffff800a1c3000 ffffff800a1b3000 ffffff800a13b000 [  230.457314]
> > > f920: 0000000000000140 0000000000000006 ffffff800a1b3b10
> > > ffffff800a1c39e8 [  230.457318] f940: 000000000000002f
> > > ffffff800a1b8a98 ffffff800a1b3ae8 ffffffc87b07f990 [  230.457322]
> > > f960: ffffff80080d6230 ffffffc87b07f990 ffffff80080d6234
> > > 0000000060000145
> > > ** 1 printk messages dropped ** [  230.457329] [<ffffff8008085720>]
> > > el1_irq+0xa0/0x100
> > > ** 9 printk messages dropped ** [  230.457373] [<ffffff800885ad60>]
> > > ieee80211_hw_config+0x50/0x290 [  230.457377] [<ffffff8008863690>]
> > > ieee80211_scan_work+0x1f8/0x480 [  230.457383] [<ffffff80080b15d0>]
> > > process_one_work+0x120/0x378 [  230.457386] [<ffffff80080b1870>]
> > > worker_thread+0x48/0x4b0 [  230.457391] [<ffffff80080b7108>]
> > > kthread+0xd0/0xe8 [  230.457395] [<ffffff8008085dd0>]
> > ret_from_fork+0x10/0x40
> > > [  230.480389] ath9k_hw_intrpend	 762
> > >
> > >
> > > [  545.487987] ath9k: ath9k_ioread32 ffffff800a400024 [  545.526189]
> > > INFO: rcu_sched self-detected stall on CPU
> > > [  545.526195] 	2-...: (97636 ticks this GP)
> > idle=3D2d1/140000000000001/0 softirq=3D1400/1400 fqs=3D115374
> > > [  545.526199] 	 (t=3D115523 jiffies g=3D161 c=3D160 q=3D51066)
> > > [  545.526201] Task dump for CPU 2:
> > > [  545.526206] kworker/u8:4    R  running task        0  1342      2 =
0x00000002
> > > ** 3 printk messages dropped ** [  545.526231] [<ffffff8008089a0c>]
> > > show_stack+0x14/0x20
> > > ** 9 printk messages dropped ** [  545.526280] [<ffffff80086a71e8>]
> > > arch_timer_handler_phys+0x30/0x40 [  545.526284]
> > > [<ffffff80080dbe18>]
> > > handle_percpu_devid_irq+0x78/0xa0 [  545.526291]
> > > [<ffffff80080d760c>]
> > > generic_handle_irq+0x24/0x38 [  545.526296] [<ffffff80080d7944>]
> > > __handle_domain_irq+0x5c/0xb8 [  545.526299] [<ffffff80080824bc>]
> > > gic_handle_irq+0x64/0xc0 [  545.526302] Exception
> > > stack(0xffffffc87b07f870
> > to 0xffffffc87b07f990)
> > > [  545.526306] f860:                                   00000000000097=
32 ffffff800a1eaaa8
> > > ** 8 printk messages dropped ** [  545.526341] f980:
> > > ffffff800a1c39e8
> > > 0000000000000036 [  545.526345] [<ffffff8008085720>]
> > > el1_irq+0xa0/0x100 [  545.526349] [<ffffff80080d6234>]
> > > console_unlock+0x384/0x5b0 [  545.526353] [<ffffff80080d673c>]
> > > vprintk_emit+0x2dc/0x4b0 [  545.526357] [<ffffff80080d6a50>]
> > > vprintk_default+0x38/0x40 [  545.526362] [<ffffff8008129704>]
> > > printk+0x58/0x60 [  545.526366] [<ffffff800859e3e4>]
> > > ath9k_iowrite32+0x9c/0xa8 [  545.526372] [<ffffff80085c7ca8>]
> > > ath9k_hw_kill_interrupts+0x28/0xf0
> > > [  545.526376] [<ffffff80085a18ec>] ath_reset+0x24/0x68
> > > ** 2 printk messages dropped ** [  545.526391] [<ffffff800885ad60>]
> > ieee80211_hw_config+0x50/0x290
> > > ** 11 printk messages dropped ** [  545.532834]
> > > ath9k_hw_kill_interrupts
> > 	 793
> > > [  545.532890] ath9k_hw_enable_interrupts	 821
> > >
> > >
> > > But if we have less debug prints it does not reach EP handler
> > > sometimes, due to following Condition in "kernel/irq/chip.c" in
> > > function handle_simple_irq
> > >
> > > if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) {
> > >                 desc->istate |=3D IRQS_PENDING;
> > >                 goto out_unlock;
> > >         }
> > > Here irqd_irq_disabled is being set to 1.
> > >
> > > With lesser debug prints it stops after following prints:
> > > root@Xilinx-ZCU102-2016_3:~# iw dev wlan0 scan
> > > [   54.781045] ath9k_hw_kill_interrupts	 793
> > > [   54.785007] ath9k_hw_kill_interrupts	 793
> > > [   54.792535] ath9k_hw_enable_interrupts	 821
> > > [   54.796642] ath9k_hw_enable_interrupts	 825
> > > [   54.800807] ath9k_hw_enable_interrupts	 832
> > > [   54.804973] AR_SREV_9100 0
> > > [   54.807663] ath9k_hw_enable_interrupts	 848
> > > [   54.811843] ath9k_hw_intrpend	 762
> > > [   54.815211] (AR_SREV_9340(ah) val 0
> > > [   54.818684] ath9k_hw_intrpend	 767
> > > [   54.822078] ath_isr	 603
> > > [   54.824587] ath9k_hw_kill_interrupts	 793
> > > [   54.828601] ath9k_hw_enable_interrupts	 821
> > > [   54.832750] ath9k_hw_enable_interrupts	 825
> > > [   54.836916] ath9k_hw_enable_interrupts	 832
> > > [   54.841082] AR_SREV_9100 0
> > > [   54.843772] ath9k_hw_enable_interrupts	 848
> > > [   54.843775] ath9k_hw_intrpend	 762
> > > [   54.851319] (AR_SREV_9340(ah) val 0
> > > [   54.854793] ath9k_hw_intrpend	 767
> > > [   54.858185] ath_isr	 603
> > > [   54.860696] ath9k_hw_kill_interrupts	 793
> > > [   54.864776] ath9k_hw_enable_interrupts	 821
> > > [   54.867061] ath9k_hw_kill_interrupts	 793
> > > [   54.872870] ath9k_hw_enable_interrupts	 825
> > > [   54.877036] ath9k_hw_enable_interrupts	 832
> > > [   54.881202] AR_SREV_9100 0
> > > [   54.883892] ath9k_hw_enable_interrupts	 848
> > > [   75.963129] INFO: rcu_sched detected stalls on CPUs/tasks:
> > > [   75.968602] 	0-...: (2 GPs behind) idle=3D9d5/140000000000001/0
> > softirq=3D1103/1109 fqs=3D519
> > > [   75.976675] 	(detected by 2, t=3D5274 jiffies, g=3D64, c=3D63, q=
=3D11)
> > > [   75.982485] Task dump for CPU 0:
> > > [   75.985696] ksoftirqd/0     R  running task        0     3      2 =
0x00000002
> > > [   75.992726] Call trace:
> > > [   75.995165] [<ffffff8008086b3c>] __switch_to+0xc4/0xd0
> > > [   76.000281] [<ffffffc87b830500>] 0xffffffc87b830500
> > > [  139.059027] INFO: rcu_sched detected stalls on CPUs/tasks:
> > > [  139.064430] 	0-...: (2 GPs behind) idle=3D9d5/140000000000001/0
> > softirq=3D1103/1109 fqs=3D2097
> > > [  139.072593] 	(detected by 2, t=3D21049 jiffies, g=3D64, c=3D63, q=
=3D11)
> > > [  139.078489] Task dump for CPU 0:
> > > [  139.081700] ksoftirqd/0     R  running task        0     3      2 =
0x00000002
> > > [  139.088731] Call trace:
> > > [  139.091165] [<ffffff8008086b3c>] __switch_to+0xc4/0xd0 [
> > > 139.096285] [<ffffffc87b830500>] 0xffffffc87b830500
> > >
> > >
> > >> > We are not seeing any issues on 32-bit ARM platform and X86
> > >> > platform.
> > >>
> > >> Can you collect a dmesg log (or, if the system hang means you can't
> > >> collect that, a console log with "ignore_loglevel"), and "lspci -vv"
> > >> output as root?  That should have clues about whether the INTx got
> > >> routed correctly.  /proc/interrupts should also show whether we're
> > >> receiving interrupts from the device.
> > >
> > > Here is the lspci output:
> > > 00:00.0 PCI bridge: Xilinx Corporation Device d022 (prog-if 00
> > > [Normal
> > decode])
> > > 	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> > ParErr- Stepping- SERR- FastB2B- DisINTx-
> > > 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=3Dfast >TAbort-
> > <TAbort- <MAbort- >SERR- <PERR- INTx-
> > > 	Latency: 0
> > > 	Interrupt: pin A routed to IRQ 224
> > > 	Bus: primary=3D00, secondary=3D01, subordinate=3D0c, sec-latency=3D0
> > > 	I/O behind bridge: 00000000-00000fff
> > > 	Memory behind bridge: e0000000-e00fffff
> > > 	Prefetchable memory behind bridge: 00000000fff00000-
> > 00000000000fffff
> > > 	Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=3Dfast >TAbort-
> > <TAbort- <MAbort- <SERR- <PERR-
> > > 	BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
> > > 		PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
> > > 	Capabilities: [40] Power Management version 3
> > > 		Flags: PMEClk- DSI- D1- D2- AuxCurrent=3D0mA
> > PME(D0+,D1+,D2+,D3hot+,D3cold-)
> > > 		Status: D0 NoSoftRst+ PME-Enable- DSel=3D0 DScale=3D0 PME-
> > > 	Capabilities: [60] Express (v2) Root Port (Slot-), MSI 00
> > > 		DevCap:	MaxPayload 256 bytes, PhantFunc 0
> > > 			ExtTag- RBE+
> > > 		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal-
> > Unsupported-
> > > 			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
> > > 			MaxPayload 128 bytes, MaxReadReq 512 bytes
> > > 		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr-
> > TransPend+
> > > 		LnkCap:	Port #0, Speed 5GT/s, Width x2, ASPM not supported,
> > Exit Latency L0s unlimited, L1 unlimited
> > > 			ClockPM- Surprise- LLActRep- BwNot+ ASPMOptComp+
> > > 		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk-
> > > 			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
> > > 		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
> > DLActive- BWMgmt- ABWMgmt-
> > > 		RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna-
> > CRSVisible+
> > > 		RootCap: CRSVisible+
> > > 		RootSta: PME ReqID 0000, PMEStatus- PMEPending-
> > > 		DevCap2: Completion Timeout: Range B, TimeoutDis+, LTR-,
> > OBFF Not Supported ARIFwd-
> > > 		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-,
> > OBFF Disabled ARIFwd-
> > > 		LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
> > > 			 Transmit Margin: Normal Operating Range,
> > EnterModifiedCompliance- ComplianceSOS-
> > > 			 Compliance De-emphasis: -6dB
> > > 		LnkSta2: Current De-emphasis Level: -3.5dB,
> > EqualizationComplete-, EqualizationPhase1-
> > > 			 EqualizationPhase2-, EqualizationPhase3-,
> > LinkEqualizationRequest-
> > > 	Capabilities: [100 v1] Device Serial Number 00-00-00-00-00-00-00-00
> > > 	Capabilities: [10c v1] Virtual Channel
> > > 		Caps:	LPEVC=3D0 RefClk=3D100ns PATEntryBits=3D1
> > > 		Arb:	Fixed- WRR32- WRR64- WRR128-
> > > 		Ctrl:	ArbSelect=3DFixed
> > > 		Status:	InProgress-
> > > 		VC0:	Caps:	PATOffset=3D00 MaxTimeSlots=3D1 RejSnoopTrans-
> > > 			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128-
> > WRR256-
> > > 			Ctrl:	Enable+ ID=3D0 ArbSelect=3DFixed TC/VC=3Dff
> > > 			Status:	NegoPending- InProgress-
> > > 	Capabilities: [128 v1] Vendor Specific Information: ID=3D1234 Rev=3D=
1
> > > Len=3D018 <?>
> > >
> > > 01:00.0 Network controller: Qualcomm Atheros AR93xx Wireless Network
> > Adapter (rev 01)
> > > 	Subsystem: Qualcomm Atheros Device 3112
> > > 	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> > ParErr- Stepping- SERR- FastB2B- DisINTx-
> > > 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=3Dfast >TAbort-
> > <TAbort- <MAbort- >SERR- <PERR- INTx-
> > > 	Latency: 0, Cache Line Size: 128 bytes
> > > 	Interrupt: pin A routed to IRQ 224
> > > 	Region 0: Memory at e0000000 (64-bit, non-prefetchable) [size=3D128K=
]
> > > 	[virtual] Expansion ROM at e0020000 [disabled] [size=3D64K]
> > > 	Capabilities: [40] Power Management version 3
> > > 		Flags: PMEClk- DSI- D1+ D2- AuxCurrent=3D375mA
> > PME(D0+,D1+,D2-,D3hot+,D3cold-)
> > > 		Status: D0 NoSoftRst- PME-Enable- DSel=3D0 DScale=3D0 PME-
> > > 	Capabilities: [50] MSI: Enable- Count=3D1/4 Maskable+ 64bit+
> > > 		Address: 0000000000000000  Data: 0000
> > > 		Masking: 00000000  Pending: 00000000
> > > 	Capabilities: [70] Express (v2) Endpoint, MSI 00
> > > 		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency
> > L0s <1us, L1 <8us
> > > 			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
> > SlotPowerLimit 0.000W
> > > 		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal-
> > Unsupported-
> > > 			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
> > > 			MaxPayload 128 bytes, MaxReadReq 512 bytes
> > > 		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr-
> > TransPend-
> > > 		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
> > Latency L0s <2us, L1 <64us
> > > 			ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
> > > 		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk-
> > > 			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
> > > 		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
> > DLActive- BWMgmt- ABWMgmt-
> > > 		DevCap2: Completion Timeout: Not Supported, TimeoutDis+,
> > LTR-, OBFF Not Supported
> > > 		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-,
> > OBFF Disabled
> > > 		LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance-
> > SpeedDis-
> > > 			 Transmit Margin: Normal Operating Range,
> > EnterModifiedCompliance- ComplianceSOS-
> > > 			 Compliance De-emphasis: -6dB
> > > 		LnkSta2: Current De-emphasis Level: -6dB,
> > EqualizationComplete-, EqualizationPhase1-
> > > 			 EqualizationPhase2-, EqualizationPhase3-,
> > LinkEqualizationRequest-
> > > 	Capabilities: [100 v1] Advanced Error Reporting
> > > 		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> > RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
> > > 		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> > RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
> > > 		UESvrt:	DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
> > RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
> > > 		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout-
> > NonFatalErr-
> > > 		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout-
> > NonFatalErr+
> > > 		AERCap:	First Error Pointer: 00, GenCap- CGenEn-
> > ChkCap- ChkEn-
> > > 	Capabilities: [140 v1] Virtual Channel
> > > 		Caps:	LPEVC=3D0 RefClk=3D100ns PATEntryBits=3D1
> > > 		Arb:	Fixed- WRR32- WRR64- WRR128-
> > > 		Ctrl:	ArbSelect=3DFixed
> > > 		Status:	InProgress-
> > > 		VC0:	Caps:	PATOffset=3D00 MaxTimeSlots=3D1 RejSnoopTrans-
> > > 			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128-
> > WRR256-
> > > 			Ctrl:	Enable+ ID=3D0 ArbSelect=3DFixed TC/VC=3Dff
> > > 			Status:	NegoPending- InProgress-
> > > 	Capabilities: [300 v1] Device Serial Number 00-00-00-00-00-00-00-00
> > > 	Kernel driver in use: ath9k
> > >
> > > Here is the cat /proc/interrupts (after we do interface up):
> > >
> > > root@:~# ifconfig wlan0 up
> > > [ 1548.926601] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
> > > root@Xilinx-ZCU102-2016_3:~# cat /proc/interrupts
> > >            CPU0       CPU1       CPU2       CPU3
> > >   1:          0          0          0          0     GICv2  29 Edge  =
    arch_timer
> > >   2:      19873      20058      19089      17435     GICv2  30 Edge  =
    arch_timer
> > >  12:          0          0          0          0     GICv2 156 Level =
    zynqmp-dma
> > >  13:          0          0          0          0     GICv2 157 Level =
    zynqmp-dma
> > >  14:          0          0          0          0     GICv2 158 Level =
    zynqmp-dma
> > >  15:          0          0          0          0     GICv2 159 Level =
    zynqmp-dma
> > >  16:          0          0          0          0     GICv2 160 Level =
    zynqmp-dma
> > >  17:          0          0          0          0     GICv2 161 Level =
    zynqmp-dma
> > >  18:          0          0          0          0     GICv2 162 Level =
    zynqmp-dma
> > >  19:          0          0          0          0     GICv2 163 Level =
    zynqmp-dma
> > >  20:          0          0          0          0     GICv2 164 Level =
    Mali_GP_MMU,
> Mali_GP,
> > Mali_PP0_MMU, Mali_PP0, Mali_PP1_MMU, Mali_PP1
> > >  30:          0          0          0          0     GICv2  95 Level =
    eth0, eth0
> > > 206:        314          0          0          0     GICv2  49 Level =
    cdns-i2c
> > > 207:         40          0          0          0     GICv2  50 Level =
    cdns-i2c
> > > 209:          0          0          0          0     GICv2 150 Level =
    nwl_pcie:misc
> > > 214:         12          0          0          0     GICv2  47 Level =
    ff0f0000.spi
> > > 215:          0          0          0          0     GICv2  58 Level =
    ffa60000.rtc
> > > 216:          0          0          0          0     GICv2  59 Level =
    ffa60000.rtc
> > > 217:          0          0          0          0     GICv2 165 Level =
    ahci-
> ceva[fd0c0000.ahci]
> > > 218:         61          0          0          0     GICv2  81 Level =
    mmc0
> > > 219:          0          0          0          0     GICv2 187 Level =
    arm-smmu global fault
> > > 220:        471          0          0          0     GICv2  53 Level =
    xuartps
> > > 223:          0          0          0          0     GICv2 154 Level =
    fd4c0000.dma
> > > 224:          3          0          0          0     dummy   1 Edge  =
    ath9k
> > > 225:          0          0          0          0     GICv2  97 Level =
    xhci-hcd:usb1
> > >
> > > Regards,
> > > Bharat
> >
> > --
> > Kalle Valo
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in t=
he body of
> a message to majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* RE: ATH9 driver issues on ARM64
From: Bharat Kumar Gogada @ 2016-12-09  5:00 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Bjorn Helgaas, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, Marc Zyngier,
	Janusz.Dziedzic@tieto.com, ath9k-devel@qca.qualcomm.com,
	linux-wireless@vger.kernel.org, rmanohar@qca.qualcomm.com
In-Reply-To: <874m2emif9.fsf@purkki.adurom.net>

Hi,
Can any one tell, when exactly the chip sends ASSERT & DEASSERT in driver.
It might help us to debug issue further.

Thanks & Regards,
Bharat=20

> >  > [+cc Kalle, ath9k list]
>=20
> Thanks, but please also CC linux-wireless. Full thread below for the folk=
s there.
>=20
> >> On Thu, Dec 08, 2016 at 01:49:42PM +0000, Bharat Kumar Gogada wrote:
> >> > Hi,
> >> >
> >> > Did anyone test Atheros ATH9
> >> > driver(drivers/net/wireless/ath/ath9k/)
> >> > on ARM64.  The end point is TP link wifi card with which supports
> >> > only legacy interrupts.
> >>
> >> If it works on other arches and the arm64 PCI enumeration works, my
> >> first guess would be an INTx issue, e.g., maybe the driver is waiting
> >> for an interrupt that never arrives.
> > We are not sure for now.
> >>
> >> > We are trying to test it on ARM64 with
> >> > (drivers/pci/host/pcie-xilinx-nwl.c) as root port.
> >> >
> >> > EP is getting enumerated and able to link up.
> >> >
> >> > But when we start scan system gets hanged.
> >>
> >> When you say the system hangs when you start a scan, I assume you
> >> mean a wifi scan, not the PCI enumeration.  A problem with a wifi
> >> scan might cause a *process* to hang, but it shouldn't hang the
> >> entire system.
> >>
> > Yes wifi scan.
> >> > When we took trace we see that after we start scan assert message
> >> > is sent but there is no de assert from end point.
> >>
> >> Are you talking about a trace from a PCIe analyzer?  Do you see an
> >> Assert_INTx PCIe message on the link?
> >>
> > Yes lecroy trace, yes we do see Assert_INTx and Deassert_INTx happening
> when we do interface link up.
> > When we have less debug prints in Atheros driver, and do wifi scan we
> > see Assert_INTx but never Deassert_INTx,
> >> > What might cause end point not sending de assert ?
> >>
> >> If the endpoint doesn't send a Deassert_INTx message, I expect that
> >> would mean the driver didn't service the interrupt and remove the
> >> condition that caused the device to assert the interrupt in the first
> >> place.
> >>
> >> If the driver didn't receive the interrupt, it couldn't service it,
> >> of course.  You could add a printk in the ath9k interrupt service
> >> routine to see if you ever get there.
> >>
> > The interrupt behavior is changing w.r.t amount of debug prints we
> > add. (I kept many prints to aid debug) root@Xilinx-ZCU102-2016_3:~# iw =
dev
> wlan0 scan
> > [   83.064675] ath9k: ath9k_iowrite32 ffffff800a400024
> > [   83.069486] ath9k: ath9k_ioread32 ffffff800a400024
> > [   83.074257] ath9k_hw_kill_interrupts	 793
> > [   83.078260] ath9k: ath9k_iowrite32 ffffff800a400024
> > [   83.083107] ath9k: ath9k_ioread32 ffffff800a400024
> > [   83.087882] ath9k_hw_kill_interrupts	 793
> > [   83.095450] ath9k_hw_enable_interrupts	 821
> > [   83.099557] ath9k_hw_enable_interrupts	 825
> > [   83.103721] ath9k_hw_enable_interrupts	 832
> > [   83.107887] ath9k: ath9k_iowrite32 ffffff800a400024
> > [   83.112748] AR_SREV_9100 0
> > [   83.115438] ath9k_hw_enable_interrupts	 848
> > [   83.119607] ath9k: ath9k_ioread32 ffffff800a400024
> > [   83.124389] ath9k_hw_intrpend	 762
> > [   83.127761] (AR_SREV_9340(ah) val 0
> > [   83.131234] ath9k_hw_intrpend	 767
> > [   83.134628] ath_isr	 603
> > [   83.137134] ath9k: ath9k_iowrite32 ffffff800a400024
> > [   83.141995] ath9k: ath9k_ioread32 ffffff800a400024
> > [   83.146771] ath9k_hw_kill_interrupts	 793
> > [   83.150864] ath9k_hw_enable_interrupts	 821
> > [   83.154971] ath9k_hw_enable_interrupts	 825
> > [   83.159135] ath9k_hw_enable_interrupts	 832
> > [   83.163300] ath9k: ath9k_iowrite32 ffffff800a400024
> > [   83.168161] AR_SREV_9100 0
> > [   83.170852] ath9k_hw_enable_interrupts	 848
> > [   83.170855] ath9k_hw_intrpend	 762
> > [   83.178398] (AR_SREV_9340(ah) val 0
> > [   83.181873] ath9k_hw_intrpend	 767
> > [   83.185265] ath_isr	 603
> > [   83.187773] ath9k: ath9k_iowrite32 ffffff800a400024
> > [   83.192635] ath9k: ath9k_ioread32 ffffff800a400024
> > [   83.197411] ath9k_hw_kill_interrupts	 793
> > [   83.201414] ath9k: ath9k_ioread32 ffffff800a400024
> > [   83.206258] ath9k_hw_enable_interrupts	 821
> > [   83.210368] ath9k_hw_enable_interrupts	 825
> > [   83.214531] ath9k_hw_enable_interrupts	 832
> > [   83.218698] ath9k: ath9k_iowrite32 ffffff800a400024
> > [   83.223558] AR_SREV_9100 0
> > [   83.226243] ath9k_hw_enable_interrupts	 848
> > [   83.226246] ath9k_hw_intrpend	 762
> > [   83.233794] (AR_SREV_9340(ah) val 0
> > [   83.237268] ath9k_hw_intrpend	 767
> > [   83.240661] ath_isr	 603
> > [   83.243169] ath9k: ath9k_iowrite32 ffffff800a400024
> > [   83.248030] ath9k: ath9k_ioread32 ffffff800a400024
> > [   83.252806] ath9k_hw_kill_interrupts	 793
> > [   83.256811] ath9k: ath9k_ioread32 ffffff800a400024
> > [   83.261651] ath9k_hw_enable_interrupts	 821
> > [   83.265753] ath9k_hw_enable_interrupts	 825
> > [   83.269919] ath9k_hw_enable_interrupts	 832
> > [   83.274083] ath9k: ath9k_iowrite32 ffffff800a400024
> > [   83.278945] AR_SREV_9100 0
> > [   83.281630] ath9k_hw_enable_interrupts	 848
> > [   83.281633] ath9k_hw_intrpend	 762
> > [   83.281634] (AR_SREV_9340(ah) val 0
> > [   83.281637] ath9k_hw_intrpend	 767
> > [   83.281648] ath_isr	 603
> > [   83.281649] ath9k: ath9k_iowrite32 ffffff800a400024
> > [   83.281651] ath9k: ath9k_ioread32 ffffff800a400024
> > [   83.281654] ath9k_hw_kill_interrupts	 793
> > [   83.312192] ath9k: ath9k_ioread32 ffffff800a400024
> > [   83.317030] ath9k_hw_enable_interrupts	 821
> > [   83.321132] ath9k_hw_enable_interrupts	 825
> > [   83.325297] ath9k_hw_enable_interrupts	 832
> > [   83.329463] ath9k: ath9k_iowrite32 ffffff800a400024
> > [   83.334324] AR_SREV_9100 0
> > [   83.337014] ath9k_hw_enable_interrupts	 848
> > ..
> > ..
> > This log continues until I turn off board without obtaining scanning re=
sult.
> >
> > In between I get following cpu stall outputs :
> >   230.457179] INFO: rcu_sched self-detected stall on CPU
> > [  230.457185] 	2-...: (31314 ticks this GP)
> idle=3D2d1/140000000000001/0 softirq=3D1400/1400 fqs=3D36713
> > [  230.457189] 	 (t=3D36756 jiffies g=3D161 c=3D160 q=3D16169)
> > [  230.457191] Task dump for CPU 2:
> > [  230.457196] kworker/u8:4    R  running task        0  1342      2 0x=
00000002
> > [  230.457207] Workqueue: phy0 ieee80211_scan_work [  230.457208] Call
> > trace:
> > [  230.457214] [<ffffff8008089860>] dump_backtrace+0x0/0x198 [
> > 230.457219] [<ffffff8008089a0c>] show_stack+0x14/0x20 [  230.457224]
> > [<ffffff80080c0930>] sched_show_task+0x98/0xf8 [  230.457228]
> > [<ffffff80080c2628>] dump_cpu_task+0x40/0x50 [  230.457233]
> > [<ffffff80080e14a8>] rcu_dump_cpu_stacks+0xa0/0xf0 [  230.457239]
> > [<ffffff80080e4cd8>] rcu_check_callbacks+0x468/0x748 [  230.457243]
> > [<ffffff80080e7cfc>] update_process_times+0x3c/0x68 [  230.457249]
> > [<ffffff80080f6dfc>] tick_sched_handle.isra.5+0x3c/0x50
> > [  230.457253] [<ffffff80080f6e54>] tick_sched_timer+0x44/0x90 [
> > 230.457257] [<ffffff80080e86b0>] __hrtimer_run_queues+0xf0/0x178
> > ** 10 printk messages dropped ** [  230.457302] f8c0: 0000000000000000
> > 0000000005f5e0ff 000000000001379a 3866666666666620 [  230.457306]
> > f8e0: ffffff800a1b4065 0000000000000006 ffffff800a129000
> > ffffffc87b8010a8 [  230.457310] f900: ffffff808a1b4057
> > ffffff800a1c3000 ffffff800a1b3000 ffffff800a13b000 [  230.457314]
> > f920: 0000000000000140 0000000000000006 ffffff800a1b3b10
> > ffffff800a1c39e8 [  230.457318] f940: 000000000000002f
> > ffffff800a1b8a98 ffffff800a1b3ae8 ffffffc87b07f990 [  230.457322]
> > f960: ffffff80080d6230 ffffffc87b07f990 ffffff80080d6234
> > 0000000060000145
> > ** 1 printk messages dropped ** [  230.457329] [<ffffff8008085720>]
> > el1_irq+0xa0/0x100
> > ** 9 printk messages dropped ** [  230.457373] [<ffffff800885ad60>]
> > ieee80211_hw_config+0x50/0x290 [  230.457377] [<ffffff8008863690>]
> > ieee80211_scan_work+0x1f8/0x480 [  230.457383] [<ffffff80080b15d0>]
> > process_one_work+0x120/0x378 [  230.457386] [<ffffff80080b1870>]
> > worker_thread+0x48/0x4b0 [  230.457391] [<ffffff80080b7108>]
> > kthread+0xd0/0xe8 [  230.457395] [<ffffff8008085dd0>]
> ret_from_fork+0x10/0x40
> > [  230.480389] ath9k_hw_intrpend	 762
> >
> >
> > [  545.487987] ath9k: ath9k_ioread32 ffffff800a400024 [  545.526189]
> > INFO: rcu_sched self-detected stall on CPU
> > [  545.526195] 	2-...: (97636 ticks this GP)
> idle=3D2d1/140000000000001/0 softirq=3D1400/1400 fqs=3D115374
> > [  545.526199] 	 (t=3D115523 jiffies g=3D161 c=3D160 q=3D51066)
> > [  545.526201] Task dump for CPU 2:
> > [  545.526206] kworker/u8:4    R  running task        0  1342      2 0x=
00000002
> > ** 3 printk messages dropped ** [  545.526231] [<ffffff8008089a0c>]
> > show_stack+0x14/0x20
> > ** 9 printk messages dropped ** [  545.526280] [<ffffff80086a71e8>]
> > arch_timer_handler_phys+0x30/0x40 [  545.526284] [<ffffff80080dbe18>]
> > handle_percpu_devid_irq+0x78/0xa0 [  545.526291] [<ffffff80080d760c>]
> > generic_handle_irq+0x24/0x38 [  545.526296] [<ffffff80080d7944>]
> > __handle_domain_irq+0x5c/0xb8 [  545.526299] [<ffffff80080824bc>]
> > gic_handle_irq+0x64/0xc0 [  545.526302] Exception stack(0xffffffc87b07f=
870
> to 0xffffffc87b07f990)
> > [  545.526306] f860:                                   0000000000009732=
 ffffff800a1eaaa8
> > ** 8 printk messages dropped ** [  545.526341] f980: ffffff800a1c39e8
> > 0000000000000036 [  545.526345] [<ffffff8008085720>]
> > el1_irq+0xa0/0x100 [  545.526349] [<ffffff80080d6234>]
> > console_unlock+0x384/0x5b0 [  545.526353] [<ffffff80080d673c>]
> > vprintk_emit+0x2dc/0x4b0 [  545.526357] [<ffffff80080d6a50>]
> > vprintk_default+0x38/0x40 [  545.526362] [<ffffff8008129704>]
> > printk+0x58/0x60 [  545.526366] [<ffffff800859e3e4>]
> > ath9k_iowrite32+0x9c/0xa8 [  545.526372] [<ffffff80085c7ca8>]
> > ath9k_hw_kill_interrupts+0x28/0xf0
> > [  545.526376] [<ffffff80085a18ec>] ath_reset+0x24/0x68
> > ** 2 printk messages dropped ** [  545.526391] [<ffffff800885ad60>]
> ieee80211_hw_config+0x50/0x290
> > ** 11 printk messages dropped ** [  545.532834] ath9k_hw_kill_interrupt=
s
> 	 793
> > [  545.532890] ath9k_hw_enable_interrupts	 821
> >
> >
> > But if we have less debug prints it does not reach EP handler
> > sometimes, due to following Condition in "kernel/irq/chip.c" in
> > function handle_simple_irq
> >
> > if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) {
> >                 desc->istate |=3D IRQS_PENDING;
> >                 goto out_unlock;
> >         }
> > Here irqd_irq_disabled is being set to 1.
> >
> > With lesser debug prints it stops after following prints:
> > root@Xilinx-ZCU102-2016_3:~# iw dev wlan0 scan
> > [   54.781045] ath9k_hw_kill_interrupts	 793
> > [   54.785007] ath9k_hw_kill_interrupts	 793
> > [   54.792535] ath9k_hw_enable_interrupts	 821
> > [   54.796642] ath9k_hw_enable_interrupts	 825
> > [   54.800807] ath9k_hw_enable_interrupts	 832
> > [   54.804973] AR_SREV_9100 0
> > [   54.807663] ath9k_hw_enable_interrupts	 848
> > [   54.811843] ath9k_hw_intrpend	 762
> > [   54.815211] (AR_SREV_9340(ah) val 0
> > [   54.818684] ath9k_hw_intrpend	 767
> > [   54.822078] ath_isr	 603
> > [   54.824587] ath9k_hw_kill_interrupts	 793
> > [   54.828601] ath9k_hw_enable_interrupts	 821
> > [   54.832750] ath9k_hw_enable_interrupts	 825
> > [   54.836916] ath9k_hw_enable_interrupts	 832
> > [   54.841082] AR_SREV_9100 0
> > [   54.843772] ath9k_hw_enable_interrupts	 848
> > [   54.843775] ath9k_hw_intrpend	 762
> > [   54.851319] (AR_SREV_9340(ah) val 0
> > [   54.854793] ath9k_hw_intrpend	 767
> > [   54.858185] ath_isr	 603
> > [   54.860696] ath9k_hw_kill_interrupts	 793
> > [   54.864776] ath9k_hw_enable_interrupts	 821
> > [   54.867061] ath9k_hw_kill_interrupts	 793
> > [   54.872870] ath9k_hw_enable_interrupts	 825
> > [   54.877036] ath9k_hw_enable_interrupts	 832
> > [   54.881202] AR_SREV_9100 0
> > [   54.883892] ath9k_hw_enable_interrupts	 848
> > [   75.963129] INFO: rcu_sched detected stalls on CPUs/tasks:
> > [   75.968602] 	0-...: (2 GPs behind) idle=3D9d5/140000000000001/0
> softirq=3D1103/1109 fqs=3D519
> > [   75.976675] 	(detected by 2, t=3D5274 jiffies, g=3D64, c=3D63, q=3D1=
1)
> > [   75.982485] Task dump for CPU 0:
> > [   75.985696] ksoftirqd/0     R  running task        0     3      2 0x=
00000002
> > [   75.992726] Call trace:
> > [   75.995165] [<ffffff8008086b3c>] __switch_to+0xc4/0xd0
> > [   76.000281] [<ffffffc87b830500>] 0xffffffc87b830500
> > [  139.059027] INFO: rcu_sched detected stalls on CPUs/tasks:
> > [  139.064430] 	0-...: (2 GPs behind) idle=3D9d5/140000000000001/0
> softirq=3D1103/1109 fqs=3D2097
> > [  139.072593] 	(detected by 2, t=3D21049 jiffies, g=3D64, c=3D63, q=3D=
11)
> > [  139.078489] Task dump for CPU 0:
> > [  139.081700] ksoftirqd/0     R  running task        0     3      2 0x=
00000002
> > [  139.088731] Call trace:
> > [  139.091165] [<ffffff8008086b3c>] __switch_to+0xc4/0xd0 [
> > 139.096285] [<ffffffc87b830500>] 0xffffffc87b830500
> >
> >
> >> > We are not seeing any issues on 32-bit ARM platform and X86
> >> > platform.
> >>
> >> Can you collect a dmesg log (or, if the system hang means you can't
> >> collect that, a console log with "ignore_loglevel"), and "lspci -vv"
> >> output as root?  That should have clues about whether the INTx got
> >> routed correctly.  /proc/interrupts should also show whether we're
> >> receiving interrupts from the device.
> >
> > Here is the lspci output:
> > 00:00.0 PCI bridge: Xilinx Corporation Device d022 (prog-if 00 [Normal
> decode])
> > 	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
> > 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=3Dfast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
> > 	Latency: 0
> > 	Interrupt: pin A routed to IRQ 224
> > 	Bus: primary=3D00, secondary=3D01, subordinate=3D0c, sec-latency=3D0
> > 	I/O behind bridge: 00000000-00000fff
> > 	Memory behind bridge: e0000000-e00fffff
> > 	Prefetchable memory behind bridge: 00000000fff00000-
> 00000000000fffff
> > 	Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=3Dfast >TAbort-
> <TAbort- <MAbort- <SERR- <PERR-
> > 	BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
> > 		PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
> > 	Capabilities: [40] Power Management version 3
> > 		Flags: PMEClk- DSI- D1- D2- AuxCurrent=3D0mA
> PME(D0+,D1+,D2+,D3hot+,D3cold-)
> > 		Status: D0 NoSoftRst+ PME-Enable- DSel=3D0 DScale=3D0 PME-
> > 	Capabilities: [60] Express (v2) Root Port (Slot-), MSI 00
> > 		DevCap:	MaxPayload 256 bytes, PhantFunc 0
> > 			ExtTag- RBE+
> > 		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal-
> Unsupported-
> > 			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
> > 			MaxPayload 128 bytes, MaxReadReq 512 bytes
> > 		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr-
> TransPend+
> > 		LnkCap:	Port #0, Speed 5GT/s, Width x2, ASPM not supported,
> Exit Latency L0s unlimited, L1 unlimited
> > 			ClockPM- Surprise- LLActRep- BwNot+ ASPMOptComp+
> > 		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk-
> > 			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
> > 		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
> DLActive- BWMgmt- ABWMgmt-
> > 		RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna-
> CRSVisible+
> > 		RootCap: CRSVisible+
> > 		RootSta: PME ReqID 0000, PMEStatus- PMEPending-
> > 		DevCap2: Completion Timeout: Range B, TimeoutDis+, LTR-,
> OBFF Not Supported ARIFwd-
> > 		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-,
> OBFF Disabled ARIFwd-
> > 		LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
> > 			 Transmit Margin: Normal Operating Range,
> EnterModifiedCompliance- ComplianceSOS-
> > 			 Compliance De-emphasis: -6dB
> > 		LnkSta2: Current De-emphasis Level: -3.5dB,
> EqualizationComplete-, EqualizationPhase1-
> > 			 EqualizationPhase2-, EqualizationPhase3-,
> LinkEqualizationRequest-
> > 	Capabilities: [100 v1] Device Serial Number 00-00-00-00-00-00-00-00
> > 	Capabilities: [10c v1] Virtual Channel
> > 		Caps:	LPEVC=3D0 RefClk=3D100ns PATEntryBits=3D1
> > 		Arb:	Fixed- WRR32- WRR64- WRR128-
> > 		Ctrl:	ArbSelect=3DFixed
> > 		Status:	InProgress-
> > 		VC0:	Caps:	PATOffset=3D00 MaxTimeSlots=3D1 RejSnoopTrans-
> > 			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128-
> WRR256-
> > 			Ctrl:	Enable+ ID=3D0 ArbSelect=3DFixed TC/VC=3Dff
> > 			Status:	NegoPending- InProgress-
> > 	Capabilities: [128 v1] Vendor Specific Information: ID=3D1234 Rev=3D1
> > Len=3D018 <?>
> >
> > 01:00.0 Network controller: Qualcomm Atheros AR93xx Wireless Network
> Adapter (rev 01)
> > 	Subsystem: Qualcomm Atheros Device 3112
> > 	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
> ParErr- Stepping- SERR- FastB2B- DisINTx-
> > 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=3Dfast >TAbort-
> <TAbort- <MAbort- >SERR- <PERR- INTx-
> > 	Latency: 0, Cache Line Size: 128 bytes
> > 	Interrupt: pin A routed to IRQ 224
> > 	Region 0: Memory at e0000000 (64-bit, non-prefetchable) [size=3D128K]
> > 	[virtual] Expansion ROM at e0020000 [disabled] [size=3D64K]
> > 	Capabilities: [40] Power Management version 3
> > 		Flags: PMEClk- DSI- D1+ D2- AuxCurrent=3D375mA
> PME(D0+,D1+,D2-,D3hot+,D3cold-)
> > 		Status: D0 NoSoftRst- PME-Enable- DSel=3D0 DScale=3D0 PME-
> > 	Capabilities: [50] MSI: Enable- Count=3D1/4 Maskable+ 64bit+
> > 		Address: 0000000000000000  Data: 0000
> > 		Masking: 00000000  Pending: 00000000
> > 	Capabilities: [70] Express (v2) Endpoint, MSI 00
> > 		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency
> L0s <1us, L1 <8us
> > 			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
> SlotPowerLimit 0.000W
> > 		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal-
> Unsupported-
> > 			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
> > 			MaxPayload 128 bytes, MaxReadReq 512 bytes
> > 		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr-
> TransPend-
> > 		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit
> Latency L0s <2us, L1 <64us
> > 			ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
> > 		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- CommClk-
> > 			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
> > 		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+
> DLActive- BWMgmt- ABWMgmt-
> > 		DevCap2: Completion Timeout: Not Supported, TimeoutDis+,
> LTR-, OBFF Not Supported
> > 		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-,
> OBFF Disabled
> > 		LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance-
> SpeedDis-
> > 			 Transmit Margin: Normal Operating Range,
> EnterModifiedCompliance- ComplianceSOS-
> > 			 Compliance De-emphasis: -6dB
> > 		LnkSta2: Current De-emphasis Level: -6dB,
> EqualizationComplete-, EqualizationPhase1-
> > 			 EqualizationPhase2-, EqualizationPhase3-,
> LinkEqualizationRequest-
> > 	Capabilities: [100 v1] Advanced Error Reporting
> > 		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
> > 		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
> > 		UESvrt:	DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt-
> RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
> > 		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout-
> NonFatalErr-
> > 		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout-
> NonFatalErr+
> > 		AERCap:	First Error Pointer: 00, GenCap- CGenEn-
> ChkCap- ChkEn-
> > 	Capabilities: [140 v1] Virtual Channel
> > 		Caps:	LPEVC=3D0 RefClk=3D100ns PATEntryBits=3D1
> > 		Arb:	Fixed- WRR32- WRR64- WRR128-
> > 		Ctrl:	ArbSelect=3DFixed
> > 		Status:	InProgress-
> > 		VC0:	Caps:	PATOffset=3D00 MaxTimeSlots=3D1 RejSnoopTrans-
> > 			Arb:	Fixed- WRR32- WRR64- WRR128- TWRR128-
> WRR256-
> > 			Ctrl:	Enable+ ID=3D0 ArbSelect=3DFixed TC/VC=3Dff
> > 			Status:	NegoPending- InProgress-
> > 	Capabilities: [300 v1] Device Serial Number 00-00-00-00-00-00-00-00
> > 	Kernel driver in use: ath9k
> >
> > Here is the cat /proc/interrupts (after we do interface up):
> >
> > root@:~# ifconfig wlan0 up
> > [ 1548.926601] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
> > root@Xilinx-ZCU102-2016_3:~# cat /proc/interrupts
> >            CPU0       CPU1       CPU2       CPU3
> >   1:          0          0          0          0     GICv2  29 Edge    =
  arch_timer
> >   2:      19873      20058      19089      17435     GICv2  30 Edge    =
  arch_timer
> >  12:          0          0          0          0     GICv2 156 Level   =
  zynqmp-dma
> >  13:          0          0          0          0     GICv2 157 Level   =
  zynqmp-dma
> >  14:          0          0          0          0     GICv2 158 Level   =
  zynqmp-dma
> >  15:          0          0          0          0     GICv2 159 Level   =
  zynqmp-dma
> >  16:          0          0          0          0     GICv2 160 Level   =
  zynqmp-dma
> >  17:          0          0          0          0     GICv2 161 Level   =
  zynqmp-dma
> >  18:          0          0          0          0     GICv2 162 Level   =
  zynqmp-dma
> >  19:          0          0          0          0     GICv2 163 Level   =
  zynqmp-dma
> >  20:          0          0          0          0     GICv2 164 Level   =
  Mali_GP_MMU, Mali_GP,
> Mali_PP0_MMU, Mali_PP0, Mali_PP1_MMU, Mali_PP1
> >  30:          0          0          0          0     GICv2  95 Level   =
  eth0, eth0
> > 206:        314          0          0          0     GICv2  49 Level   =
  cdns-i2c
> > 207:         40          0          0          0     GICv2  50 Level   =
  cdns-i2c
> > 209:          0          0          0          0     GICv2 150 Level   =
  nwl_pcie:misc
> > 214:         12          0          0          0     GICv2  47 Level   =
  ff0f0000.spi
> > 215:          0          0          0          0     GICv2  58 Level   =
  ffa60000.rtc
> > 216:          0          0          0          0     GICv2  59 Level   =
  ffa60000.rtc
> > 217:          0          0          0          0     GICv2 165 Level   =
  ahci-ceva[fd0c0000.ahci]
> > 218:         61          0          0          0     GICv2  81 Level   =
  mmc0
> > 219:          0          0          0          0     GICv2 187 Level   =
  arm-smmu global fault
> > 220:        471          0          0          0     GICv2  53 Level   =
  xuartps
> > 223:          0          0          0          0     GICv2 154 Level   =
  fd4c0000.dma
> > 224:          3          0          0          0     dummy   1 Edge    =
  ath9k
> > 225:          0          0          0          0     GICv2  97 Level   =
  xhci-hcd:usb1
> >
> > Regards,
> > Bharat
>=20
> --
> Kalle Valo

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox