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

Commit e7427b39 authored by Hareesh Gundu's avatar Hareesh Gundu
Browse files

msm: kgsl: Dump always on counter on hfi timeout



Dump always on counter value before and after hfi
wait response to correlate with GMU logs.

Change-Id: If0408818d611b63c9ebfeada53c07d3c0635a4e4
Signed-off-by: default avatarHareesh Gundu <hareeshg@codeaurora.org>
parent f8b00cea
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/delay.h>
@@ -268,9 +268,9 @@ static int poll_adreno_gmu_reg(struct adreno_device *adreno_dev,
	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;
	u64 ts1, ts2;

	ao_pre_poll = gmu_core_dev_read_ao_counter(device);
	ts1 = gmu_core_dev_read_ao_counter(device);

	while (time_is_after_jiffies(timeout)) {
		adreno_read_gmureg(adreno_dev, offset_name, &val);
@@ -279,15 +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);
	ts2 = 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));
	dev_err(&gmu->pdev->dev,
			"Timed out waiting for HFI response. Wait start=%llx end=%llx\n",
			ts1, ts2);

	return -ETIMEDOUT;
}