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

Commit 44a47803 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt Committed by Indira Biruduraju
Browse files

msm: kgsl: Set gmu fault inside gmu_snapshot



The two always happen together. So set the gmu_fault
inside the gmu_snapshot function. Also, if we have
already recorded a gmu fault, then do not send nmi
or try to snapshot a gmu which is already in nmi.

Change-Id: I403a9c2c3cb7a1330a7931c41a23b4b4a2b66998
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent 196183c8
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -1553,6 +1553,10 @@ static void gmu_snapshot(struct kgsl_device *device)
	struct gmu_dev_ops *gmu_dev_ops = GMU_DEVICE_OPS(device);
	struct gmu_device *gmu = KGSL_GMU_DEVICE(device);

	/* Abstain from sending another nmi or over-writing snapshot */
	if (test_and_set_bit(GMU_FAULT, &device->gmu_core.flags))
		return;

	adreno_gmu_send_nmi(adreno_dev);
	/* Wait for the NMI to be handled */
	udelay(100);
@@ -1719,12 +1723,6 @@ static void gmu_stop(struct kgsl_device *device)
	return;

error:
	/*
	 * The power controller will change state to SLUMBER anyway
	 * Set GMU_FAULT flag to indicate to power contrller
	 * that hang recovery is needed to power on GPU
	 */
	set_bit(GMU_FAULT, &device->gmu_core.flags);
	dev_err(&gmu->pdev->dev, "Failed to stop GMU\n");
	gmu_core_snapshot(device);
}