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

Commit 74b8157e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Fix race condition in adreno_spin_idle()"

parents f04e4b12 0afacebf
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -2183,7 +2183,7 @@ int adreno_spin_idle(struct adreno_device *adreno_dev, unsigned int timeout)
		adreno_getreg(adreno_dev, ADRENO_REG_RBBM_STATUS) << 2,
		0x00000000, 0x80000000);

	while (time_before(jiffies, wait)) {
	do {
		/*
		 * If we fault, stop waiting and return an error. The dispatcher
		 * will clean up the fault from the work queue, but we need to
@@ -2196,7 +2196,19 @@ int adreno_spin_idle(struct adreno_device *adreno_dev, unsigned int timeout)

		if (adreno_isidle(KGSL_DEVICE(adreno_dev)))
			return 0;
	}

	} while (time_before(jiffies, wait));

	/*
	 * Under rare conditions, preemption can cause the while loop to exit
	 * without checking if the gpu is idle. check one last time before we
	 * return failure.
	 */
	if (adreno_gpu_fault(adreno_dev) != 0)
		return -EDEADLK;

	if (adreno_isidle(KGSL_DEVICE(adreno_dev)))
		return 0;

	return -ETIMEDOUT;
}