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

Commit f7cdc2d4 authored by Hui Li's avatar Hui Li
Browse files

msm: kgsl: fix a condition error and set L3 clock rate fail



Fix a condition error in gmu_enable_clks, if there is no hub_clk
exists, the return value should be -ENODEV.
There will be an set L3 clock failure while kgsl power disable,
we should set L3 clock to NULL while there is no l3_vote clock
exists:
[   13.076919] Call trace:
[   13.079430]  clk_set_rate+0x78/0x140
[   13.083103]  kgsl_pwrctrl_disable+0x20/0x270
[   13.087491]  _slumber+0x24c/0x280
[   13.090893]  kgsl_pwrctrl_change_state+0x384/0x640

Change-Id: I492ce86908ade3daba526f8c3d269ba05c07e2aa
Signed-off-by: default avatarHui Li <hul@codeaurora.org>
parent 6c24075f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1023,9 +1023,11 @@ l3_pwrlevel_probe(struct kgsl_device *device, struct device_node *node)

	device->l3_clk = devm_clk_get(&device->pdev->dev, "l3_vote");

	if (IS_ERR_OR_NULL(device->l3_clk))
	if (IS_ERR_OR_NULL(device->l3_clk)) {
		dev_err(&device->pdev->dev,
			"Unable to get the l3_vote clock\n");
		device->l3_clk = NULL;
	}
}

static int adreno_of_get_power(struct adreno_device *adreno_dev,
+1 −1
Original line number Diff line number Diff line
@@ -2062,7 +2062,7 @@ static int a6xx_gmu_enable_clks(struct adreno_device *adreno_dev)
	}

	ret = a6xx_gmu_clk_set_rate(gmu, "hub_clk", 150000000);
	if (ret && ret != ENODEV) {
	if (ret && ret != -ENODEV) {
		dev_err(&gmu->pdev->dev, "Unable to set the HUB clock\n");
		return ret;
	}
+1 −1
Original line number Diff line number Diff line
@@ -753,7 +753,7 @@ static void adreno_ringbuffer_set_constraint(struct kgsl_device *device,
		((context->flags & KGSL_CONTEXT_PWR_CONSTRAINT) ||
			(flags & KGSL_CONTEXT_PWR_CONSTRAINT))) {

		if (IS_ERR_OR_NULL(device->l3_clk)) {
		if (device->l3_clk == NULL) {
			dev_err_once(device->dev,
				"l3_vote clk not available\n");
			return;