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

Commit adc26726 authored by Kyle Piefer's avatar Kyle Piefer
Browse files

msm: kgsl: Increase the fenced write timeout



Make the fenced regiser write timeout twice as long
to increase the chances of success. Print a message
after half the time and after the full time to aid
in debugging.

Change-Id: I2cf87acacd40693046962031c598062c8b6bec84
Signed-off-by: default avatarKyle Piefer <kpiefer@codeaurora.org>
Signed-off-by: default avatarCarter Cooper <ccooper@codeaurora.org>
parent 9ea664bf
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -3261,7 +3261,7 @@ int adreno_gmu_fenced_write(struct adreno_device *adreno_dev,
	if (!gmu_core_isenabled(KGSL_DEVICE(adreno_dev)))
		return 0;

	for (i = 0; i < GMU_CORE_WAKEUP_RETRY_MAX; i++) {
	for (i = 0; i < GMU_CORE_LONG_WAKEUP_RETRY_LIMIT; i++) {
		adreno_read_gmureg(adreno_dev, ADRENO_REG_GMU_AHB_FENCE_STATUS,
			&status);

@@ -3276,10 +3276,19 @@ int adreno_gmu_fenced_write(struct adreno_device *adreno_dev,

		/* Try to write the fenced register again */
		adreno_writereg(adreno_dev, offset, val);

		if (i == GMU_CORE_SHORT_WAKEUP_RETRY_LIMIT)
			dev_err(adreno_dev->dev.dev,
				"Waited %d usecs to write fenced register 0x%x. Continuing to wait...\n",
				(GMU_CORE_SHORT_WAKEUP_RETRY_LIMIT *
				GMU_CORE_WAKEUP_DELAY_US),
				reg_offset);
	}

	dev_err(adreno_dev->dev.dev,
		"GMU fenced register write timed out: reg 0x%x\n", reg_offset);
		"Timed out waiting %d usecs to write fenced register 0x%x\n",
		GMU_CORE_LONG_WAKEUP_RETRY_LIMIT * GMU_CORE_WAKEUP_DELAY_US,
		reg_offset);
	return -ETIMEDOUT;
}

+9 −2
Original line number Diff line number Diff line
@@ -100,8 +100,15 @@ enum gpu_idle_level {
 * the GMU will start shutting down before we try again.
 */
#define GMU_CORE_WAKEUP_DELAY_US 10
/* Max amount of tries to wake up the GMU. */
#define GMU_CORE_WAKEUP_RETRY_MAX 60

/* Max amount of tries to wake up the GMU. The short retry
 * limit is half of the long retry limit. After the short
 * number of retries, we print an informational message to say
 * exiting IFPC is taking longer than expected. We continue
 * to retry after this until the long retry limit.
 */
#define GMU_CORE_SHORT_WAKEUP_RETRY_LIMIT 100
#define GMU_CORE_LONG_WAKEUP_RETRY_LIMIT 200

#define FENCE_STATUS_WRITEDROPPED0_MASK 0x1
#define FENCE_STATUS_WRITEDROPPED1_MASK 0x2