Do avalon driver detection last as it will try to claim any similar device and they are not reliably detected.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
diff --git a/cgminer.c b/cgminer.c
index ea2ff51..768dd8e 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -7155,10 +7155,6 @@ static void *hotplug_thread(void __maybe_unused *userdata)
icarus_drv.drv_detect();
#endif
-#ifdef USE_AVALON
- avalon_drv.drv_detect();
-#endif
-
#ifdef USE_BFLSC
bflsc_drv.drv_detect();
#endif
@@ -7171,6 +7167,10 @@ static void *hotplug_thread(void __maybe_unused *userdata)
modminer_drv.drv_detect();
#endif
+#ifdef USE_AVALON
+ avalon_drv.drv_detect();
+#endif
+
if (new_devices)
hotplug_process();
@@ -7384,11 +7384,6 @@ int main(int argc, char *argv[])
icarus_drv.drv_detect();
#endif
-#ifdef USE_AVALON
- if (!opt_scrypt)
- avalon_drv.drv_detect();
-#endif
-
#ifdef USE_BFLSC
if (!opt_scrypt)
bflsc_drv.drv_detect();
@@ -7409,6 +7404,13 @@ int main(int argc, char *argv[])
ztex_drv.drv_detect();
#endif
+ /* Detect avalon last since it will try to claim the device regardless
+ * as detection is unreliable. */
+#ifdef USE_AVALON
+ if (!opt_scrypt)
+ avalon_drv.drv_detect();
+#endif
+
if (devices_enabled == -1) {
applog(LOG_ERR, "Devices detected:");
for (i = 0; i < total_devices; ++i) {