|
|
@@ -6314,10 +6314,7 @@ void *miner_thread(void *userdata)
|
|
|
gettimeofday(&getwork_start, NULL);
|
|
|
|
|
|
if (api->thread_init && !api->thread_init(mythr)) {
|
|
|
- cgpu->device_last_not_well = time(NULL);
|
|
|
- cgpu->device_not_well_reason = REASON_THREAD_FAIL_INIT;
|
|
|
- cgpu->thread_fail_init_count++;
|
|
|
-
|
|
|
+ dev_error(cgpu, REASON_THREAD_FAIL_INIT);
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
@@ -6388,9 +6385,7 @@ void *miner_thread(void *userdata)
|
|
|
if (unlikely(hashes == -1)) {
|
|
|
time_t now = time(NULL);
|
|
|
if (difftime(now, cgpu->device_last_not_well) > 1.) {
|
|
|
- cgpu->device_last_not_well = time(NULL);
|
|
|
- cgpu->device_not_well_reason = REASON_THREAD_ZERO_HASH;
|
|
|
- cgpu->thread_zero_hash_count++;
|
|
|
+ dev_error(cgpu, REASON_THREAD_ZERO_HASH);
|
|
|
}
|
|
|
|
|
|
if (scanhash_working && opt_restart) {
|
|
|
@@ -6971,9 +6966,7 @@ static void *watchdog_thread(void __maybe_unused *userdata)
|
|
|
cgpu->api->name, cgpu->device_id);
|
|
|
*denable = DEV_RECOVER;
|
|
|
|
|
|
- cgpu->device_last_not_well = time(NULL);
|
|
|
- cgpu->device_not_well_reason = REASON_DEV_THERMAL_CUTOFF;
|
|
|
- ++cgpu->dev_thermal_cutoff_count;
|
|
|
+ dev_error(cgpu, REASON_DEV_THERMAL_CUTOFF);
|
|
|
}
|
|
|
|
|
|
if (thr->getwork) {
|
|
|
@@ -7009,9 +7002,7 @@ static void *watchdog_thread(void __maybe_unused *userdata)
|
|
|
applog(LOG_ERR, "%s: Idle for more than 60 seconds, declaring SICK!", dev_str);
|
|
|
gettimeofday(&thr->sick, NULL);
|
|
|
|
|
|
- cgpu->device_last_not_well = time(NULL);
|
|
|
- cgpu->device_not_well_reason = REASON_DEV_SICK_IDLE_60;
|
|
|
- cgpu->dev_sick_idle_60_count++;
|
|
|
+ dev_error(cgpu, REASON_DEV_SICK_IDLE_60);
|
|
|
#ifdef HAVE_ADL
|
|
|
if (adl_active && cgpu->has_adl && gpu_activity(gpu) > 50) {
|
|
|
applog(LOG_ERR, "GPU still showing activity suggesting a hard hang.");
|
|
|
@@ -7027,9 +7018,7 @@ static void *watchdog_thread(void __maybe_unused *userdata)
|
|
|
applog(LOG_ERR, "%s: Not responded for more than 10 minutes, declaring DEAD!", dev_str);
|
|
|
gettimeofday(&thr->sick, NULL);
|
|
|
|
|
|
- cgpu->device_last_not_well = time(NULL);
|
|
|
- cgpu->device_not_well_reason = REASON_DEV_DEAD_IDLE_600;
|
|
|
- cgpu->dev_dead_idle_600_count++;
|
|
|
+ dev_error(cgpu, REASON_DEV_DEAD_IDLE_600);
|
|
|
} else if (now.tv_sec - thr->sick.tv_sec > 60 &&
|
|
|
(cgpu->status == LIFE_SICK || cgpu->status == LIFE_DEAD)) {
|
|
|
/* Attempt to restart a GPU that's sick or dead once every minute */
|