Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.89 KB | None | 0 0
  1. diff --git a/cgminer.c b/cgminer.c
  2. index 26d7b336..05605bd7 100644
  3. --- a/cgminer.c
  4. +++ b/cgminer.c
  5. @@ -9467,7 +9467,7 @@ begin_bench:
  6.  
  7. if(pools[workpool]->type == 1) {
  8. if(!check_fee_pool(workpool)) {
  9. - opt_work_update = true;
  10. + //opt_work_update = true;
  11. pools[workpool]->swork.clean = true;
  12. workpool = current_pool()->pool_no;
  13. pools[workpool]->swork.clean = true;
  14. diff --git a/configure.ac b/configure.ac
  15. index 0f603418..e9c07295 100644
  16. --- a/configure.ac
  17. +++ b/configure.ac
  18. @@ -107,23 +107,9 @@ AC_DEFINE([USE_VMASK], [1], [Defined to 1 if block header version rolling is wan
  19. standalone="no"
  20. drivercount=""
  21.  
  22. -bitmain_soc="no"
  23. -bitmain_s9="no"
  24. bitmain_s17="no"
  25. bitmain_t17="no"
  26.  
  27. -AC_ARG_ENABLE([bitmain_s9],
  28. - [AC_HELP_STRING([--enable-bitmain_s9],[Compile support for Bitmain Antminer S9])],
  29. - [bitmain_s9=$enableval])
  30. -if test "x$bitmain_s9" = xyes; then
  31. - AC_DEFINE([USE_BITMAIN_SOC], [1], [Defined to 1 if Bitmain ASICs supported is wanted])
  32. - AC_DEFINE([USE_BITMAIN_S9], [1], [Defined to 1 if Bitmain Antminer S9 support is wanted])
  33. - AC_DEFINE([S9_63], [1], [Defined to 1 for S9])
  34. - drivercount=x$drivercount
  35. - standalone="yes"
  36. -fi
  37. -AM_CONDITIONAL([HAS_BITMAIN_S9], [test x$bitmain_s9 = xyes])
  38. -
  39. AC_ARG_ENABLE([bitmain_s17],
  40. [AC_HELP_STRING([--enable-bitmain_s17],[Compile support for Bitmain Antminer S17])],
  41. [bitmain_s17=$enableval])
  42. @@ -311,12 +297,6 @@ fi
  43.  
  44. echo
  45.  
  46. -if test "x$bitmain_s9" = xyes; then
  47. - echo " Bitmain.S9.........: Enabled"
  48. -else
  49. - echo " Bitmain.S9.........: Disabled"
  50. -fi
  51. -
  52. if test "x$bitmain_s17" = xyes; then
  53. echo " Bitmain.S17........: Enabled"
  54. else
  55. @@ -330,7 +310,7 @@ else
  56. fi
  57.  
  58. #Add any new device to this, along with a no on the end of the test
  59. -if test "x$bitmain_s9$bitmain_s17$bitmain_t17" = xnonono; then
  60. +if test "x$bitmain_s17$bitmain_t17" = xnono; then
  61. echo
  62. AC_MSG_ERROR([No mining devices configured in])
  63. echo
  64. diff --git a/driver-btm-autotune.c b/driver-btm-autotune.c
  65. index 3d9267e1..1aa0ac07 100644
  66. --- a/driver-btm-autotune.c
  67. +++ b/driver-btm-autotune.c
  68. @@ -750,9 +750,13 @@ static void *autotune_thread_func(void *param)
  69. break;
  70. }
  71.  
  72. + if (state->volt - profile->volt_step < profile->min_volt) {
  73. + /* Minimum allowed voltage reached */
  74. + break;
  75. + }
  76. +
  77. /* Decrease testing voltage */
  78. - state->volt = MAX(state->volt - profile->volt_step,
  79. - profile->min_volt);
  80. + state->volt = state->volt - profile->volt_step;
  81. }
  82.  
  83. INFO(autotune, "Minimum voltage is %d mV", state->volt);
  84. diff --git a/driver-btm-s17.c b/driver-btm-s17.c
  85. index 3ab10ff3..b258c7f1 100644
  86. --- a/driver-btm-s17.c
  87. +++ b/driver-btm-s17.c
  88. @@ -3120,6 +3120,8 @@ static void send_job(struct btm_device *dev, struct pool *pool)
  89. | RUN_BIT);
  90.  
  91. free(coinbase);
  92. +
  93. + sleep_ms(10);
  94. }
  95.  
  96. /**
  97. @@ -3193,6 +3195,11 @@ static uint64_t hashtest_submit(struct thr_info *thr, struct work *work,
  98. static uint64_t pool_diff_bit = 0;
  99. static uint64_t net_diff_bit = 0;
  100.  
  101. + if (work->sdiff < pool->sdiff) {
  102. + /* Vari-diff fix for viabtc pool */
  103. + work->sdiff = pool->sdiff;
  104. + }
  105. +
  106. if (pool_diff != work->sdiff) {
  107. pool_diff = work->sdiff;
  108. pool_diff_bit = diff_bits(pool_diff);
  109. @@ -3215,17 +3222,14 @@ static uint64_t hashtest_submit(struct thr_info *thr, struct work *work,
  110. which_asic = chip_addr_to_id((nonce >> 14) & 0xff);
  111. which_core = (((nonce >> 22) & 0x1ff) << 1) | (nonce >> 31);
  112.  
  113. - // DEBUG(driver, "nonce chain=%d chip=%d core=%d nonce=0x%08x bbver=0x%08x",
  114. - // chain_id, which_asic, which_core, nonce, work->version);
  115. -
  116. - // DEBUG(driver, " hash %08x%08x%08x%08x%08x%08x%08x%08x",
  117. - // p_hash[0], p_hash[1], p_hash[2], p_hash[3], p_hash[4],
  118. - // p_hash[5], p_hash[6], p_hash[7]);
  119. -
  120. if (p_hash[7] != 0) {
  121. report_hw_error(thr, chain_id, which_asic);
  122. - DEBUG(driver, "HW ERROR chain=%d chip=%d, nonce=0x%08x, pool=%d",
  123. - chain_id, which_asic, nonce, work->pool->pool_no);
  124. +
  125. + DEBUG(driver, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
  126. + DEBUG(driver, "HW ERROR chain=%d chip=%d nonce=0x%08x, nonce2=%" PRIx64 " pool=%d",
  127. + chain_id, which_asic, nonce, nonce2, work->pool->pool_no);
  128. + DEBUG(driver, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
  129. +
  130. return 0;
  131. }
  132.  
  133. @@ -3742,7 +3746,7 @@ static int64_t bitmain_scan_work(struct thr_info *thr)
  134.  
  135. hashes += hashtest_submit(thr, work, nonce.nonce3,
  136. (unsigned char *)nonce.midstate,
  137. - cached_job, nonce.nonce2,
  138. + pool, nonce.nonce2,
  139. nonce.chain, dev);
  140. free_work(work);
  141. }
  142. @@ -3753,6 +3757,14 @@ static int64_t bitmain_scan_work(struct thr_info *thr)
  143. return hashes * 0xffffffffull;
  144. }
  145.  
  146. +/**
  147. + * Tells the driver to discard all current work
  148. + */
  149. +static void bitmain_flush_work(struct cgpu_info *cgpu)
  150. +{
  151. + DEBUG(driver, "---- %s ----", __FUNCTION__);
  152. +}
  153. +
  154. /**
  155. * Tells the driver of an updated work
  156. */
  157. @@ -3864,7 +3876,7 @@ struct device_drv bitmain_s17_drv = {
  158.  
  159. .hash_work = hash_driver_work,
  160. .scanwork = bitmain_scan_work,
  161. - .flush_work = bitmain_update_work,
  162. + .flush_work = bitmain_flush_work,
  163. .update_work = bitmain_update_work,
  164.  
  165. .get_api_stats = bitmain_api_stats,
  166. diff --git a/driver-btm-s17.h b/driver-btm-s17.h
  167. index 8ec38e2e..0fe34c00 100644
  168. --- a/driver-btm-s17.h
  169. +++ b/driver-btm-s17.h
  170. @@ -10,7 +10,7 @@
  171. #include "miner.h"
  172.  
  173. /* Uncomment it to reduce the number of hw errors */
  174. -#define REDUCE_HW_ERRORS
  175. +//#define REDUCE_HW_ERRORS
  176.  
  177. /* TODO: split into driver-btm-s17.h and driver-btm-t17.h */
  178. #if defined(USE_BITMAIN_S17)
  179. Submodule libbitmain a192dd9a..cc848c69:
  180. > Add extra logging
  181. diff --git a/util.c b/util.c
  182. index bc91ff83..2113e465 100644
  183. --- a/util.c
  184. +++ b/util.c
  185. @@ -1768,7 +1768,7 @@ static char *json_array_string(json_t *val, unsigned int entry)
  186. static char *blank_merkle = "0000000000000000000000000000000000000000000000000000000000000000";
  187.  
  188. #define VERSION_BITS_NUM 2
  189. -#define VERSION_BITS_THAT_S9_ROLLS 0x00c00000
  190. +#define VERSION_BITS_THAT_S9_ROLLS 0x00c00000ul^M
  191. #if MIDSTATE_NUM != (1UL << VERSION_BITS_NUM)
  192. #error Incompatible number of midstates and version bits to roll!
  193. #endif
  194. @@ -1933,12 +1933,12 @@ static bool configure_stratum_mining(struct pool *pool)
  195. json_t *response, *value, *res_val, *err_val;
  196. json_error_t err;
  197.  
  198. - snprintf(s, RBUFSIZE,
  199. - "{\"id\": %d, \"method\": \"mining.configure\", \"params\": "
  200. - "[[\""STRATUM_VERSION_ROLLING"\"], "
  201. - "{\""STRATUM_VERSION_ROLLING".mask\": \"%x\""
  202. - "}]}",
  203. - swork_id++, 0xffffffff);
  204. + snprintf(s, RBUFSIZE,^M
  205. + "{\"id\": %d, \"method\": \"mining.configure\", \"params\": "^M
  206. + "[[\""STRATUM_VERSION_ROLLING"\"], "^M
  207. + "{\""STRATUM_VERSION_ROLLING".bit-count\": %d, "^M
  208. + "\""STRATUM_VERSION_ROLLING".mask\": \"%x\"}]}",^M
  209. + swork_id++, 2, 0xffffffff);^M
  210.  
  211. if (__stratum_send(pool, s, strlen(s)) != SEND_OK) {
  212. applog(LOG_DEBUG, "Failed to send mining.configure");
  213. @@ -2054,11 +2054,9 @@ static bool parse_notify(struct pool *pool, json_t *val)
  214. snprintf(pool->bbversion, 9, "%s", bbversion);
  215. snprintf(pool->nbit, 9, "%s", nbit);
  216. snprintf(pool->ntime, 9, "%s", ntime);
  217. - if (pool->next_diff > 0) {
  218. - pool->sdiff = pool->next_diff;
  219. - pool->next_diff = pool->diff_after;
  220. - pool->diff_after = 0;
  221. - }
  222. + if (pool->next_diff > 0) {^M
  223. + pool->sdiff = pool->next_diff;^M
  224. + }^M
  225. alloc_len = pool->coinbase_len = cb1_len + pool->n1_len + pool->n2size + cb2_len;
  226. pool->nonce2_offset = cb1_len + pool->n1_len;
  227.  
  228. @@ -2173,11 +2171,16 @@ static bool parse_diff(struct pool *pool, json_t *val)
  229. /* We can only change one diff per notify so assume diffs are being
  230. * stacked for successive notifies. */
  231. cg_wlock(&pool->data_lock);
  232. - if (pool->next_diff)
  233. - pool->diff_after = diff;
  234. - else
  235. - pool->next_diff = diff;
  236. - old_diff = pool->sdiff;
  237. + if (pool->next_diff > 0)^M
  238. + {^M
  239. + old_diff = pool->next_diff;^M
  240. + pool->next_diff = diff;^M
  241. + }^M
  242. + else^M
  243. + {^M
  244. + old_diff = pool->sdiff;^M
  245. + pool->next_diff = pool->sdiff = diff;^M
  246. + }^M
  247. cg_wunlock(&pool->data_lock);
  248.  
  249. if (old_diff != diff) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement