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

Commit 0fb88347 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Print always on counters if HFI timed out"

parents f08e34e4 0ca3c71c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -265,7 +265,12 @@ static int poll_adreno_gmu_reg(struct adreno_device *adreno_dev,
	unsigned int mask, unsigned int timeout_ms)
{
	unsigned int val;
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct gmu_device *gmu = KGSL_GMU_DEVICE(device);
	unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
	u64 ao_pre_poll, ao_post_poll;

	ao_pre_poll = gmu_core_dev_read_ao_counter(device);

	while (time_is_after_jiffies(timeout)) {
		adreno_read_gmureg(adreno_dev, offset_name, &val);
@@ -274,11 +279,16 @@ static int poll_adreno_gmu_reg(struct adreno_device *adreno_dev,
		usleep_range(10, 100);
	}

	ao_post_poll = gmu_core_dev_read_ao_counter(device);

	/* Check one last time */
	adreno_read_gmureg(adreno_dev, offset_name, &val);
	if ((val & mask) == expected_val)
		return 0;

	dev_err(&gmu->pdev->dev, "kgsl hfi poll timeout: always on: %lld ms\n",
		div_u64((ao_post_poll - ao_pre_poll) * 52, USEC_PER_SEC));

	return -ETIMEDOUT;
}