Parcourir la source

qcacmn: PCIe prevent_l1 for optional wifi dp feature

This change will hold the PCIe in L0 state for the
duration of this feature. The hold will be
released after data transfer is complete.

Change-Id: I762bc3423059ad641bdd00ac5b301a1e1b16f6c2
CRs-Fixed: 3406490
Namita Nair il y a 2 ans
Parent
commit
c6a6c4563d
4 fichiers modifiés avec 95 ajouts et 0 suppressions
  1. 45 0
      dp/inc/cdp_txrx_ipa.h
  2. 7 0
      dp/inc/cdp_txrx_ops.h
  3. 31 0
      hif/inc/hif.h
  4. 12 0
      hif/src/pcie/if_pci.c

+ 45 - 0
dp/inc/cdp_txrx_ipa.h

@@ -770,6 +770,50 @@ cdp_ipa_ast_create(ol_txrx_soc_handle soc, qdf_ipa_ast_info_type_t *data)
 }
 #endif
 
+#ifdef IPA_OPT_WIFI_DP
+/*
+ * cdp_ipa_pcie_link_up() - Send request to hold PCIe link in L0
+ * @soc - cdp soc handle
+ *
+ * Return: 0 for success, negative for failure
+ */
+static inline int
+cdp_ipa_pcie_link_up(ol_txrx_soc_handle soc)
+{
+	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
+		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
+			  "%s invalid instance", __func__);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (soc->ops->ipa_ops->ipa_pcie_link_up)
+		return soc->ops->ipa_ops->ipa_pcie_link_up(soc);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+/*
+ * cdp_ipa_pcie_link_down() - Release request to hold PCIe link in L0
+ * @soc - cdp soc handle
+ *
+ * Return: 0 for success, negative for failure
+ */
+static inline int
+cdp_ipa_pcie_link_down(ol_txrx_soc_handle soc)
+{
+	if (!soc || !soc->ops || !soc->ops->ipa_ops) {
+		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
+			  "%s invalid instance", __func__);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (soc->ops->ipa_ops->ipa_pcie_link_down)
+		soc->ops->ipa_ops->ipa_pcie_link_down(soc);
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+
 /**
  * cdp_ipa_update_peer_rx_stats() - update peer rx stats
  * @soc: data path soc handle
@@ -895,5 +939,6 @@ cdp_ipa_opt_dp_enable_disable_low_power_mode(struct wlan_objmgr_pdev *pdev,
 	return status;
 }
 #endif /* IPA_OPT_WIFI_DP */
+
 #endif /* IPA_OFFLOAD */
 #endif /* _CDP_TXRX_IPA_H_ */

+ 7 - 0
dp/inc/cdp_txrx_ops.h

@@ -2051,6 +2051,8 @@ struct cdp_throttle_ops {
  * @ipa_update_peer_rx_stats:
  * @ipa_uc_get_share_stats:
  * @ipa_uc_set_quota:
+ * @ipa_pcie_link_up: Hold PCIe link in L0
+ * @ipa_pcie_link_down: Release PCIe link L0 hold
  * @ipa_enable_autonomy:
  * @ipa_disable_autonomy:
  * @ipa_setup:
@@ -2064,6 +2066,7 @@ struct cdp_throttle_ops {
  * @ipa_tx_buf_smmu_mapping: Create SMMU mappings for Tx
  * @ipa_tx_buf_smmu_unmapping: Release SMMU mappings for Tx
  * buffers to IPA
+ * @ipa_rx_super_rule_setup: Setup cce super rules based on filter tuple
  * @ipa_ast_create: Create/Update ast entry
  */
 struct cdp_ipa_ops {
@@ -2099,6 +2102,10 @@ struct cdp_ipa_ops {
 					     uint8_t reset_stats);
 	QDF_STATUS (*ipa_uc_set_quota)(struct cdp_soc_t *soc_hdl,
 				       uint8_t pdev_id, uint64_t quota_bytes);
+#endif
+#ifdef IPA_OPT_WIFI_DP
+	int (*ipa_pcie_link_up)(struct cdp_soc_t *soc_hdl);
+	void (*ipa_pcie_link_down)(struct cdp_soc_t *soc_hdl);
 #endif
 	QDF_STATUS (*ipa_enable_autonomy)(struct cdp_soc_t *soc_hdl,
 					  uint8_t pdev_id);

+ 31 - 0
hif/inc/hif.h

@@ -2087,6 +2087,37 @@ void hif_allow_link_low_power_states(struct hif_opaque_softc *hif)
 }
 #endif
 
+#ifdef IPA_OPT_WIFI_DP
+/**
+ * hif_prevent_l1() - Prevent from going to low power states
+ * @hif: HIF opaque context
+ *
+ * Return: 0 on success. Error code on failure.
+ */
+int hif_prevent_l1(struct hif_opaque_softc *hif);
+
+/**
+ * hif_allow_l1() - Allow link to go to low power states
+ * @hif: HIF opaque context
+ *
+ * Return: None
+ */
+void hif_allow_l1(struct hif_opaque_softc *hif);
+
+#else
+
+static inline
+int hif_prevent_l1(struct hif_opaque_softc *hif)
+{
+	return 0;
+}
+
+static inline
+void hif_allow_l1(struct hif_opaque_softc *hif)
+{
+}
+#endif
+
 void *hif_get_dev_ba(struct hif_opaque_softc *hif_handle);
 void *hif_get_dev_ba_ce(struct hif_opaque_softc *hif_handle);
 void *hif_get_dev_ba_pmm(struct hif_opaque_softc *hif_handle);

+ 12 - 0
hif/src/pcie/if_pci.c

@@ -4228,3 +4228,15 @@ void hif_allow_link_low_power_states(struct hif_opaque_softc *hif)
 	pld_allow_l1(HIF_GET_SOFTC(hif)->qdf_dev->dev);
 }
 #endif
+
+#ifdef IPA_OPT_WIFI_DP
+int hif_prevent_l1(struct hif_opaque_softc *hif)
+{
+	return hif_force_wake_request(hif);
+}
+
+void hif_allow_l1(struct hif_opaque_softc *hif)
+{
+	hif_force_wake_release(hif);
+}
+#endif