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: Harshdeep Dhatt <hdhatt@codeaurora.org>
This commit is contained in:
Harshdeep Dhatt 2019-08-08 21:00:42 -06:00
commit 7e53b80b0b

View file

@ -1530,6 +1530,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);
@ -1695,12 +1699,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);
}