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

Commit 71a815d0 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Clean up error paths in KGSL/Adreno snapshot



We make our best effort in the GPU snapshot code but errors are not
fatal. We need to recover cleanly from errors but we don't need to
pass them around. Clean up and simplify the return paths.

Change-Id: Ic0dedbad7d3228aac428d7755e2e4b929f684ace
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 6a2945a9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -583,7 +583,7 @@ void kgsl_device_platform_remove(struct kgsl_device *device);
const char *kgsl_pwrstate_to_str(unsigned int state);

int kgsl_device_snapshot_init(struct kgsl_device *device);
int kgsl_device_snapshot(struct kgsl_device *device,
void kgsl_device_snapshot(struct kgsl_device *device,
			struct kgsl_context *context);
void kgsl_device_snapshot_close(struct kgsl_device *device);
void kgsl_snapshot_save_frozen_objs(struct work_struct *work);
+6 −10
Original line number Diff line number Diff line
@@ -646,19 +646,18 @@ void kgsl_snapshot_add_section(struct kgsl_device *device, u16 id,
 * Given a device, construct a binary snapshot dump of the current device state
 * and store it in the device snapshot memory.
 */
int kgsl_device_snapshot(struct kgsl_device *device,
void kgsl_device_snapshot(struct kgsl_device *device,
		struct kgsl_context *context)
{
	struct kgsl_snapshot_header *header = device->snapshot_memory.ptr;
	struct kgsl_snapshot *snapshot;
	struct timespec boot;
	int ret = 0;
	phys_addr_t pa;

	if (device->snapshot_memory.ptr == NULL) {
		KGSL_DRV_ERR(device,
			"snapshot: no snapshot memory available\n");
		return -ENOMEM;
		return;
	}

	BUG_ON(!kgsl_state_is_awake(device));
@@ -670,14 +669,13 @@ int kgsl_device_snapshot(struct kgsl_device *device,
	 * a new snapshot instance if the old one hasn't been grabbed yet
	 */
	if (device->snapshot != NULL)
		goto done;
		return;

	/* Allocate memory for the snapshot instance */
	snapshot = kzalloc(sizeof(*snapshot), GFP_KERNEL);
	if (snapshot == NULL) {
		ret = -ENOMEM;
		goto done;
	}
	if (snapshot == NULL)
		return;

	init_completion(&snapshot->dump_gate);
	INIT_LIST_HEAD(&snapshot->obj_list);
	INIT_LIST_HEAD(&snapshot->cp_list);
@@ -729,8 +727,6 @@ int kgsl_device_snapshot(struct kgsl_device *device,
	 *
	 */
	queue_work(device->work_queue, &snapshot->work);
done:
	return ret;
}
EXPORT_SYMBOL(kgsl_device_snapshot);