Browse Source

qcacmn: Check pending TX packets before runtime suspend

If there are pending TX packets, abort runtime suspend.

Change-Id: I3680142c3c35ddb946b32040adfcee6bdcad710c
CRs-fixed: 2302214
Yue Ma 6 years ago
parent
commit
af4272dbab
1 changed files with 6 additions and 2 deletions
  1. 6 2
      dp/wifi3.0/dp_main.c

+ 6 - 2
dp/wifi3.0/dp_main.c

@@ -7774,8 +7774,12 @@ static QDF_STATUS dp_runtime_suspend(struct cdp_pdev *opaque_pdev)
 	struct dp_pdev *pdev = (struct dp_pdev *)opaque_pdev;
 	struct dp_soc *soc = pdev->soc;
 
-	/* Call DP TX flow control API to check if there is any
-	   pending packets */
+	/* Abort if there are any pending TX packets */
+	if (dp_get_tx_pending(opaque_pdev) > 0) {
+		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
+			  FL("Abort suspend due to pending TX packets"));
+		return QDF_STATUS_E_AGAIN;
+	}
 
 	if (soc->intr_mode == DP_INTR_POLL)
 		qdf_timer_stop(&soc->int_timer);