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

Commit 32f5d164 authored by Shubhraprakash Das's avatar Shubhraprakash Das
Browse files

msm: kgsl: Dump snapshot on device start failure



If device start fails due to bootstrap or due to ME init
then dump the snapshot. The snapshot can be used to debug
the root cause of failure.

Change-Id: Ib3d4f4c6a698f56e426d8ae5a994dc40f705561b
CRs-Fixed: 781244
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
parent 18c43109
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
/* Copyright (c) 2002,2007-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1096,6 +1096,9 @@ static int _adreno_start(struct adreno_device *adreno_dev)
	unsigned int pmqos_wakeup_vote = device->pwrctrl.pm_qos_wakeup_latency;
	unsigned int pmqos_active_vote = device->pwrctrl.pm_qos_active_latency;

	/* make sure ADRENO_DEVICE_STARTED is not set here */
	BUG_ON(test_bit(ADRENO_DEVICE_STARTED, &adreno_dev->priv));

	pm_qos_update_request(&device->pwrctrl.pm_qos_req_dma,
			pmqos_wakeup_vote);

@@ -1168,7 +1171,10 @@ static int _adreno_start(struct adreno_device *adreno_dev)
	kgsl_pwrctrl_irq(device, KGSL_PWRFLAGS_ON);
	adreno_irqctrl(adreno_dev, 1);

	adreno_perfcounter_start(adreno_dev);
	status = adreno_perfcounter_start(adreno_dev);

	if (status)
		goto error_irq_off;

	status = adreno_ringbuffer_cold_start(adreno_dev);

+5 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1065,6 +1065,10 @@ int a3xx_perfcounter_enable(struct adreno_device *adreno_dev,
		/* wait for the above commands submitted to complete */
		ret = adreno_ringbuffer_waittimestamp(rb, rb->timestamp,
				ADRENO_IDLE_TIMEOUT);
		if (ret)
			KGSL_DRV_ERR(rb->device,
			"Perfcounter %u/%u/%u start via commands failed %d\n",
			group, counter, countable, ret);
	} else {
		/* Select the desired perfcounter */
		kgsl_regwrite(&adreno_dev->dev, reg->select, countable);
+14 −2
Original line number Diff line number Diff line
/* Copyright (c) 2002,2007-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -477,6 +477,12 @@ static int _ringbuffer_bootstrap_ucode(struct adreno_ringbuffer *rb,
	/* idle device to validate bootstrap */
	ret = adreno_spin_idle(device);

	if (ret) {
		KGSL_DRV_ERR(rb->device,
		"microcode bootstrap failed to idle\n");
		kgsl_device_snapshot(device, NULL);
	}

	/* Clear the chicken bit for speed up on A430 cores */
	if (adreno_is_a430(adreno_dev))
		kgsl_regwrite(device, A4XX_CP_DEBUG,
@@ -551,7 +557,13 @@ static int _ringbuffer_start_common(struct adreno_ringbuffer *rb)
		return status;

	/* idle device to validate ME INIT */
	return adreno_spin_idle(device);
	status = adreno_spin_idle(device);
	if (status) {
		KGSL_DRV_ERR(rb->device,
		"ringbuffer initialization failed to idle\n");
		kgsl_device_snapshot(device, NULL);
	}
	return status;
}

/**