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

Commit 99effffc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Prevent recursion when dumping sync fence logs"

parents 09eee90e 34e2ed51
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -77,6 +77,13 @@ void adreno_drawctxt_dump(struct kgsl_device *device,
		struct kgsl_cmdbatch *cmdbatch =
			drawctxt->cmdqueue[drawctxt->cmdqueue_head];

		if (test_bit(CMDBATCH_FLAG_FENCE_LOG, &cmdbatch->priv)) {
			dev_err(device->dev,
				"  possible deadlock. Context %d might be blocked for itself\n",
				context->id);
			goto stats;
		}

		spin_lock(&cmdbatch->lock);

		if (!list_empty(&cmdbatch->synclist)) {
@@ -89,6 +96,7 @@ void adreno_drawctxt_dump(struct kgsl_device *device,
		spin_unlock(&cmdbatch->lock);
	}

stats:
	memset(buf, 0, sizeof(buf));

	pos = 0;
+6 −2
Original line number Diff line number Diff line
@@ -1573,9 +1573,13 @@ static void _kgsl_cmdbatch_timer(unsigned long data)
			break;
		}
		case KGSL_CMD_SYNCPOINT_TYPE_FENCE:
			if (event->handle && event->handle->fence)
			if (event->handle && event->handle->fence) {
				set_bit(CMDBATCH_FLAG_FENCE_LOG,
					&cmdbatch->priv);
				sync_fence_log(event->handle->fence);
			else
				clear_bit(CMDBATCH_FLAG_FENCE_LOG,
					&cmdbatch->priv);
			} else
				dev_err(device->dev, "  fence: invalid\n");
			break;
		}
+3 −0
Original line number Diff line number Diff line
@@ -295,6 +295,8 @@ struct kgsl_cmdbatch_sync_event {
 * @CMDBATCH_FLAG_WFI - Force wait-for-idle for the submission
 * @CMDBATCH_FLAG_PROFILE - store the start / retire ticks for the command batch
 * in the profiling buffer
 * @CMDBATCH_FLAG_FENCE_LOG - Set if the cmdbatch is dumping fence logs via the
 * cmdbatch timer - this is used to avoid recursion
 */

enum kgsl_cmdbatch_priv {
@@ -302,6 +304,7 @@ enum kgsl_cmdbatch_priv {
	CMDBATCH_FLAG_FORCE_PREAMBLE,
	CMDBATCH_FLAG_WFI,
	CMDBATCH_FLAG_PROFILE,
	CMDBATCH_FLAG_FENCE_LOG,
};

struct kgsl_device {