On 10/21/2025 7:45 PM, Dan Carpenter wrote:
> Hi Akhil,
>
> kernel test robot noticed the following build warnings:
>
> url:
> https://github.com/intel-lab-lkp/linux/commits/Akhil-P-Oommen/drm-msm-a6xx-Add-support-for-Adreno-612/20251018-011020
> base: cb6649f6217c0331b885cf787f1d175963e2a1d2
> patch link:
> https://lore.kernel.org/r/20251017-qcs615-spin-2-v1-1-0baa44f80905%40oss.qualcomm.com
> patch subject: [PATCH 1/6] drm/msm/a6xx: Add support for Adreno 612
> config: powerpc-randconfig-r073-20251021
> (https://download.01.org/0day-ci/archive/20251021/[email protected]/config)
> compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project
> 7cbf1a2591520c2491aa35339f227775f4d3adf6)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version
> of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <[email protected]>
> | Reported-by: Dan Carpenter <[email protected]>
> | Closes: https://lore.kernel.org/r/[email protected]/
>
> smatch warnings:
> drivers/gpu/drm/msm/adreno/a6xx_gpu.c:641 a6xx_set_hwcg() error:
> uninitialized symbol 'cgc_hyst'.
>
> vim +/cgc_hyst +641 drivers/gpu/drm/msm/adreno/a6xx_gpu.c
>
> 4b565ca5a2cbbbb Jordan Crouse 2018-08-06 600 static void
> a6xx_set_hwcg(struct msm_gpu *gpu, bool state)
> 4b565ca5a2cbbbb Jordan Crouse 2018-08-06 601 {
> 4b565ca5a2cbbbb Jordan Crouse 2018-08-06 602 struct adreno_gpu
> *adreno_gpu = to_adreno_gpu(gpu);
> 4b565ca5a2cbbbb Jordan Crouse 2018-08-06 603 struct a6xx_gpu
> *a6xx_gpu = to_a6xx_gpu(adreno_gpu);
> 4b565ca5a2cbbbb Jordan Crouse 2018-08-06 604 struct a6xx_gmu *gmu =
> &a6xx_gpu->gmu;
> b1c53a2a2d395d4 Jonathan Marek 2020-07-10 605 const struct
> adreno_reglist *reg;
> 4b565ca5a2cbbbb Jordan Crouse 2018-08-06 606 unsigned int i;
> 40c297eb245b1c9 Konrad Dybcio 2024-08-28 607 u32 cgc_delay, cgc_hyst;
> 51682bc4abf4b55 Konrad Dybcio 2024-08-28 608 u32 val, clock_cntl_on;
> 4b565ca5a2cbbbb Jordan Crouse 2018-08-06 609
> dff2f69f3e8a6ea Rob Clark 2024-06-18 610 if
> (!(adreno_gpu->info->a6xx->hwcg || adreno_is_a7xx(adreno_gpu)))
> b1c53a2a2d395d4 Jonathan Marek 2020-07-10 611 return;
> b1c53a2a2d395d4 Jonathan Marek 2020-07-10 612
> 66ffb9150b00f3f Jonathan Marek 2020-07-10 613 if
> (adreno_is_a630(adreno_gpu))
> 66ffb9150b00f3f Jonathan Marek 2020-07-10 614 clock_cntl_on =
> 0x8aa8aa02;
> 5cb9695ccef2305 Jie Zhang 2025-10-17 615 else if
> (adreno_is_a610(adreno_gpu) || adreno_is_a612(adreno_gpu))
> e7fc9398e608a7b Konrad Dybcio 2023-06-16 616 clock_cntl_on =
> 0xaaa8aa82;
> 18397519cb62248 Konrad Dybcio 2024-02-23 617 else if
> (adreno_is_a702(adreno_gpu))
> 18397519cb62248 Konrad Dybcio 2024-02-23 618 clock_cntl_on =
> 0xaaaaaa82;
> 66ffb9150b00f3f Jonathan Marek 2020-07-10 619 else
> 66ffb9150b00f3f Jonathan Marek 2020-07-10 620 clock_cntl_on =
> 0x8aa8aa82;
> 66ffb9150b00f3f Jonathan Marek 2020-07-10 621
> 5cb9695ccef2305 Jie Zhang 2025-10-17 622 if
> (adreno_is_a612(adreno_gpu))
> 5cb9695ccef2305 Jie Zhang 2025-10-17 623 cgc_delay =
> 0x11;
> 5cb9695ccef2305 Jie Zhang 2025-10-17 624 else if
> (adreno_is_a615_family(adreno_gpu))
> 5cb9695ccef2305 Jie Zhang 2025-10-17 625 cgc_delay =
> 0x111;
> 5cb9695ccef2305 Jie Zhang 2025-10-17 626 else
> 5cb9695ccef2305 Jie Zhang 2025-10-17 627 cgc_delay =
> 0x10111;
> 5cb9695ccef2305 Jie Zhang 2025-10-17 628
> 5cb9695ccef2305 Jie Zhang 2025-10-17 629 if
> (adreno_is_a612(adreno_gpu))
> 5cb9695ccef2305 Jie Zhang 2025-10-17 630 cgc_hyst = 0x55;
>
> Only initialized here and not on other paths.
>
> 5cb9695ccef2305 Jie Zhang 2025-10-17 631 else if
> (adreno_is_a615_family(adreno_gpu))
> 5cb9695ccef2305 Jie Zhang 2025-10-17 632 cgc_delay =
> 0x555;
> 5cb9695ccef2305 Jie Zhang 2025-10-17 633 else
> 5cb9695ccef2305 Jie Zhang 2025-10-17 634 cgc_delay =
> 0x5555;
Aah! Looks like there is a copy-paste bug that missed my eyes. Thanks.
-Akhil
> 40c297eb245b1c9 Konrad Dybcio 2024-08-28 635
> af66706accdf5af Konrad Dybcio 2023-09-25 636
> gmu_write(&a6xx_gpu->gmu, REG_A6XX_GPU_GMU_AO_GMU_CGC_MODE_CNTL,
> 51682bc4abf4b55 Konrad Dybcio 2024-08-28 637 state ?
> adreno_gpu->info->a6xx->gmu_cgc_mode : 0);
> af66706accdf5af Konrad Dybcio 2023-09-25 638
> gmu_write(&a6xx_gpu->gmu, REG_A6XX_GPU_GMU_AO_GMU_CGC_DELAY_CNTL,
> 40c297eb245b1c9 Konrad Dybcio 2024-08-28 639 state ?
> cgc_delay : 0);
> af66706accdf5af Konrad Dybcio 2023-09-25 640
> gmu_write(&a6xx_gpu->gmu, REG_A6XX_GPU_GMU_AO_GMU_CGC_HYST_CNTL,
> 40c297eb245b1c9 Konrad Dybcio 2024-08-28 @641 state ?
> cgc_hyst : 0);
>
> ^^^^^^^^
> Uninitialized
>
> af66706accdf5af Konrad Dybcio 2023-09-25 642
> dff2f69f3e8a6ea Rob Clark 2024-06-18 643 if
> (!adreno_gpu->info->a6xx->hwcg) {
> d2bcca0ccccfa5e Neil Armstrong 2024-02-16 644 gpu_write(gpu,
> REG_A7XX_RBBM_CLOCK_CNTL_GLOBAL, 1);
>