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

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

Merge "msm: kgsl: Correct snapshot over-write policy"

parents dc8ae713 d61c196f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2074,6 +2074,14 @@ static int _adreno_start(struct adreno_device *adreno_dev)
	if (status)
		goto error_oob_clear;

	/*
	 * At this point it is safe to assume that we recovered. Setting
	 * this field allows us to take a new snapshot for the next failure
	 * if we are prioritizing the first unrecoverable snapshot.
	 */
	if (device->snapshot)
		device->snapshot->recovered = true;

	/* Start the dispatcher */
	adreno_dispatcher_start(device);

+0 −8
Original line number Diff line number Diff line
@@ -2225,14 +2225,6 @@ static int dispatcher_do_fault(struct adreno_device *adreno_dev)

	atomic_add(halt, &adreno_dev->halt);

	/*
	 * At this point it is safe to assume that we recovered. Setting
	 * this field allows us to take a new snapshot for the next failure
	 * if we are prioritizing the first unrecoverable snapshot.
	 */
	if (device->snapshot)
		device->snapshot->recovered = true;

	return 1;
}

+20 −8
Original line number Diff line number Diff line
@@ -628,14 +628,20 @@ void kgsl_device_snapshot(struct kgsl_device *device,
	/* increment the hang count for good book keeping */
	device->snapshot_faultcount++;

	if (device->snapshot != NULL) {

		/*
	 * Overwrite a fault snapshot only if GMU is
	 * enabled and we managed to recover from it.
		 * Snapshot over-write policy:
		 * 1. By default, don't over-write the very first snapshot,
		 *    be it a gmu or gpu fault.
		 * 2. Never over-write existing snapshot on a gpu fault.
		 * 3. Never over-write a snapshot that we didn't recover from.
		 * 4. In order to over-write a new gmu fault snapshot with a
		 *    previously recovered fault, then set the sysfs knob
		 *    prioritize_recoverable to true.
		 */
	if (device->snapshot != NULL) {
		if (!gmu_core_gpmu_isenabled(device) ||
			!device->prioritize_unrecoverable ||
				!device->snapshot->recovered)
		if (!device->prioritize_unrecoverable ||
			!device->snapshot->recovered || !gmu_fault)
			return;

		/*
@@ -1083,10 +1089,16 @@ int kgsl_device_snapshot_init(struct kgsl_device *device)
	device->snapshot = NULL;
	device->snapshot_faultcount = 0;
	device->force_panic = false;
	device->prioritize_unrecoverable = true;
	device->snapshot_crashdumper = true;
	device->snapshot_legacy = false;

	/*
	 * Set this to false so that we only ever keep the first snapshot around
	 * If we want to over-write with a gmu snapshot, then set it to true
	 * via sysfs
	 */
	device->prioritize_unrecoverable = false;

	ret = kobject_init_and_add(&device->snapshot_kobj, &ktype_snapshot,
		&device->dev->kobj, "snapshot");
	if (ret)