Эх сурвалжийг харах

cnss2: Add code to optimize prints

Add code to optimize prints.

Change-Id: I21c070b4c136eeb5ef3ea2cc18e0fc415fd2297b
CRs-Fixed: 3161488
Sandeep Singh 2 жил өмнө
parent
commit
6b4390361d
3 өөрчлөгдсөн 18 нэмэгдсэн , 5 устгасан
  1. 11 4
      cnss2/pci.c
  2. 6 0
      cnss2/pci.h
  3. 1 1
      cnss2/pci_qcom.c

+ 11 - 4
cnss2/pci.c

@@ -651,6 +651,8 @@ static struct cnss_misc_reg syspm_reg_access_seq[] = {
 	{1, 0, QCA6390_SYSPM_WCSSAON_SR_STATUS, 0},
 };
 
+static struct cnss_print_optimize print_optimize;
+
 #define WCSS_REG_SIZE ARRAY_SIZE(wcss_reg_access_seq)
 #define PCIE_REG_SIZE ARRAY_SIZE(pcie_reg_access_seq)
 #define WLAON_REG_SIZE ARRAY_SIZE(wlaon_reg_access_seq)
@@ -2723,6 +2725,7 @@ skip_power_off:
 	}
 	clear_bit(CNSS_DRIVER_UNLOADING, &plat_priv->driver_state);
 	clear_bit(CNSS_DRIVER_IDLE_SHUTDOWN, &plat_priv->driver_state);
+	memset(&print_optimize, 0, sizeof(print_optimize));
 
 out:
 	return ret;
@@ -4405,11 +4408,14 @@ int cnss_get_user_msi_assignment(struct device *dev, char *user_name,
 			*user_base_data = msi_config->users[idx].base_vector
 				+ pci_priv->msi_ep_base_data;
 			*base_vector = msi_config->users[idx].base_vector;
+			/*Add only single print for each user*/
+			if (print_optimize.msi_log_chk[idx]++)
+				goto skip_print;
 
 			cnss_pr_dbg("Assign MSI to user: %s, num_vectors: %d, user_base_data: %u, base_vector: %u\n",
 				    user_name, *num_vectors, *user_base_data,
 				    *base_vector);
-
+skip_print:
 			return 0;
 		}
 	}
@@ -4449,9 +4455,10 @@ void cnss_get_msi_address(struct device *dev, u32 *msi_addr_low,
 				      msi_addr_high);
 	else
 		*msi_addr_high = 0;
-
-	cnss_pr_dbg("Get MSI low addr = 0x%x, high addr = 0x%x\n",
-		    *msi_addr_low, *msi_addr_high);
+	 /*Add only single print as the address is constant*/
+	 if (!print_optimize.msi_addr_chk++)
+		cnss_pr_dbg("Get MSI low addr = 0x%x, high addr = 0x%x\n",
+			    *msi_addr_low, *msi_addr_high);
 }
 EXPORT_SYMBOL(cnss_get_msi_address);
 

+ 6 - 0
cnss2/pci.h

@@ -25,6 +25,7 @@
 #define PCI_LINK_DOWN			0
 #define LINK_TRAINING_RETRY_MAX_TIMES		3
 #define LINK_TRAINING_RETRY_DELAY_MS		500
+#define MSI_USERS			4
 
 enum cnss_mhi_state {
 	CNSS_MHI_INIT,
@@ -97,6 +98,11 @@ struct cnss_pm_stats {
 	u64 runtime_put_timestamp_id[RTPM_ID_MAX];
 };
 
+struct cnss_print_optimize {
+	int msi_log_chk[MSI_USERS];
+	int msi_addr_chk;
+};
+
 struct cnss_pci_data {
 	struct pci_dev *pci_dev;
 	struct cnss_plat_data *plat_priv;

+ 1 - 1
cnss2/pci_qcom.c

@@ -6,7 +6,7 @@
 
 static struct cnss_msi_config msi_config = {
 	.total_vectors = 32,
-	.total_users = 4,
+	.total_users = MSI_USERS,
 	.users = (struct cnss_msi_user[]) {
 		{ .name = "MHI", .num_vectors = 3, .base_vector = 0 },
 		{ .name = "CE", .num_vectors = 10, .base_vector = 3 },