tree: git://people.freedesktop.org/~agd5f/linux.git amd-staging-drm-next head: cd5dd023c24f097393cd351bfaaba81284d1a15b commit: e060721131c59a375125f7e5202d8e2cd7462406 [9928/9999] drm/powerplay: label internally used symbols as static config: s390-randconfig-s032-20200624 (attached as .config) compiler: s390-linux-gcc (GCC) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.2-dirty git checkout e060721131c59a375125f7e5202d8e2cd7462406 # save the attached .config to linux build tree make W=1 C=1 ARCH=s390 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1479:36: sparse: expected unsigned int [usertype] McArbDramTiming drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1479:36: sparse: got restricted __be32 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1480:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] McArbDramTiming2 @@ got restricted __be32 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1480:36: sparse: expected unsigned int [usertype] McArbDramTiming2 drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1480:36: sparse: got restricted __be32 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1568:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] BootMVdd @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1568:9: sparse: expected unsigned short [usertype] BootMVdd drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1568:9: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1673:37: sparse: sparse: cast to restricted __be32 drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1689:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] minFreq @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1689:9: sparse: expected unsigned short [usertype] minFreq drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1689:9: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1691:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] maxFreq @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1691:9: sparse: expected unsigned short [usertype] maxFreq drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1691:9: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1717:38: sparse: sparse: cast to restricted __be32 drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1732:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] setting @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1732:17: sparse: expected unsigned short [usertype] setting drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1732:17: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1838:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] DefaultTdp @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1838:31: sparse: expected unsigned short [usertype] DefaultTdp drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1838:31: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1840:30: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] TargetTdp @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1840:30: sparse: expected unsigned short [usertype] TargetTdp drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1840:30: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1852:39: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] BAPM_TEMP_GRADIENT @@ got restricted __be32 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1852:39: sparse: expected unsigned int [usertype] BAPM_TEMP_GRADIENT drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1852:39: sparse: got restricted __be32 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1860:62: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1860:62: sparse: expected unsigned short drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1860:62: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1862:63: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1862:63: sparse: expected unsigned short drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1862:63: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1901:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [assigned] [usertype] tdc_limit @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1901:25: sparse: expected unsigned short [assigned] [usertype] tdc_limit drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1901:25: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1954:57: sparse: sparse: incorrect type in assignment (different base types) @@ expected signed short [usertype] FuzzyFan_PwmSetDelta @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1954:57: sparse: expected signed short [usertype] FuzzyFan_PwmSetDelta drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1954:57: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1987:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [assigned] [usertype] hi_sidd @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1987:25: sparse: expected unsigned short [assigned] [usertype] hi_sidd drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1987:25: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1989:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [assigned] [usertype] lo_sidd @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1989:25: sparse: expected unsigned short [assigned] [usertype] lo_sidd drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:1989:25: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2077:53: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] s0 @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2077:53: sparse: expected unsigned short [usertype] s0 drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2077:53: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2079:53: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] s1 @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2079:53: sparse: expected unsigned short [usertype] s1 drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2079:53: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2100:40: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int @@ got restricted __be32 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2100:40: sparse: expected unsigned int drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2100:40: sparse: got restricted __be32 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2423:32: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int @@ got restricted __be32 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2423:32: sparse: expected unsigned int drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2423:32: sparse: got restricted __be32 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2424:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] SystemFlags @@ got restricted __be32 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2424:9: sparse: expected unsigned int [usertype] SystemFlags drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2424:9: sparse: got restricted __be32 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2425:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] VRConfig @@ got restricted __be32 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2425:9: sparse: expected unsigned int [usertype] VRConfig drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2425:9: sparse: got restricted __be32 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2426:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] SmioMask1 @@ got restricted __be32 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2426:9: sparse: expected unsigned int [usertype] SmioMask1 drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2426:9: sparse: got restricted __be32 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2427:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] SmioMask2 @@ got restricted __be32 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2427:9: sparse: expected unsigned int [usertype] SmioMask2 drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2427:9: sparse: got restricted __be32 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2428:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] SclkStepSize @@ got restricted __be32 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2428:9: sparse: expected unsigned int [usertype] SclkStepSize drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2428:9: sparse: got restricted __be32 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2429:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] TemperatureLimitHigh @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2429:9: sparse: expected unsigned short [usertype] TemperatureLimitHigh drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2429:9: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2430:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] TemperatureLimitLow @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2430:9: sparse: expected unsigned short [usertype] TemperatureLimitLow drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2430:9: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2431:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] VoltageResponseTime @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2431:9: sparse: expected unsigned short [usertype] VoltageResponseTime drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2431:9: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2432:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] PhaseResponseTime @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2432:9: sparse: expected unsigned short [usertype] PhaseResponseTime drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2432:9: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2515:27: sparse: sparse: incorrect type in assignment (different base types) @@ expected signed short [usertype] TempMin @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2515:27: sparse: expected signed short [usertype] TempMin drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2515:27: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2516:27: sparse: sparse: incorrect type in assignment (different base types) @@ expected signed short [usertype] TempMed @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2516:27: sparse: expected signed short [usertype] TempMed drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2516:27: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2517:27: sparse: sparse: incorrect type in assignment (different base types) @@ expected signed short [usertype] TempMax @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2517:27: sparse: expected signed short [usertype] TempMax drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2517:27: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2519:26: sparse: sparse: incorrect type in assignment (different base types) @@ expected signed short [usertype] Slope1 @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2519:26: sparse: expected signed short [usertype] Slope1 drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2519:26: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2520:26: sparse: sparse: incorrect type in assignment (different base types) @@ expected signed short [usertype] Slope2 @@ got restricted __be16 [usertype] @@ drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2520:26: sparse: expected signed short [usertype] Slope2 drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2520:26: sparse: got restricted __be16 [usertype] >> drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2522:26: sparse: sparse: incorrect type in assignment (different base types) @@ expected signed short [usertype] FdoMin @@ got restricted __be16 [usertype] @@ >> drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2522:26: sparse: expected signed short [usertype] FdoMin drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2522:26: sparse: got restricted __be16 [usertype] drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c:2524:28: sparse: sparse: too many warnings vim +2522 drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/tonga_smumgr.c 4dddc212a354cc Rex Zhu 2017-10-09 2459 4dddc212a354cc Rex Zhu 2017-10-09 2460 static int tonga_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) 4dddc212a354cc Rex Zhu 2017-10-09 2461 { 4dddc212a354cc Rex Zhu 2017-10-09 2462 struct tonga_smumgr *smu_data = 4dddc212a354cc Rex Zhu 2017-10-09 2463 (struct tonga_smumgr *)(hwmgr->smu_backend); 4dddc212a354cc Rex Zhu 2017-10-09 2464 SMU72_Discrete_FanTable fan_table = { FDO_MODE_HARDWARE }; 4dddc212a354cc Rex Zhu 2017-10-09 2465 uint32_t duty100; 4dddc212a354cc Rex Zhu 2017-10-09 2466 uint32_t t_diff1, t_diff2, pwm_diff1, pwm_diff2; 4dddc212a354cc Rex Zhu 2017-10-09 2467 uint16_t fdo_min, slope1, slope2; 4dddc212a354cc Rex Zhu 2017-10-09 2468 uint32_t reference_clock; 4dddc212a354cc Rex Zhu 2017-10-09 2469 int res; 4dddc212a354cc Rex Zhu 2017-10-09 2470 uint64_t tmp64; 4dddc212a354cc Rex Zhu 2017-10-09 2471 4dddc212a354cc Rex Zhu 2017-10-09 2472 if (!phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, 4dddc212a354cc Rex Zhu 2017-10-09 2473 PHM_PlatformCaps_MicrocodeFanControl)) 4dddc212a354cc Rex Zhu 2017-10-09 2474 return 0; 4dddc212a354cc Rex Zhu 2017-10-09 2475 4dddc212a354cc Rex Zhu 2017-10-09 2476 if (hwmgr->thermal_controller.fanInfo.bNoFan) { 4dddc212a354cc Rex Zhu 2017-10-09 2477 phm_cap_unset(hwmgr->platform_descriptor.platformCaps, 4dddc212a354cc Rex Zhu 2017-10-09 2478 PHM_PlatformCaps_MicrocodeFanControl); 4dddc212a354cc Rex Zhu 2017-10-09 2479 return 0; 4dddc212a354cc Rex Zhu 2017-10-09 2480 } 4dddc212a354cc Rex Zhu 2017-10-09 2481 4dddc212a354cc Rex Zhu 2017-10-09 2482 if (0 == smu_data->smu7_data.fan_table_start) { 4dddc212a354cc Rex Zhu 2017-10-09 2483 phm_cap_unset(hwmgr->platform_descriptor.platformCaps, 4dddc212a354cc Rex Zhu 2017-10-09 2484 PHM_PlatformCaps_MicrocodeFanControl); 4dddc212a354cc Rex Zhu 2017-10-09 2485 return 0; 4dddc212a354cc Rex Zhu 2017-10-09 2486 } 4dddc212a354cc Rex Zhu 2017-10-09 2487 4dddc212a354cc Rex Zhu 2017-10-09 2488 duty100 = PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, 4dddc212a354cc Rex Zhu 2017-10-09 2489 CGS_IND_REG__SMC, 4dddc212a354cc Rex Zhu 2017-10-09 2490 CG_FDO_CTRL1, FMAX_DUTY100); 4dddc212a354cc Rex Zhu 2017-10-09 2491 4dddc212a354cc Rex Zhu 2017-10-09 2492 if (0 == duty100) { 4dddc212a354cc Rex Zhu 2017-10-09 2493 phm_cap_unset(hwmgr->platform_descriptor.platformCaps, 4dddc212a354cc Rex Zhu 2017-10-09 2494 PHM_PlatformCaps_MicrocodeFanControl); 4dddc212a354cc Rex Zhu 2017-10-09 2495 return 0; 4dddc212a354cc Rex Zhu 2017-10-09 2496 } 4dddc212a354cc Rex Zhu 2017-10-09 2497 4dddc212a354cc Rex Zhu 2017-10-09 2498 tmp64 = hwmgr->thermal_controller.advanceFanControlParameters.usPWMMin * duty100; 4dddc212a354cc Rex Zhu 2017-10-09 2499 do_div(tmp64, 10000); 4dddc212a354cc Rex Zhu 2017-10-09 2500 fdo_min = (uint16_t)tmp64; 4dddc212a354cc Rex Zhu 2017-10-09 2501 4dddc212a354cc Rex Zhu 2017-10-09 2502 t_diff1 = hwmgr->thermal_controller.advanceFanControlParameters.usTMed - 4dddc212a354cc Rex Zhu 2017-10-09 2503 hwmgr->thermal_controller.advanceFanControlParameters.usTMin; 4dddc212a354cc Rex Zhu 2017-10-09 2504 t_diff2 = hwmgr->thermal_controller.advanceFanControlParameters.usTHigh - 4dddc212a354cc Rex Zhu 2017-10-09 2505 hwmgr->thermal_controller.advanceFanControlParameters.usTMed; 4dddc212a354cc Rex Zhu 2017-10-09 2506 4dddc212a354cc Rex Zhu 2017-10-09 2507 pwm_diff1 = hwmgr->thermal_controller.advanceFanControlParameters.usPWMMed - 4dddc212a354cc Rex Zhu 2017-10-09 2508 hwmgr->thermal_controller.advanceFanControlParameters.usPWMMin; 4dddc212a354cc Rex Zhu 2017-10-09 2509 pwm_diff2 = hwmgr->thermal_controller.advanceFanControlParameters.usPWMHigh - 4dddc212a354cc Rex Zhu 2017-10-09 2510 hwmgr->thermal_controller.advanceFanControlParameters.usPWMMed; 4dddc212a354cc Rex Zhu 2017-10-09 2511 4dddc212a354cc Rex Zhu 2017-10-09 2512 slope1 = (uint16_t)((50 + ((16 * duty100 * pwm_diff1) / t_diff1)) / 100); 4dddc212a354cc Rex Zhu 2017-10-09 2513 slope2 = (uint16_t)((50 + ((16 * duty100 * pwm_diff2) / t_diff2)) / 100); 4dddc212a354cc Rex Zhu 2017-10-09 2514 4dddc212a354cc Rex Zhu 2017-10-09 2515 fan_table.TempMin = cpu_to_be16((50 + hwmgr->thermal_controller.advanceFanControlParameters.usTMin) / 100); 4dddc212a354cc Rex Zhu 2017-10-09 2516 fan_table.TempMed = cpu_to_be16((50 + hwmgr->thermal_controller.advanceFanControlParameters.usTMed) / 100); 4dddc212a354cc Rex Zhu 2017-10-09 2517 fan_table.TempMax = cpu_to_be16((50 + hwmgr->thermal_controller.advanceFanControlParameters.usTMax) / 100); 4dddc212a354cc Rex Zhu 2017-10-09 2518 4dddc212a354cc Rex Zhu 2017-10-09 2519 fan_table.Slope1 = cpu_to_be16(slope1); 4dddc212a354cc Rex Zhu 2017-10-09 2520 fan_table.Slope2 = cpu_to_be16(slope2); 4dddc212a354cc Rex Zhu 2017-10-09 2521 4dddc212a354cc Rex Zhu 2017-10-09 @2522 fan_table.FdoMin = cpu_to_be16(fdo_min); 4dddc212a354cc Rex Zhu 2017-10-09 2523 4dddc212a354cc Rex Zhu 2017-10-09 2524 fan_table.HystDown = cpu_to_be16(hwmgr->thermal_controller.advanceFanControlParameters.ucTHyst); 4dddc212a354cc Rex Zhu 2017-10-09 2525 4dddc212a354cc Rex Zhu 2017-10-09 2526 fan_table.HystUp = cpu_to_be16(1); 4dddc212a354cc Rex Zhu 2017-10-09 2527 4dddc212a354cc Rex Zhu 2017-10-09 2528 fan_table.HystSlope = cpu_to_be16(1); 4dddc212a354cc Rex Zhu 2017-10-09 2529 4dddc212a354cc Rex Zhu 2017-10-09 2530 fan_table.TempRespLim = cpu_to_be16(5); 4dddc212a354cc Rex Zhu 2017-10-09 2531 2538090cb62ab8 Rex Zhu 2018-03-16 2532 reference_clock = amdgpu_asic_get_xclk((struct amdgpu_device *)hwmgr->adev); 4dddc212a354cc Rex Zhu 2017-10-09 2533 4dddc212a354cc Rex Zhu 2017-10-09 2534 fan_table.RefreshPeriod = cpu_to_be32((hwmgr->thermal_controller.advanceFanControlParameters.ulCycleDelay * reference_clock) / 1600); 4dddc212a354cc Rex Zhu 2017-10-09 2535 4dddc212a354cc Rex Zhu 2017-10-09 2536 fan_table.FdoMax = cpu_to_be16((uint16_t)duty100); 4dddc212a354cc Rex Zhu 2017-10-09 2537 4dddc212a354cc Rex Zhu 2017-10-09 2538 fan_table.TempSrc = (uint8_t)PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, CG_MULT_THERMAL_CTRL, TEMP_SEL); 4dddc212a354cc Rex Zhu 2017-10-09 2539 4dddc212a354cc Rex Zhu 2017-10-09 2540 fan_table.FanControl_GL_Flag = 1; 4dddc212a354cc Rex Zhu 2017-10-09 2541 4dddc212a354cc Rex Zhu 2017-10-09 2542 res = smu7_copy_bytes_to_smc(hwmgr, 4dddc212a354cc Rex Zhu 2017-10-09 2543 smu_data->smu7_data.fan_table_start, 4dddc212a354cc Rex Zhu 2017-10-09 2544 (uint8_t *)&fan_table, 4dddc212a354cc Rex Zhu 2017-10-09 2545 (uint32_t)sizeof(fan_table), 4dddc212a354cc Rex Zhu 2017-10-09 2546 SMC_RAM_END); 4dddc212a354cc Rex Zhu 2017-10-09 2547 4dddc212a354cc Rex Zhu 2017-10-09 2548 return 0; 4dddc212a354cc Rex Zhu 2017-10-09 2549 } 4dddc212a354cc Rex Zhu 2017-10-09 2550 :::::: The code at line 2522 was first introduced by commit :::::: 4dddc212a354cc3924d60ca240cd338b0a3f6c49 drm/amd/pp: remove tonga_smc/smumgr split. :::::: TO: Rex Zhu :::::: CC: Alex Deucher --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org