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

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

Merge "msm: kgsl: Suspend GMU on recovery failure"

parents 1dfe6123 2927bbdb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1975,4 +1975,5 @@ struct gmu_core_ops gmu_ops = {
	.dcvs_set = gmu_dcvs_set,
	.snapshot = gmu_snapshot,
	.regulator_isenabled = gmu_regulator_isenabled,
	.suspend = gmu_suspend,
};
+10 −0
Original line number Diff line number Diff line
@@ -123,6 +123,16 @@ void gmu_core_stop(struct kgsl_device *device)
		gmu_core_ops->stop(device);
}

int gmu_core_suspend(struct kgsl_device *device)
{
	struct gmu_core_ops *gmu_core_ops = GMU_CORE_OPS(device);

	if (gmu_core_ops && gmu_core_ops->suspend)
		return gmu_core_ops->suspend(device);

	return -EINVAL;
}

void gmu_core_snapshot(struct kgsl_device *device)
{
	struct gmu_core_ops *gmu_core_ops = GMU_CORE_OPS(device);
+2 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ struct gmu_core_ops {
	int (*get_idle_level)(struct kgsl_device *device);
	void (*set_idle_level)(struct kgsl_device *device, unsigned int val);
	bool (*regulator_isenabled)(struct kgsl_device *device);
	int (*suspend)(struct kgsl_device *device);
};

struct gmu_dev_ops {
@@ -165,6 +166,7 @@ int gmu_core_probe(struct kgsl_device *device);
void gmu_core_remove(struct kgsl_device *device);
int gmu_core_start(struct kgsl_device *device);
void gmu_core_stop(struct kgsl_device *device);
int gmu_core_suspend(struct kgsl_device *device);
void gmu_core_snapshot(struct kgsl_device *device);
bool gmu_core_gpmu_isenabled(struct kgsl_device *device);
bool gmu_core_isenabled(struct kgsl_device *device);
+18 −0
Original line number Diff line number Diff line
@@ -2811,6 +2811,24 @@ _aware(struct kgsl_device *device)
				WARN_ONCE(1, "Failed to recover GMU\n");
				if (device->snapshot)
					device->snapshot->recovered = false;
				/*
				 * On recovery failure, we are clearing
				 * GMU_FAULT bit and also not keeping
				 * the state as RESET to make sure any
				 * attempt to wake GMU/GPU after this
				 * is treated as a fresh start. But on
				 * recovery failure, GMU HS, clocks and
				 * IRQs are still ON/enabled because of
				 * which next GMU/GPU wakeup results in
				 * multiple warnings from GMU start as HS,
				 * clocks and IRQ were ON while doing a
				 * fresh start i.e. wake from SLUMBER.
				 *
				 * Suspend the GMU on recovery failure
				 * to make sure next attempt to wake up
				 * GMU/GPU is indeed a fresh start.
				 */
				gmu_core_suspend(device);
				kgsl_pwrctrl_set_state(device, state);
			} else {
				if (device->snapshot)