|
|
@ -639,6 +639,8 @@ static inline int __gpu_fanspeed(struct gpu_adl *ga) |
|
|
|
return ga->lpFanSpeedValue.iFanSpeed; |
|
|
|
return ga->lpFanSpeedValue.iFanSpeed; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void reinit_adl(void); |
|
|
|
|
|
|
|
|
|
|
|
int gpu_fanspeed(int gpu) |
|
|
|
int gpu_fanspeed(int gpu) |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct gpu_adl *ga; |
|
|
|
struct gpu_adl *ga; |
|
|
@ -667,6 +669,8 @@ static int __gpu_fanpercent(struct gpu_adl *ga) |
|
|
|
return ga->lpFanSpeedValue.iFanSpeed; |
|
|
|
return ga->lpFanSpeedValue.iFanSpeed; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int gpu_fanpercent(int gpu) |
|
|
|
int gpu_fanpercent(int gpu) |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct gpu_adl *ga; |
|
|
|
struct gpu_adl *ga; |
|
|
@ -679,6 +683,11 @@ int gpu_fanpercent(int gpu) |
|
|
|
lock_adl(); |
|
|
|
lock_adl(); |
|
|
|
ret = __gpu_fanpercent(ga); |
|
|
|
ret = __gpu_fanpercent(ga); |
|
|
|
unlock_adl(); |
|
|
|
unlock_adl(); |
|
|
|
|
|
|
|
if (unlikely(ga->has_fanspeed && ret == -1)) { |
|
|
|
|
|
|
|
applog(LOG_WARNING, "GPU %d stopped reporting fanspeed", gpu); |
|
|
|
|
|
|
|
applog(LOG_WARNING, "Will attempt to re-initialise ADL"); |
|
|
|
|
|
|
|
reinit_adl(); |
|
|
|
|
|
|
|
} |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1359,7 +1368,7 @@ void clear_adl(int nDevs) |
|
|
|
free_adl(); |
|
|
|
free_adl(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void reinit_adl(void) |
|
|
|
static void reinit_adl(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bool ret; |
|
|
|
bool ret; |
|
|
|
lock_adl(); |
|
|
|
lock_adl(); |
|
|
@ -1368,7 +1377,8 @@ void reinit_adl(void) |
|
|
|
if (!ret) { |
|
|
|
if (!ret) { |
|
|
|
adl_active = false; |
|
|
|
adl_active = false; |
|
|
|
applog(LOG_WARNING, "Attempt to re-initialise ADL has failed, disabling"); |
|
|
|
applog(LOG_WARNING, "Attempt to re-initialise ADL has failed, disabling"); |
|
|
|
} |
|
|
|
} else |
|
|
|
|
|
|
|
applog(LOG_WARNING, "ADL re-initialisation complete"); |
|
|
|
unlock_adl(); |
|
|
|
unlock_adl(); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif /* HAVE_ADL */ |
|
|
|
#endif /* HAVE_ADL */ |
|
|
|