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

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

msm: kgsl: Add an helper function to clear the GPU fault after reset



Commit 3f44c3835ed073d02fa08b99a4457c6fadf4606d allowed for multiple
GPU faults to be set at the same time, but in doing so it changed
the behavior of adreno_set_gpu_fault() so that one can no longer
just pass in 0 to clear the fault status after GPU reset.  As a
result faults that occured after the inital fault that triggered
recovery would stay recorded in the driver and cause the GPU
start functions to fail.

Add adreno_clear_gpu_fault() to explicitly clear the fault after
GPU reset.

Change-Id: Ic0dedbad5fcd64f5d334a68731e40cc0dd86b79c
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 0c186090
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1720,7 +1720,7 @@ static int adreno_start(struct kgsl_device *device)
				regulator_is_enabled(device->pwrctrl.gpu_cx)));

	/* Clear any GPU faults that might have been left over */
	adreno_set_gpu_fault(adreno_dev, 0);
	adreno_clear_gpu_fault(adreno_dev);

	/* Power up the device */
	kgsl_pwrctrl_enable(device);
@@ -2333,7 +2333,7 @@ int adreno_soft_reset(struct kgsl_device *device)

	kgsl_pwrctrl_irq(device, KGSL_PWRFLAGS_OFF);

	adreno_set_gpu_fault(adreno_dev, 0);
	adreno_clear_gpu_fault(adreno_dev);

	/* Delete the idle timer */
	del_timer_sync(&device->idle_timer);
+13 −0
Original line number Diff line number Diff line
@@ -854,6 +854,19 @@ static inline void adreno_set_gpu_fault(struct adreno_device *adreno_dev,
	smp_wmb();
}

/**
 * adreno_clear_gpu_fault() - Clear the GPU fault register
 * @adreno_dev: A pointer to an adreno_device structure
 *
 * Clear the GPU fault status for the adreno device
 */

static inline void adreno_clear_gpu_fault(struct adreno_device *adreno_dev)
{
	atomic_set(&adreno_dev->dispatcher.fault, 0);
	smp_wmb();
}

/*
 * adreno_vbif_start() - Program VBIF registers, called in device start
 * @device: Pointer to device whose vbif data is to be programmed