Re: [PATCH] drm/amd/powerplay: don't succeed in getters if fan is missing

2016-10-31 Thread Alex Deucher
On Sun, Oct 30, 2016 at 1:05 AM, Edward O'Callaghan
 wrote:
> Reviewed-by: Edward O'Callaghan 
>
> On 10/30/2016 07:32 AM, Grazvydas Ignotas wrote:
>> Otherwise callers end up using uninitialized data.
>>
>> Signed-off-by: Grazvydas Ignotas 

Applied.  thanks!

Alex

>> ---
>>  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c 
>> b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c
>> index fb6c6f6..29d0319 100644
>> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c
>> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c
>> @@ -30,7 +30,7 @@ int smu7_fan_ctrl_get_fan_speed_info(struct pp_hwmgr 
>> *hwmgr,
>>   struct phm_fan_speed_info *fan_speed_info)
>>  {
>>   if (hwmgr->thermal_controller.fanInfo.bNoFan)
>> - return 0;
>> + return -ENODEV;
>>
>>   fan_speed_info->supports_percent_read = true;
>>   fan_speed_info->supports_percent_write = true;
>> @@ -60,7 +60,7 @@ int smu7_fan_ctrl_get_fan_speed_percent(struct pp_hwmgr 
>> *hwmgr,
>>   uint64_t tmp64;
>>
>>   if (hwmgr->thermal_controller.fanInfo.bNoFan)
>> - return 0;
>> + return -ENODEV;
>>
>>   duty100 = PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC,
>>   CG_FDO_CTRL1, FMAX_DUTY100);
>> @@ -89,7 +89,7 @@ int smu7_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr 
>> *hwmgr, uint32_t *speed)
>>   if (hwmgr->thermal_controller.fanInfo.bNoFan ||
>>   (hwmgr->thermal_controller.fanInfo.
>>   ucTachometerPulsesPerRevolution == 0))
>> - return 0;
>> + return -ENODEV;
>>
>>   tach_period = PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, 
>> CGS_IND_REG__SMC,
>>   CG_TACH_STATUS, TACH_PERIOD);
>>
>
>
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


Re: [PATCH] drm/amd/powerplay: don't succeed in getters if fan is missing

2016-10-29 Thread Edward O'Callaghan
Reviewed-by: Edward O'Callaghan 

On 10/30/2016 07:32 AM, Grazvydas Ignotas wrote:
> Otherwise callers end up using uninitialized data.
> 
> Signed-off-by: Grazvydas Ignotas 
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c 
> b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c
> index fb6c6f6..29d0319 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_thermal.c
> @@ -30,7 +30,7 @@ int smu7_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr,
>   struct phm_fan_speed_info *fan_speed_info)
>  {
>   if (hwmgr->thermal_controller.fanInfo.bNoFan)
> - return 0;
> + return -ENODEV;
>  
>   fan_speed_info->supports_percent_read = true;
>   fan_speed_info->supports_percent_write = true;
> @@ -60,7 +60,7 @@ int smu7_fan_ctrl_get_fan_speed_percent(struct pp_hwmgr 
> *hwmgr,
>   uint64_t tmp64;
>  
>   if (hwmgr->thermal_controller.fanInfo.bNoFan)
> - return 0;
> + return -ENODEV;
>  
>   duty100 = PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC,
>   CG_FDO_CTRL1, FMAX_DUTY100);
> @@ -89,7 +89,7 @@ int smu7_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr *hwmgr, 
> uint32_t *speed)
>   if (hwmgr->thermal_controller.fanInfo.bNoFan ||
>   (hwmgr->thermal_controller.fanInfo.
>   ucTachometerPulsesPerRevolution == 0))
> - return 0;
> + return -ENODEV;
>  
>   tach_period = PHM_READ_VFPF_INDIRECT_FIELD(hwmgr->device, 
> CGS_IND_REG__SMC,
>   CG_TACH_STATUS, TACH_PERIOD);
> 



signature.asc
Description: OpenPGP digital signature
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx