Browse Source

cnss: store PCSS recovery config and send upon receiving fw ready

Keep PCSS recovery config as persistent during the whole
lifetime of cnss driver, and send it to WLAN firmware
service upon receiving firmware ready event.

Change-Id: Iec6c35c82750df3f8fd43723d102bcabfb539874
CRs-Fixed: 3378798
Yu Wang 2 years ago
parent
commit
4d71059d9b
2 changed files with 7 additions and 10 deletions
  1. 2 8
      cnss2/main.c
  2. 5 2
      cnss2/qmi.c

+ 2 - 8
cnss2/main.c

@@ -844,6 +844,7 @@ static int cnss_fw_ready_hdlr(struct cnss_plat_data *plat_priv)
 	clear_bit(CNSS_DEV_ERR_NOTIFY, &plat_priv->driver_state);
 
 	cnss_wlfw_send_pcie_gen_speed_sync(plat_priv);
+	cnss_send_subsys_restart_level_msg(plat_priv);
 
 	if (test_bit(CNSS_FW_BOOT_RECOVERY, &plat_priv->driver_state)) {
 		clear_bit(CNSS_FW_BOOT_RECOVERY, &plat_priv->driver_state);
@@ -3585,7 +3586,6 @@ static ssize_t recovery_store(struct device *dev,
 {
 	struct cnss_plat_data *plat_priv = dev_get_drvdata(dev);
 	unsigned int recovery = 0;
-	int ret;
 
 	if (!plat_priv)
 		return -ENODEV;
@@ -3603,13 +3603,7 @@ static ssize_t recovery_store(struct device *dev,
 	cnss_pr_dbg("%s PCSS recovery, count is %zu\n",
 		    plat_priv->recovery_pcss_enabled ? "Enable" : "Disable", count);
 
-	ret = cnss_send_subsys_restart_level_msg(plat_priv);
-	if (ret < 0) {
-		cnss_pr_err("pcss recovery setting failed with ret %d\n", ret);
-		plat_priv->recovery_pcss_enabled = false;
-		return -EINVAL;
-	}
-
+	cnss_send_subsys_restart_level_msg(plat_priv);
 	return count;
 }
 

+ 5 - 2
cnss2/qmi.c

@@ -3563,8 +3563,8 @@ int cnss_send_subsys_restart_level_msg(struct cnss_plat_data *plat_priv)
 		return -ENODEV;
 
 	if (!test_bit(CNSS_FW_READY, &plat_priv->driver_state)) {
-		cnss_pr_err("Can't send pcss cmd before fw ready\n");
-		return -EINVAL;
+		cnss_pr_dbg("Can't send pcss cmd before fw ready\n");
+		return 0;
 	}
 
 	pcss_enabled = plat_priv->recovery_pcss_enabled;
@@ -3579,6 +3579,9 @@ int cnss_send_subsys_restart_level_msg(struct cnss_plat_data *plat_priv)
 			    QMI_WLFW_SUBSYS_RESTART_LEVEL_REQ_V01,
 			    WLFW_SUBSYS_RESTART_LEVEL_REQ_MSG_V01_MAX_MSG_LEN,
 			    QMI_WLFW_TIMEOUT_JF);
+
+	if (ret < 0)
+		cnss_pr_err("pcss recovery setting failed with ret %d\n", ret);
 	return ret;
 }