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

Commit cbb23004 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Separate out reset sequence for a6xx gmu targets



Now that we have a6xx gmu specific gpudev, we can dissociate the
gmu reset sequence from the generic a6xx_reset function.

Change-Id: Ib56456d5390fc059fc34407941f805c06cdfe42a
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent 8508ab42
Loading
Loading
Loading
Loading
+4 −12
Original line number Diff line number Diff line
@@ -1080,22 +1080,14 @@ static int64_t a6xx_read_throttling_counters(struct adreno_device *adreno_dev)
 * a6xx_reset() - Helper function to reset the GPU
 * @device: Pointer to the KGSL device structure for the GPU
 *
 * Try to reset the GPU to recover from a fault.  First, try to do a low latency
 * soft reset.  If the soft reset fails for some reason, then bring out the big
 * guns and toggle the footswitch.
 * Try to reset the GPU to recover from a fault for targets without
 * a GMU.
 */
static int a6xx_reset(struct kgsl_device *device)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	int ret;

	/*
	 * GMU devices transition to KGSL_STATE_RESET, non GMU devices go
	 * directly to KGSL_STATE_INIT
	 */
	if (gmu_core_isenabled(device))
		kgsl_pwrctrl_change_state(device, KGSL_STATE_RESET);
	else
	kgsl_pwrctrl_change_state(device, KGSL_STATE_INIT);

	/* since device is officially off now clear start bit */
@@ -2702,7 +2694,7 @@ struct adreno_gpudev adreno_a6xx_gmu_gpudev = {
	.gpu_keepalive = a6xx_gpu_keepalive,
	.hw_isidle = a6xx_hw_isidle,
	.iommu_fault_block = a6xx_iommu_fault_block,
	.reset = a6xx_reset,
	.reset = a6xx_gmu_restart,
	.preemption_pre_ibsubmit = a6xx_preemption_pre_ibsubmit,
	.preemption_post_ibsubmit = a6xx_preemption_post_ibsubmit,
	.preemption_init = a6xx_preemption_init,
+30 −6
Original line number Diff line number Diff line
@@ -2098,12 +2098,15 @@ static int a6xx_gmu_first_boot(struct adreno_device *adreno_dev)

	icc_set_bw(pwr->icc_path, 0, 0);

	gmu->fault = false;

	return 0;

err:
	if (gmu->fault) {
		a6xx_gmu_suspend(adreno_dev);

		return ret;
	}

clks_gdsc_off:
	clk_bulk_disable_unprepare(gmu->num_clks, gmu->clks);
@@ -2168,12 +2171,15 @@ static int a6xx_gmu_boot(struct adreno_device *adreno_dev)
	if (ret)
		goto err;

	gmu->fault = false;

	return 0;

err:
	if (gmu->fault) {
		a6xx_gmu_suspend(adreno_dev);

		return ret;
	}

clks_gdsc_off:
	clk_bulk_disable_unprepare(gmu->num_clks, gmu->clks);
@@ -3144,6 +3150,24 @@ int a6xx_gmu_device_probe(struct platform_device *pdev,
	return 0;
}

int a6xx_gmu_restart(struct kgsl_device *device)
{
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	struct a6xx_gmu_device *gmu = to_a6xx_gmu(adreno_dev);

	a6xx_hfi_stop(adreno_dev);

	disable_gpu_irq(adreno_dev);

	/* Hard reset the gmu and gpu */
	a6xx_gmu_suspend(adreno_dev);

	clear_bit(GMU_PRIV_GPU_STARTED, &gmu->flags);

	/* Attempt to reboot the gmu and gpu */
	return a6xx_boot(adreno_dev);
}

static int a6xx_gmu_bind(struct device *dev, struct device *master, void *data)
{
	struct kgsl_device *device = dev_get_drvdata(master);
+8 −0
Original line number Diff line number Diff line
@@ -266,4 +266,12 @@ void a6xx_gmu_device_snapshot(struct kgsl_device *device,
 */
int a6xx_gmu_device_probe(struct platform_device *pdev,
	u32 chipid, const struct adreno_gpu_core *gpucore);

/**
 * a6xx_gmu_restart - Reset and restart the gmu
 * @device: Pointer to the kgsl device
 *
 * Return: 0 on success or negative error on failure
 */
int a6xx_gmu_restart(struct kgsl_device *device);
#endif