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: Hui Li <hul@codeaurora.org>
This commit is contained in:
Hui Li 2020-07-15 11:28:34 +08:00
commit f7cdc2d4bf
3 changed files with 5 additions and 3 deletions

View file

@ -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,

View file

@ -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;
}

View file

@ -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;