Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf526004 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "slim-msm-ngd: Prevent race condition between resume and SSR"

parents ddff0c58 33244abf
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2087,9 +2087,9 @@ static int ngd_slim_runtime_resume(struct device *device)
	int ret = 0;

	mutex_lock(&dev->tx_lock);
	if (dev->state >= MSM_CTRL_ASLEEP)
	if ((dev->state >= MSM_CTRL_ASLEEP) && (dev->qmi.handle != NULL))
		ret = ngd_slim_power_up(dev, false);
	if (ret) {
	if (ret || dev->qmi.handle == NULL) {
		/* Did SSR cause this power up failure */
		if (dev->state != MSM_CTRL_DOWN)
			dev->state = MSM_CTRL_ASLEEP;
@@ -2158,7 +2158,7 @@ static int ngd_slim_suspend(struct device *dev)
			cdev->qmi.deferred_resp = false;
		}
	}
	SLIM_INFO(cdev, "system suspend\n");
	SLIM_INFO(cdev, "system suspend state: %d\n", cdev->state);
	return ret;
}

@@ -2192,7 +2192,7 @@ static int ngd_slim_resume(struct device *dev)
	 * Even if it's not enabled, rely on 1st client transaction to do
	 * clock/power on
	 */
	SLIM_INFO(cdev, "system resume\n");
	SLIM_INFO(cdev, "system resume state: %d\n", cdev->state);
	return ret;
}
#endif /* CONFIG_PM_SLEEP */