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

Commit cddefb00 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Propagate the error from kgsl_active_count_wait()



kgsl_active_count_wait() returns an error on failure and if it does
that is a great indication that we probably don't want to go to
suspend right now. Pay attention to what the function returns and
do what it says.

Change-Id: Ic0dedbad44cd009e5318eccc567b0c3002e88bb3
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 08c77e77
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -622,7 +622,9 @@ static int kgsl_suspend_device(struct kgsl_device *device, pm_message_t state)
	device->ftbl->drain(device);

	/* Wait for the active count to hit zero */
	kgsl_active_count_wait(device, 0);
	status = kgsl_active_count_wait(device, 0);
	if (status)
		goto end;

	/*
	 * An interrupt could have snuck in and requested NAP in
@@ -662,6 +664,12 @@ static int kgsl_suspend_device(struct kgsl_device *device, pm_message_t state)
	status = 0;

end:
	if (status) {
		/* On failure, re-resume normal activity */
		if (device->ftbl->resume)
			device->ftbl->resume(device);
	}

	mutex_unlock(&device->mutex);
	KGSL_PWR_WARN(device, "suspend end\n");
	return status;