ソースを参照

qcacld-3.0: Return EAGAIN in wlan_hdd_pld_runtime_suspend

If fw is down when runtime pm, runtime pm will return EFAULT
to kernel, so kernel will treat it as a critical error so all
future runtime PM API calls will return error, this is not what
driver expected.

Always make sure driver only return EAGAIN or EBUSY to kernel.

Change-Id: I651f75ee615af819a080e2955ac64a986620375f
CRs-Fixed: 2674531
Jingxiang Ge 5 年 前
コミット
83b1033055
1 ファイル変更9 行追加1 行削除
  1. 9 1
      core/hdd/src/wlan_hdd_driver_ops.c

+ 9 - 1
core/hdd/src/wlan_hdd_driver_ops.c

@@ -1781,12 +1781,20 @@ static int wlan_hdd_pld_runtime_suspend(struct device *dev,
 
 	errno = osif_psoc_sync_op_start(dev, &psoc_sync);
 	if (errno)
-		return errno;
+		goto out;
 
 	errno = wlan_hdd_runtime_suspend(dev);
 
 	osif_psoc_sync_op_stop(psoc_sync);
 
+out:
+	/* If it returns other errno to kernel, it will treat
+	 * it as critical issue, so all the future runtime
+	 * PM api will return error, pm runtime can't be work
+	 * anymore. Such case found in SSR.
+	 */
+	if (errno && errno != -EAGAIN && errno != -EBUSY)
+		errno = -EAGAIN;
 	return errno;
 }