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

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

msm: kgsl: Clear internal timestamps after a fault



Sometimes a fault can occur in the various bits that happen after a
user command is retired - if this happens there might be contexts
waiting to detach on internal ringbuffer commands that are not going
to be executed. All internal commands are not replayed on fault
recovery so the memstore needs to be updated and the events need
to be kicked so that the accounting is correct.

Change-Id: Ic0dedbad5de0e8350b60533871e16ffabdcb106b
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 9a1858cb
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -1866,6 +1866,26 @@ static int dispatcher_do_fault(struct kgsl_device *device)
	/* Reset the GPU and make sure halt is not set during recovery */
	halt = adreno_gpu_halt(adreno_dev);
	adreno_clear_gpu_halt(adreno_dev);

	/*
	 * If there is a stall in the ringbuffer after all commands have been
	 * retired then we could hit problems if contexts are waiting for
	 * internal timestamps that will never retire
	 */

	if (hung_rb != NULL) {
		kgsl_sharedmem_writel(device, &device->memstore,
			KGSL_MEMSTORE_OFFSET(KGSL_MEMSTORE_MAX + hung_rb->id,
				soptimestamp), hung_rb->timestamp);

		kgsl_sharedmem_writel(device, &device->memstore,
			KGSL_MEMSTORE_OFFSET(KGSL_MEMSTORE_MAX + hung_rb->id,
				eoptimestamp), hung_rb->timestamp);

		/* Schedule any pending events to be run */
		kgsl_process_event_group(device, &hung_rb->events);
	}

	ret = adreno_reset(device, fault);
	mutex_unlock(&device->mutex);
	/* if any other fault got in until reset then ignore */