ソースを参照

qcacld-3.0: Flush the idle shutdown before the dsc op start

Currently idle shutdown is flushed after the suspend dsc op
start. This can lead to the deadlock when the idle shutdown
work is running as it waits for the dsc ops to complete.

To mitigate this issue, flush the idle shutdown work before
starting the dsc ops in suspend sequence.

CRs-Fixed: 2941314
Change-Id: I023b9eb3543d83a30e0587cec3977e08ac7ab752
Sachin Ahuja 3 年 前
コミット
67ddd4b763
2 ファイル変更26 行追加5 行削除
  1. 14 2
      core/hdd/src/wlan_hdd_driver_ops.c
  2. 12 3
      core/hdd/src/wlan_hdd_power.c

+ 14 - 2
core/hdd/src/wlan_hdd_driver_ops.c

@@ -1160,8 +1160,6 @@ static int __wlan_hdd_bus_suspend(struct wow_enable_params wow_params,
 	if (err)
 		return err;
 
-	/* Wait for the stop module if already in progress */
-	hdd_psoc_idle_timer_stop(hdd_ctx);
 
 	/* If Wifi is off, return success for system suspend */
 	if (hdd_ctx->driver_status != DRIVER_MODULES_ENABLED) {
@@ -1839,6 +1837,20 @@ static int wlan_hdd_pld_suspend(struct device *dev,
 {
 	struct osif_psoc_sync *psoc_sync;
 	int errno;
+	struct hdd_context *hdd_ctx;
+
+	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+
+	errno = wlan_hdd_validate_context(hdd_ctx);
+	if (errno)
+		return errno;
+	/*
+	 * Flush the idle shutdown before ops start.This is done here to avoid
+	 * the deadlock as idle shutdown waits for the dsc ops
+	 * to complete.
+	 */
+	hdd_psoc_idle_timer_stop(hdd_ctx);
+
 
 	errno = osif_psoc_sync_op_start(dev, &psoc_sync);
 	if (errno)

+ 12 - 3
core/hdd/src/wlan_hdd_power.c

@@ -2206,9 +2206,6 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
 	if (0 != rc)
 		return rc;
 
-	/* Wait for the stop module if already in progress */
-	hdd_psoc_idle_timer_stop(hdd_ctx);
-
 	if (hdd_ctx->config->is_wow_disabled) {
 		hdd_info_rl("wow is disabled");
 		return -EINVAL;
@@ -2449,6 +2446,18 @@ int wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
 {
 	struct osif_psoc_sync *psoc_sync;
 	int errno;
+	struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
+
+	errno = wlan_hdd_validate_context(hdd_ctx);
+	if (0 != errno)
+		return errno;
+
+	/*
+	 * Flush the idle shutdown before ops start.This is done here to avoid
+	 * the deadlock as idle shutdown waits for the dsc ops
+	 * to complete.
+	 */
+	hdd_psoc_idle_timer_stop(hdd_ctx);
 
 	errno = osif_psoc_sync_op_start(wiphy_dev(wiphy), &psoc_sync);
 	if (errno)