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

Commit d35aafe6 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt Committed by Jordan Crouse
Browse files

msm: kgsl: log debug info to help detect syncpoint deadlock



Dump sync fence info of a fence for which a KGSL context is waiting
for more than 5 seconds. This info will help detect if there is
a possible gpu syncpoint deadlock.

Change-Id: I53282ce08e716cfdb44ca448f880e84816dc4ded
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent f290ff66
Loading
Loading
Loading
Loading
+25 −1
Original line number Diff line number Diff line
@@ -1541,6 +1541,7 @@ static void _kgsl_cmdbatch_timer(unsigned long data)
{
	struct kgsl_device *device;
	struct kgsl_cmdbatch *cmdbatch = (struct kgsl_cmdbatch *) data;
	struct kgsl_cmdbatch_sync_event *event;

	if (cmdbatch == NULL || cmdbatch->context == NULL)
		return;
@@ -1556,7 +1557,30 @@ static void _kgsl_cmdbatch_timer(unsigned long data)
		cmdbatch->context->id, cmdbatch->timestamp);
	dev_err(device->dev, " Active sync points:\n");

	kgsl_dump_syncpoints(device, cmdbatch);
	/* Print all the pending sync objects */
	list_for_each_entry(event, &cmdbatch->synclist, node) {
		switch (event->type) {
		case KGSL_CMD_SYNCPOINT_TYPE_TIMESTAMP: {
			unsigned int retired;

			kgsl_readtimestamp(event->device,
				event->context, KGSL_TIMESTAMP_RETIRED,
					&retired);

			dev_err(device->dev,
				"  [timestamp] context %d timestamp %d (retired %d)\n",
				event->context->id, event->timestamp, retired);
			break;
		}
		case KGSL_CMD_SYNCPOINT_TYPE_FENCE:
			if (event->handle && event->handle->fence)
				sync_fence_log(event->handle->fence);
			else
				dev_err(device->dev, "  fence: invalid\n");
			break;
		}
	}

done:
	spin_unlock(&cmdbatch->lock);
}