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

Commit 48efb4fd authored by Harshdeep Dhatt's avatar Harshdeep Dhatt Committed by Indira Biruduraju
Browse files

msm: kgsl: Correctly handle oob and fenced write failures



These both happen when gx is collapsed so its safe to
assume that nothing is inflight. Take an inline snapshot
and then request for a dispatcher based recovery.

Change-Id: I4a3438660953d38406dd8e70868fb38172f9e967
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent eeb43e9f
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1739,8 +1739,9 @@ static inline int adreno_perfcntr_active_oob_get(struct kgsl_device *device)
	if (!ret) {
	if (!ret) {
		ret = gmu_core_dev_oob_set(device, oob_perfcntr);
		ret = gmu_core_dev_oob_set(device, oob_perfcntr);
		if (ret) {
		if (ret) {
			gmu_core_snapshot(device);
			adreno_set_gpu_fault(ADRENO_DEVICE(device),
			adreno_set_gpu_fault(ADRENO_DEVICE(device),
				ADRENO_GMU_FAULT);
				ADRENO_GMU_FAULT_SKIP_SNAPSHOT);
			adreno_dispatcher_schedule(device);
			adreno_dispatcher_schedule(device);
			kgsl_active_count_put(device);
			kgsl_active_count_put(device);
		}
		}
+5 −4
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */
 */


#include "adreno.h"
#include "adreno.h"
@@ -388,10 +388,11 @@ void a6xx_preemption_trigger(struct adreno_device *adreno_dev)


	return;
	return;
err:
err:

	/* If fenced write fails, take inline snapshot and trigger recovery */
	/* If fenced write fails, set the fault and trigger recovery */
	if (!in_interrupt())
		gmu_core_snapshot(device);
	adreno_set_preempt_state(adreno_dev, ADRENO_PREEMPT_NONE);
	adreno_set_preempt_state(adreno_dev, ADRENO_PREEMPT_NONE);
	adreno_set_gpu_fault(adreno_dev, ADRENO_GMU_FAULT);
	adreno_set_gpu_fault(adreno_dev, ADRENO_GMU_FAULT_SKIP_SNAPSHOT);
	adreno_dispatcher_schedule(device);
	adreno_dispatcher_schedule(device);
	/* Clear the keep alive */
	/* Clear the keep alive */
	if (gmu_core_isenabled(device))
	if (gmu_core_isenabled(device))
+11 −5
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2002,2007-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2002,2007-2020, The Linux Foundation. All rights reserved.
 */
 */


#include <linux/sched/clock.h>
#include <linux/sched/clock.h>
@@ -74,6 +74,7 @@ static void adreno_get_submit_time(struct adreno_device *adreno_dev,
static void adreno_ringbuffer_wptr(struct adreno_device *adreno_dev,
static void adreno_ringbuffer_wptr(struct adreno_device *adreno_dev,
		struct adreno_ringbuffer *rb)
		struct adreno_ringbuffer *rb)
{
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	unsigned long flags;
	unsigned long flags;
	int ret = 0;
	int ret = 0;


@@ -85,7 +86,7 @@ static void adreno_ringbuffer_wptr(struct adreno_device *adreno_dev,
			 * Let the pwrscale policy know that new commands have
			 * Let the pwrscale policy know that new commands have
			 * been submitted.
			 * been submitted.
			 */
			 */
			kgsl_pwrscale_busy(KGSL_DEVICE(adreno_dev));
			kgsl_pwrscale_busy(device);


			/*
			/*
			 * Ensure the write posted after a possible
			 * Ensure the write posted after a possible
@@ -110,9 +111,14 @@ static void adreno_ringbuffer_wptr(struct adreno_device *adreno_dev,
	spin_unlock_irqrestore(&rb->preempt_lock, flags);
	spin_unlock_irqrestore(&rb->preempt_lock, flags);


	if (ret) {
	if (ret) {
		/* If WPTR update fails, set the fault and trigger recovery */
		/*
		adreno_set_gpu_fault(adreno_dev, ADRENO_GMU_FAULT);
		 * If WPTR update fails, take inline snapshot and trigger
		adreno_dispatcher_schedule(KGSL_DEVICE(adreno_dev));
		 * recovery.
		 */
		gmu_core_snapshot(device);
		adreno_set_gpu_fault(adreno_dev,
			ADRENO_GMU_FAULT_SKIP_SNAPSHOT);
		adreno_dispatcher_schedule(device);
	}
	}
}
}