mirror of
https://github.com/GOSTSec/sgminer
synced 2025-08-28 06:41:56 +00:00
Increment hardware error count from the one site.
This commit is contained in:
parent
2dea04704a
commit
6b714dd431
18
cgminer.c
18
cgminer.c
@ -5515,6 +5515,16 @@ void submit_work_async(struct work *work_in, struct timeval *tv_work_found)
|
|||||||
quit(1, "Failed to create submit_work_thread");
|
quit(1, "Failed to create submit_work_thread");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void inc_hw_errors(struct thr_info *thr)
|
||||||
|
{
|
||||||
|
mutex_lock(&stats_lock);
|
||||||
|
hw_errors++;
|
||||||
|
thr->cgpu->hw_errors++;
|
||||||
|
mutex_unlock(&stats_lock);
|
||||||
|
|
||||||
|
thr->cgpu->drv->hw_error(thr);
|
||||||
|
}
|
||||||
|
|
||||||
static bool hashtest(struct thr_info *thr, struct work *work)
|
static bool hashtest(struct thr_info *thr, struct work *work)
|
||||||
{
|
{
|
||||||
uint32_t *data32 = (uint32_t *)(work->data);
|
uint32_t *data32 = (uint32_t *)(work->data);
|
||||||
@ -5534,13 +5544,7 @@ static bool hashtest(struct thr_info *thr, struct work *work)
|
|||||||
applog(LOG_WARNING, "%s%d: invalid nonce - HW error",
|
applog(LOG_WARNING, "%s%d: invalid nonce - HW error",
|
||||||
thr->cgpu->drv->name, thr->cgpu->device_id);
|
thr->cgpu->drv->name, thr->cgpu->device_id);
|
||||||
|
|
||||||
mutex_lock(&stats_lock);
|
inc_hw_errors(thr);
|
||||||
hw_errors++;
|
|
||||||
thr->cgpu->hw_errors++;
|
|
||||||
mutex_unlock(&stats_lock);
|
|
||||||
|
|
||||||
thr->cgpu->drv->hw_error(thr);
|
|
||||||
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,10 +186,8 @@ static void send_scrypt_nonce(struct pc_data *pcd, uint32_t nonce)
|
|||||||
|
|
||||||
if (scrypt_test(work->data, work->target, nonce))
|
if (scrypt_test(work->data, work->target, nonce))
|
||||||
submit_nonce(thr, work, nonce);
|
submit_nonce(thr, work, nonce);
|
||||||
else {
|
else
|
||||||
applog(LOG_INFO, "Scrypt error, review settings");
|
inc_hw_errors(thr);
|
||||||
thr->cgpu->hw_errors++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *postcalc_hash(void *userdata)
|
static void *postcalc_hash(void *userdata)
|
||||||
|
1
miner.h
1
miner.h
@ -1201,6 +1201,7 @@ struct modminer_fpga_state {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void get_datestamp(char *, struct timeval *);
|
extern void get_datestamp(char *, struct timeval *);
|
||||||
|
extern void inc_hw_errors(struct thr_info *thr);
|
||||||
extern void submit_nonce(struct thr_info *thr, struct work *work, uint32_t nonce);
|
extern void submit_nonce(struct thr_info *thr, struct work *work, uint32_t nonce);
|
||||||
extern struct work *get_queued(struct cgpu_info *cgpu);
|
extern struct work *get_queued(struct cgpu_info *cgpu);
|
||||||
extern struct work *__find_work_bymidstate(struct work *que, char *midstate, size_t midstatelen, char *data, int offset, size_t datalen);
|
extern struct work *__find_work_bymidstate(struct work *que, char *midstate, size_t midstatelen, char *data, int offset, size_t datalen);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user