soc/tegra: Changes for v5.11-rc1

This contains a couple of warning fixes and a fix for a mostly harmless
 bug in the process ID retrieval code.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAl/BDZMTHHRyZWRpbmdA
 bnZpZGlhLmNvbQAKCRDdI6zXfz6zoZ2DD/96vxktcIs6aXtVZlQY3dehuxCTs0s3
 sut/qnctkvccwrnCtsJz1NtWjHupnJIFbuGxpLD5II9TIuas81XJUxfY1GCEsuDx
 fVPJybDL/mDIwK+8SNwcYgvkwDO/Fl2IboRCM3Wc2VceCGAlAlum8NJeO5dMP29k
 OTt0ui+kC8N5MyxsMngtNVsSe67GI6v6cxTC3OTcBSsPqcrb0eW4T6uEXMy69z66
 J/fujbZ4rPI5iHn78zrte8P/oJNet7JHCjnsNcTZUf5St8hZqTDCoObNCz87DpNQ
 2LvJcE/WLW/JnVaZag1z3xdDEygHJYWf/kFsuDKonzPXHVkSiywKuvt/wu/zE3OS
 SCtQz4dHCNoGzLu6t82FG14Gy/Bn3Z5qHN/YuMhKIynCdp5OUyTJKQhzyPkaMQ7w
 pdZNisxIuCI0nBDMr3TGRigYUI5j3RBzcvRwFlmJM5QtrveyQAkmGFcnspCNJXDL
 KZV0OHklesZs5bFE2c7RPZS4zPmz+x/MWruV0S53R33kYh2+5xK+XKwHj2MHwyY4
 hUhe4vkuKAbpZ+l3FJ9LEEBya5IQ9lqbAtbG0FDmX8klsJRvoVZKua0lTG0JOMDn
 VBJYk4hiMH3QoipqgA+45EDGcKkOQxFvkuUD8K+UZGFe2eCtbAFk7oCEAa9US6/T
 vQFre0gnefKkqg==
 =mYgF
 -----END PGP SIGNATURE-----

Merge tag 'tegra-for-5.11-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers

soc/tegra: Changes for v5.11-rc1

This contains a couple of warning fixes and a fix for a mostly harmless
bug in the process ID retrieval code.

* tag 'tegra-for-5.11-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  soc/tegra: fuse: Fix index bug in get_process_id
  soc: tegra: fuse: speedo-tegra210: Remove a group of set but unused variables
  soc: tegra: fuse: speedo-tegra124: Remove some set but unused variables

Link: https://lore.kernel.org/r/20201127144329.124891-2-thierry.reding@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Arnd Bergmann 2020-11-27 17:56:09 +01:00
commit 3afd2823c1
2 changed files with 8 additions and 21 deletions

View File

@ -101,8 +101,7 @@ static void __init rev_sku_to_speedo_ids(struct tegra_sku_info *sku_info,
void __init tegra124_init_speedo_data(struct tegra_sku_info *sku_info)
{
int i, threshold, cpu_speedo_0_value, soc_speedo_0_value;
int cpu_iddq_value, gpu_iddq_value, soc_iddq_value;
int i, threshold, soc_speedo_0_value;
BUILD_BUG_ON(ARRAY_SIZE(cpu_process_speedos) !=
THRESHOLD_INDEX_COUNT);
@ -111,25 +110,17 @@ void __init tegra124_init_speedo_data(struct tegra_sku_info *sku_info)
BUILD_BUG_ON(ARRAY_SIZE(soc_process_speedos) !=
THRESHOLD_INDEX_COUNT);
cpu_speedo_0_value = tegra_fuse_read_early(FUSE_CPU_SPEEDO_0);
/* GPU Speedo is stored in CPU_SPEEDO_2 */
sku_info->gpu_speedo_value = tegra_fuse_read_early(FUSE_CPU_SPEEDO_2);
soc_speedo_0_value = tegra_fuse_read_early(FUSE_SOC_SPEEDO_0);
cpu_iddq_value = tegra_fuse_read_early(FUSE_CPU_IDDQ);
soc_iddq_value = tegra_fuse_read_early(FUSE_SOC_IDDQ);
gpu_iddq_value = tegra_fuse_read_early(FUSE_GPU_IDDQ);
sku_info->cpu_speedo_value = cpu_speedo_0_value;
sku_info->cpu_speedo_value = tegra_fuse_read_early(FUSE_CPU_SPEEDO_0);
if (sku_info->cpu_speedo_value == 0) {
pr_warn("Tegra Warning: Speedo value not fused.\n");
WARN_ON(1);
return;
}
/* GPU Speedo is stored in CPU_SPEEDO_2 */
sku_info->gpu_speedo_value = tegra_fuse_read_early(FUSE_CPU_SPEEDO_2);
soc_speedo_0_value = tegra_fuse_read_early(FUSE_SOC_SPEEDO_0);
rev_sku_to_speedo_ids(sku_info, &threshold);
sku_info->cpu_iddq_value = tegra_fuse_read_early(FUSE_CPU_IDDQ);

View File

@ -94,7 +94,7 @@ static int get_process_id(int value, const u32 *speedos, unsigned int num)
unsigned int i;
for (i = 0; i < num; i++)
if (value < speedos[num])
if (value < speedos[i])
return i;
return -EINVAL;
@ -102,7 +102,7 @@ static int get_process_id(int value, const u32 *speedos, unsigned int num)
void __init tegra210_init_speedo_data(struct tegra_sku_info *sku_info)
{
int cpu_speedo[3], soc_speedo[3], cpu_iddq, gpu_iddq, soc_iddq;
int cpu_speedo[3], soc_speedo[3];
unsigned int index;
u8 speedo_revision;
@ -122,10 +122,6 @@ void __init tegra210_init_speedo_data(struct tegra_sku_info *sku_info)
soc_speedo[1] = tegra_fuse_read_early(FUSE_SOC_SPEEDO_1);
soc_speedo[2] = tegra_fuse_read_early(FUSE_SOC_SPEEDO_2);
cpu_iddq = tegra_fuse_read_early(FUSE_CPU_IDDQ) * 4;
soc_iddq = tegra_fuse_read_early(FUSE_SOC_IDDQ) * 4;
gpu_iddq = tegra_fuse_read_early(FUSE_GPU_IDDQ) * 5;
/*
* Determine CPU, GPU and SoC speedo values depending on speedo fusing
* revision. Note that GPU speedo value is fused in CPU_SPEEDO_2.