Преглед изворни кода

qcacld-3.0: FISA suspend/resume code movement

Move the suspend/resume related handlers for FISA
in the DP component.

Change-Id: Iba2bcf313f0a6f94a8bd8ff3c6cb29e8ef58f225
CRs-Fixed: 3512042
Rakesh Pillai пре 1 година
родитељ
комит
7dde156e8d

+ 4 - 2
components/dp/core/src/wlan_dp_fisa_rx.c

@@ -2208,8 +2208,9 @@ void dp_set_fisa_disallowed_for_vdev(struct cdp_soc_t *cdp_soc, uint8_t vdev_id,
 	dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_RX);
 }
 
-void dp_suspend_fse_cache_flush(struct dp_soc *soc)
+void dp_suspend_fse_cache_flush(struct wlan_dp_psoc_context *dp_ctx)
 {
+	struct dp_soc *soc = (struct dp_soc *)dp_ctx->cdp_soc;
 	struct dp_rx_fst *dp_fst;
 
 	dp_fst = soc->rx_fst;
@@ -2222,8 +2223,9 @@ void dp_suspend_fse_cache_flush(struct dp_soc *soc)
 	dp_info("fse cache flush suspended");
 }
 
-void dp_resume_fse_cache_flush(struct dp_soc *soc)
+void dp_resume_fse_cache_flush(struct wlan_dp_psoc_context *dp_ctx)
 {
+	struct dp_soc *soc = (struct dp_soc *)dp_ctx->cdp_soc;
 	struct dp_rx_fst *dp_fst;
 
 	dp_fst = soc->rx_fst;

+ 28 - 4
components/dp/core/src/wlan_dp_fisa_rx.h

@@ -145,11 +145,11 @@ void dp_fisa_rx_fst_update_work(void *arg);
 
 /**
  * dp_suspend_fse_cache_flush() - Suspend FSE cache flush
- * @soc: core txrx main context
+ * @dp_ctx: DP component context
  *
  * Return: None
  */
-void dp_suspend_fse_cache_flush(struct dp_soc *soc);
+void dp_suspend_fse_cache_flush(struct wlan_dp_psoc_context *dp_ctx);
 
 /**
  * dp_rx_fst_attach() - Initialize Rx FST and setup necessary parameters
@@ -185,11 +185,11 @@ void dp_rx_fst_detach(struct wlan_dp_psoc_context *dp_ctx);
 
 /**
  * dp_resume_fse_cache_flush() - Resume FSE cache flush
- * @soc: core txrx main context
+ * @dp_ctx: DP component context
  *
  * Return: None
  */
-void dp_resume_fse_cache_flush(struct dp_soc *soc);
+void dp_resume_fse_cache_flush(struct wlan_dp_psoc_context *dp_ctx);
 
 /**
  * dp_rx_flow_send_fst_fw_setup() - Program FST parameters in FW/HW post-attach
@@ -200,7 +200,31 @@ void dp_resume_fse_cache_flush(struct dp_soc *soc);
  */
 QDF_STATUS dp_rx_flow_send_fst_fw_setup(struct dp_soc *soc,
 					struct dp_pdev *pdev);
+
+/**
+ * dp_rx_fst_update_pm_suspend_status() - Update Suspend status in FISA
+ * @dp_ctx: DP component context
+ * @suspended: Flag to indicate suspend or not
+ *
+ * Return: None
+ */
+void dp_rx_fst_update_pm_suspend_status(struct wlan_dp_psoc_context *dp_ctx,
+					bool suspended);
+
+/**
+ * dp_rx_fst_requeue_wq() - Re-queue pending work queue tasks
+ * @dp_ctx: DP component context
+ *
+ * Return: None
+ */
+void dp_rx_fst_requeue_wq(struct wlan_dp_psoc_context *dp_ctx);
 #else
+static inline void
+dp_rx_fst_update_pm_suspend_status(struct wlan_dp_psoc_context *dp_ctx,
+				   bool suspended)
+{
+}
+
 static QDF_STATUS dp_rx_dump_fisa_stats(struct dp_soc *soc)
 {
 	return QDF_STATUS_SUCCESS;

+ 81 - 4
components/dp/core/src/wlan_dp_main.c

@@ -1618,6 +1618,25 @@ wlan_dp_rx_fisa_cmem_attach(struct wlan_dp_psoc_context *dp_ctx)
 	dp_ctx->fst_cmem_base = cdp_get_fst_cem_base(dp_ctx->cdp_soc,
 						     DP_CMEM_FST_SIZE);
 }
+
+static inline QDF_STATUS
+wlan_dp_fisa_suspend(struct wlan_dp_psoc_context *dp_ctx)
+{
+	dp_suspend_fse_cache_flush(dp_ctx);
+	dp_rx_fst_update_pm_suspend_status(dp_ctx, true);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS
+wlan_dp_fisa_resume(struct wlan_dp_psoc_context *dp_ctx)
+{
+	dp_resume_fse_cache_flush(dp_ctx);
+	dp_rx_fst_update_pm_suspend_status(dp_ctx, false);
+	dp_rx_fst_requeue_wq(dp_ctx);
+
+	return QDF_STATUS_SUCCESS;
+}
 #else
 static inline QDF_STATUS
 wlan_dp_rx_fisa_attach(struct wlan_dp_psoc_context *dp_ctx)
@@ -1635,26 +1654,84 @@ static inline void
 wlan_dp_rx_fisa_cmem_attach(struct wlan_dp_psoc_context *dp_ctx)
 {
 }
+
+static inline QDF_STATUS
+wlan_dp_fisa_suspend(struct wlan_dp_psoc_context *dp_ctx)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS
+wlan_dp_fisa_resume(struct wlan_dp_psoc_context *dp_ctx)
+{
+	return QDF_STATUS_SUCCESS;
+}
 #endif
 
 QDF_STATUS __wlan_dp_runtime_suspend(ol_txrx_soc_handle soc, uint8_t pdev_id)
 {
-	return cdp_runtime_suspend(soc, pdev_id);
+	struct wlan_dp_psoc_context *dp_ctx;
+	QDF_STATUS status;
+
+	dp_ctx = dp_get_context();
+	status = cdp_runtime_suspend(soc, pdev_id);
+	if (QDF_IS_STATUS_ERROR(status))
+		return status;
+
+	dp_rx_fst_update_pm_suspend_status(dp_ctx, true);
+
+	return status;
 }
 
 QDF_STATUS __wlan_dp_runtime_resume(ol_txrx_soc_handle soc, uint8_t pdev_id)
 {
-	return cdp_runtime_resume(soc, pdev_id);
+	struct wlan_dp_psoc_context *dp_ctx;
+	QDF_STATUS status;
+
+	dp_ctx = dp_get_context();
+	status = cdp_runtime_resume(soc, pdev_id);
+	if (QDF_IS_STATUS_ERROR(status))
+		return status;
+
+	dp_rx_fst_update_pm_suspend_status(dp_ctx, false);
+
+	return status;
 }
 
 QDF_STATUS __wlan_dp_bus_suspend(ol_txrx_soc_handle soc, uint8_t pdev_id)
 {
-	return cdp_bus_suspend(soc, pdev_id);
+	struct wlan_dp_psoc_context *dp_ctx;
+	QDF_STATUS status;
+
+	dp_ctx = dp_get_context();
+
+	status = cdp_bus_suspend(soc, pdev_id);
+	if (QDF_IS_STATUS_ERROR(status))
+		return status;
+
+	status = wlan_dp_fisa_suspend(dp_ctx);
+	if (QDF_IS_STATUS_ERROR(status))
+		return status;
+
+	return status;
 }
 
 QDF_STATUS __wlan_dp_bus_resume(ol_txrx_soc_handle soc, uint8_t pdev_id)
 {
-	return cdp_bus_resume(soc, pdev_id);
+	struct wlan_dp_psoc_context *dp_ctx;
+	QDF_STATUS status;
+
+	dp_ctx = dp_get_context();
+
+	status = cdp_bus_resume(soc, pdev_id);
+	if (QDF_IS_STATUS_ERROR(status))
+		return status;
+
+	status = wlan_dp_fisa_resume(dp_ctx);
+	if (QDF_IS_STATUS_ERROR(status))
+		return status;
+
+	return status;
 }
 
 void *wlan_dp_txrx_soc_attach(struct dp_txrx_soc_attach_params *params,

+ 5 - 2
components/dp/core/src/wlan_dp_rx_fst.c

@@ -524,8 +524,10 @@ void dp_rx_fst_update_cmem_params(struct dp_soc *soc, uint16_t num_entries,
 		qdf_event_set(&fst->cmem_resp_event);
 }
 
-void dp_rx_fst_update_pm_suspend_status(struct dp_soc *soc, bool suspended)
+void dp_rx_fst_update_pm_suspend_status(struct wlan_dp_psoc_context *dp_ctx,
+					bool suspended)
 {
+	struct dp_soc *soc = (struct dp_soc *)dp_ctx->cdp_soc;
 	struct dp_rx_fst *fst = soc->rx_fst;
 
 	if (!fst)
@@ -537,8 +539,9 @@ void dp_rx_fst_update_pm_suspend_status(struct dp_soc *soc, bool suspended)
 		qdf_atomic_set(&fst->pm_suspended, 0);
 }
 
-void dp_rx_fst_requeue_wq(struct dp_soc *soc)
+void dp_rx_fst_requeue_wq(struct wlan_dp_psoc_context *dp_ctx)
 {
+	struct dp_soc *soc = (struct dp_soc *)dp_ctx->cdp_soc;
 	struct dp_rx_fst *fst = soc->rx_fst;
 
 	if (!fst || !fst->fst_wq_defer)