Prechádzať zdrojové kódy

icnss2: Synchronize qmi server arrive with co-processor up

WLAN RFA is present in another co-processor subsystem.
In order to prevent unclocked access, Wait for SLATE_POWER_UP
event before starting wlan cold boot qmi handshakes.

Change-Id: If24816c270c32c5f0191227ef66bc4a31549c54d
Dundi Raviteja 2 rokov pred
rodič
commit
951c866f53
3 zmenil súbory, kde vykonal 26 pridanie a 0 odobranie
  1. 3 0
      icnss2/debug.c
  2. 21 0
      icnss2/main.c
  3. 2 0
      icnss2/main.h

+ 3 - 0
icnss2/debug.c

@@ -419,6 +419,9 @@ static int icnss_stats_show_state(struct seq_file *s, struct icnss_priv *priv)
 			continue;
 		case ICNSS_SLATE_SSR_REGISTERED:
 			seq_puts(s, "SLATE SSR REGISTERED");
+			continue;
+		case ICNSS_SLATE_UP:
+			seq_puts(s, "ICNSS SLATE UP");
 		}
 
 		seq_printf(s, "UNKNOWN-%d", i);

+ 21 - 0
icnss2/main.c

@@ -827,6 +827,13 @@ static int icnss_driver_event_server_arrive(struct icnss_priv *priv,
 
 	set_bit(ICNSS_WLFW_CONNECTED, &priv->state);
 
+	if (priv->is_slate_rfa && !test_bit(ICNSS_SLATE_UP, &priv->state)) {
+		reinit_completion(&priv->slate_boot_complete);
+		icnss_pr_dbg("Waiting for slate boot up notification, 0x%lx\n",
+			     priv->state);
+		wait_for_completion(&priv->slate_boot_complete);
+	}
+
 	ret = wlfw_ind_register_send_sync_msg(priv);
 	if (ret < 0) {
 		if (ret == -EALREADY) {
@@ -2204,6 +2211,17 @@ static int icnss_slate_notifier_nb(struct notifier_block *nb,
 				   unsigned long code,
 				   void *data)
 {
+	struct icnss_priv *priv = container_of(nb, struct icnss_priv,
+					       slate_ssr_nb);
+	icnss_pr_vdbg("Slate-subsys-notify: event %lu\n", code);
+
+	if (code == QCOM_SSR_AFTER_POWERUP) {
+		set_bit(ICNSS_SLATE_UP, &priv->state);
+		complete(&priv->slate_boot_complete);
+		icnss_pr_dbg("Slate boot complete, state: 0x%lx\n",
+			     priv->state);
+	}
+
 	return NOTIFY_OK;
 }
 
@@ -4393,6 +4411,9 @@ static int icnss_probe(struct platform_device *pdev)
 
 	init_completion(&priv->unblock_shutdown);
 
+	if (priv->is_slate_rfa)
+		init_completion(&priv->slate_boot_complete);
+
 	if (priv->device_id == WCN6750_DEVICE_ID) {
 		priv->soc_wake_wq = alloc_workqueue("icnss_soc_wake_event",
 						    WQ_UNBOUND|WQ_HIGHPRI, 1);

+ 2 - 0
icnss2/main.h

@@ -126,6 +126,7 @@ enum icnss_driver_state {
 	ICNSS_COLD_BOOT_CAL,
 	ICNSS_QMI_DMS_CONNECTED,
 	ICNSS_SLATE_SSR_REGISTERED,
+	ICNSS_SLATE_UP,
 };
 
 struct ce_irq_list {
@@ -499,6 +500,7 @@ struct icnss_priv {
 	bool is_rf_subtype_valid;
 	u32 rf_subtype;
 	u8 is_slate_rfa;
+	struct completion slate_boot_complete;
 };
 
 struct icnss_reg_info {