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

Commit b58c79b8 authored by Pankaj Gupta's avatar Pankaj Gupta
Browse files

msm: kgsl: trace preempt_trigger before triggering the preemption



Updating the trace log location to prevent NULL pointer
access for adreno_dev->next_rb.
There are chances that interrupt for preemption complete
comes before driver could log this trace, and that will
lead to NULL pointer access, because while handling this
interrupt next_rb would be set to NULL.

Change-Id: I096aeccab72e36eb94608d7d96cef3b72051dd25
Signed-off-by: default avatarPankaj Gupta <gpankaj@codeaurora.org>
parent df36e143
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * it under the terms of the GNU General Public License version 2 and
@@ -383,6 +383,8 @@ void a6xx_preemption_trigger(struct adreno_device *adreno_dev)
		jiffies + msecs_to_jiffies(ADRENO_PREEMPT_TIMEOUT));
		jiffies + msecs_to_jiffies(ADRENO_PREEMPT_TIMEOUT));


	adreno_set_preempt_state(adreno_dev, ADRENO_PREEMPT_TRIGGERED);
	adreno_set_preempt_state(adreno_dev, ADRENO_PREEMPT_TRIGGERED);
	trace_adreno_preempt_trigger(adreno_dev->cur_rb, adreno_dev->next_rb,
		cntl);


	/* Trigger the preemption */
	/* Trigger the preemption */
	if (adreno_gmu_fenced_write(adreno_dev, ADRENO_REG_CP_PREEMPT, cntl,
	if (adreno_gmu_fenced_write(adreno_dev, ADRENO_REG_CP_PREEMPT, cntl,
@@ -392,8 +394,6 @@ void a6xx_preemption_trigger(struct adreno_device *adreno_dev)
		goto err;
		goto err;
	}
	}


	trace_adreno_preempt_trigger(adreno_dev->cur_rb, adreno_dev->next_rb,
		cntl);


	return;
	return;
err:
err: