diff options
| author | Leon Yu <leoyu@nvidia.com> | 2019-08-15 06:12:18 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2020-01-22 12:10:07 -0500 |
| commit | dcf5893a70a79e60c57f492fbc7fc8a8e4b08c3a (patch) | |
| tree | 6270de33d81fec149e2478e71258b5621570c918 /drivers/cpufreq | |
| parent | 86afc0d908f12a4f68c5d2c86d5f5202f8646bb9 (diff) | |
cpufreq: tegra186: fix hv mode error path
If tegra_cpufreq_hv_mode is true and parse_hv_dt_data fails, we
shouldn't go to err_free_res as platform resources are not
allocated/mapped in case of hv mode. Also, we have not reached to the
point to register_with_emc_bwmgr or get_lut_from_bpmp, so branching to
err_free_res and ending up calling free_resources as well as
free_shared_lut is incorrect.
Bug 200512604
Change-Id: Ifb30e44c67b9eef22d2ef2e46fac33da7df5dc13
Signed-off-by: Leon Yu <leoyu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2275514
GVS: Gerrit_Virtual_Submit
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
Reviewed-by: Puneet Saxena <puneets@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/cpufreq')
| -rw-r--r-- | drivers/cpufreq/tegra_cpufreq.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/cpufreq/tegra_cpufreq.c b/drivers/cpufreq/tegra_cpufreq.c index 05e82c087..69f512c5c 100644 --- a/drivers/cpufreq/tegra_cpufreq.c +++ b/drivers/cpufreq/tegra_cpufreq.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2015-2020, NVIDIA CORPORATION. All rights reserved. |
| 3 | * | 3 | * |
| 4 | * This software is licensed under the terms of the GNU General Public | 4 | * This software is licensed under the terms of the GNU General Public |
| 5 | * License version 2, as published by the Free Software Foundation, and | 5 | * License version 2, as published by the Free Software Foundation, and |
| @@ -1324,6 +1324,9 @@ static int __init tegra186_cpufreq_probe(struct platform_device *pdev) | |||
| 1324 | if (of_device_is_compatible(dn, "nvidia,tegra18x-cpufreq-hv")) { | 1324 | if (of_device_is_compatible(dn, "nvidia,tegra18x-cpufreq-hv")) { |
| 1325 | tegra_cpufreq_hv_mode = true; | 1325 | tegra_cpufreq_hv_mode = true; |
| 1326 | pr_info("tegra18x-cpufreq: Using hv path\n"); | 1326 | pr_info("tegra18x-cpufreq: Using hv path\n"); |
| 1327 | ret = parse_hv_dt_data(dn); | ||
| 1328 | if (ret) | ||
| 1329 | goto err_out; | ||
| 1327 | } else { | 1330 | } else { |
| 1328 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1331 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 1329 | regs = devm_ioremap_resource(&pdev->dev, res); | 1332 | regs = devm_ioremap_resource(&pdev->dev, res); |
| @@ -1344,11 +1347,6 @@ static int __init tegra186_cpufreq_probe(struct platform_device *pdev) | |||
| 1344 | spin_lock_init(&per_cpu(pcpu_slock, cpu)); | 1347 | spin_lock_init(&per_cpu(pcpu_slock, cpu)); |
| 1345 | } | 1348 | } |
| 1346 | 1349 | ||
| 1347 | if (tegra_cpufreq_hv_mode) { | ||
| 1348 | ret = parse_hv_dt_data(dn); | ||
| 1349 | if (ret) | ||
| 1350 | goto err_free_res; | ||
| 1351 | } | ||
| 1352 | tfreq_data.pcluster[B_CLUSTER].cluster_present = false; | 1350 | tfreq_data.pcluster[B_CLUSTER].cluster_present = false; |
| 1353 | tfreq_data.pcluster[M_CLUSTER].cluster_present = false; | 1351 | tfreq_data.pcluster[M_CLUSTER].cluster_present = false; |
| 1354 | for_each_possible_cpu(cpu) { | 1352 | for_each_possible_cpu(cpu) { |
