Skip to contentSkip to conversation

ath10k: fix unsupported chip reset debugs file write

PATCH Superseded Yingying Tang 2 participants 3 messages Feb 5, 2020 – Feb 13, 2020 Qualcomm Atheros ATH10K wireless driver

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: fix unsupported chip reset debugs file write

Before this change, after writing "warm_hw_reset" debugfs file, host will send chip reset command to FW even though FW do not support this service getting a warning print.

Though there is no FW impact before this change, this patch restricts chip reset command sent to FW only if FW advertises the support via WMI service bit.

Removed the redundant check and ath10k_warn() print as well.

New version FW will report chip reset service bit to host. Host allow user to trigger WLAN chip reset only when fw report this service bit.

For older NON-TLV FW, since it do not report chip reset service bit, host will not send chip reset command. For older TLV FW, since it report chip reset service bit, host will send chip reset command.

Tested HW: QCA9984, WCN3990

QCA9984 FW version: WLAN.BL.3.9.0.2-00042-S-1

---
 drivers/net/wireless/ath/ath10k/debug.c | 9 ++++-----
 drivers/net/wireless/ath/ath10k/wmi.h   | 8 ++++++++
 2 files changed, 12 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath10k/debug.c +4 -5
index 32d967a..4cec1a85 100644
@@ -2365,9 +2365,6 @@ static ssize_t ath10k_write_warm_hw_reset(struct file *file,
 		goto exit;
 	}
 
-	if (!(test_bit(WMI_SERVICE_RESET_CHIP, ar->wmi.svc_map)))
-		ath10k_warn(ar, "wmi service for reset chip is not available\n");
-
 	ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->pdev_reset,
 					WMI_RST_MODE_WARM_RESET);
 
@@ -2603,8 +2600,10 @@ int ath10k_debug_register(struct ath10k *ar)
 				    ar->debug.debugfs_phy, ar,
 				    &fops_tpc_stats_final);
 
-	debugfs_create_file("warm_hw_reset", 0600, ar->debug.debugfs_phy, ar,
-			    &fops_warm_hw_reset);
+	if (test_bit(WMI_SERVICE_RESET_CHIP, ar->wmi.svc_map))
+		debugfs_create_file("warm_hw_reset", 0600,
+				    ar->debug.debugfs_phy, ar,
+				    &fops_warm_hw_reset);
 
 	debugfs_create_file("ps_state_enable", 0600, ar->debug.debugfs_phy, ar,
 			    &fops_ps_state_enable);
drivers/net/wireless/ath/ath10k/wmi.h +8 -0
index e1c40bb..d753924 100644
@@ -367,6 +367,12 @@ enum wmi_10_4_service {
 	WMI_10_4_SERVICE_RTT_RESPONDER_ROLE,
 	WMI_10_4_SERVICE_EXT_PEER_TID_CONFIGS_SUPPORT,
 	WMI_10_4_SERVICE_REPORT_AIRTIME,
+	WMI_10_4_SERVICE_TX_PWR_PER_PEER,
+	WMI_10_4_SERVICE_FETCH_PEER_TX_PN,
+	WMI_10_4_SERVICE_MULTIPLE_VDEV_RESTART,
+	WMI_10_4_SERVICE_ENHANCED_RADIO_COUNTERS,
+	WMI_10_4_SERVICE_QINQ_SUPPORT,
+	WMI_10_4_SERVICE_RESET_CHIP,
 };
 
 static inline char *wmi_service_name(enum wmi_service service_id)
@@ -818,6 +824,8 @@ static inline void wmi_10_4_svc_map(const __le32 *in, unsigned long *out,
 	       WMI_SERVICE_PER_PACKET_SW_ENCRYPT, len);
 	SVCMAP(WMI_10_4_SERVICE_REPORT_AIRTIME,
 	       WMI_SERVICE_REPORT_AIRTIME, len);
+	SVCMAP(WMI_10_4_SERVICE_RESET_CHIP,
+	       WMI_SERVICE_RESET_CHIP, len);
 }
 
 #undef SVCMAP
Signature · 1 line
1.9.1
#1 lore raw
Quoted 17 lines · Yingying Tang

Before this change, after writing "warm_hw_reset" debugfs file, host will send chip reset command to FW even though FW do not support this service getting a warning print.

Though there is no FW impact before this change, this patch restricts chip reset command sent to FW only if FW advertises the support via WMI service bit.

Removed the redundant check and ath10k_warn() print as well.

New version FW will report chip reset service bit to host. Host allow user to trigger WLAN chip reset only when fw report this service bit.

For older NON-TLV FW, since it do not report chip reset service bit, host will not send chip reset command. For older TLV FW, since it report chip reset service bit, host will send chip reset command.

Quoted 5 lines

Tested HW: QCA9984, WCN3990

QCA9984 FW version: WLAN.BL.3.9.0.2-00042-S-1

Fails to apply:

error: patch failed: drivers/net/wireless/ath/ath10k/wmi.h:367
error: drivers/net/wireless/ath/ath10k/wmi.h: patch does not apply stg import: Diff does not apply cleanly

Patch set to Changes Requested.

Signature · 8 lines
https://patchwork.kernel.org/patch/11365857/

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

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#2 lore raw
In reply to Yingying Tang
Quoted 17 lines · Yingying Tang

Before this change, after writing "warm_hw_reset" debugfs file, host will send chip reset command to FW even though FW do not support this service getting a warning print.

Though there is no FW impact before this change, this patch restricts chip reset command sent to FW only if FW advertises the support via WMI service bit.

Removed the redundant check and ath10k_warn() print as well.

New version FW will report chip reset service bit to host. Host allow user to trigger WLAN chip reset only when fw report this service bit.

For older NON-TLV FW, since it do not report chip reset service bit, host will not send chip reset command. For older TLV FW, since it report chip reset service bit, host will send chip reset command.

Quoted 5 lines

Tested HW: QCA9984, WCN3990

QCA9984 FW version: WLAN.BL.3.9.0.2-00042-S-1

Fails to apply:

error: patch failed: drivers/net/wireless/ath/ath10k/wmi.h:367
error: drivers/net/wireless/ath/ath10k/wmi.h: patch does not apply stg import: Diff does not apply cleanly

Patch set to Changes Requested.

Signature · 3 lines
https://patchwork.kernel.org/patch/11365857/

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