From 165a1492b7573063afef9da054e756eb439852d6 Mon Sep 17 00:00:00 2001 From: jsteube Date: Fri, 11 Nov 2016 22:46:12 +0100 Subject: [PATCH] Better distinguish between ADL and SYSFS when setting fanspeed --- src/monitor.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/monitor.c b/src/monitor.c index 72ef415a9..f5562cdfc 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -181,7 +181,7 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) if (gpu_temp_retain) { - if (hwmon_ctx->hm_device[device_id].fan_set_supported == 1) + if (hwmon_ctx->hm_device[device_id].fan_set_supported == true) { int temp_cur = temperature; @@ -223,8 +223,15 @@ static int monitor (hashcat_ctx_t *hashcat_ctx) { if (device_param->device_vendor_id == VENDOR_ID_AMD) { - hm_set_fanspeed_with_device_id_adl (hashcat_ctx, device_id, fan_speed_new, 1); - hm_set_fanspeed_with_device_id_sysfs (hashcat_ctx, device_id, fan_speed_new); + if (hwmon_ctx->hm_adl) + { + hm_set_fanspeed_with_device_id_adl (hashcat_ctx, device_id, fan_speed_new, 1); + } + + if (hwmon_ctx->hm_sysfs) + { + hm_set_fanspeed_with_device_id_sysfs (hashcat_ctx, device_id, fan_speed_new); + } } else if (device_param->device_vendor_id == VENDOR_ID_NV) {