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

Commit 1ee715a3 authored by Carter Cooper's avatar Carter Cooper
Browse files

msm: kgsl: Double check that wait didn't get scheduled out



If KGSL times out (due to cond_resched()) while waiting on
a GMU status register, double check if the value was
successfully set before returning error.

Change-Id: I72b866434716c9a9175b4fe3fb7b407feb2ca164
Signed-off-by: default avatarCarter Cooper <ccooper@codeaurora.org>
parent f5d98565
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1007,6 +1007,11 @@ static int timed_poll_check(struct kgsl_device *device,
		cond_resched();
	} while (!time_after(jiffies, t));

	/* Double check one last time */
	kgsl_gmu_regread(device, offset, &value);
	if ((value & mask) == expected_ret)
		return 0;

	return -EINVAL;
}

+8 −0
Original line number Diff line number Diff line
@@ -1519,6 +1519,14 @@ void gmu_stop(struct kgsl_device *device)
		cond_resched();
	}

	/* Double check one last time */
	if (idle == false) {
		adreno_read_gmureg(ADRENO_DEVICE(device),
			ADRENO_REG_GMU_RPMH_POWER_STATE, &reg);
		if (reg == device->gmu.idle_level)
			idle = true;
	}

	gpudev->rpmh_gpu_pwrctrl(adreno_dev, GMU_NOTIFY_SLUMBER, 0, 0);

	if (!idle || (gpudev->wait_for_gmu_idle &&