Browse Source

Titan: adjust log levels in knc_titan_get_info

Vitalii Demianets 11 years ago
parent
commit
241e42bbdc
4 changed files with 7 additions and 9 deletions
  1. 3 5
      driver-titan.c
  2. 1 1
      knc-asic
  3. 2 2
      titan-asic.c
  4. 1 1
      titan-asic.h

+ 3 - 5
driver-titan.c

@@ -203,7 +203,7 @@ static bool knc_titan_detect_one(const char *devpath)
 	for (die = 0; die < KNC_TITAN_DIES_PER_ASIC; ++die) {
 		die_info.cores = KNC_TITAN_CORES_PER_DIE; /* core hint */
 		die_info.version = KNC_VERSION_TITAN;
-		if (!knc_titan_get_info(repr, ctx, asic, die, &die_info))
+		if (!knc_titan_get_info(LOG_NOTICE, ctx, asic, die, &die_info))
 			die_info.cores = -1;
 		if (0 < die_info.cores) {
 			knc->dies[asic][die] = (struct knc_titan_die) {
@@ -454,13 +454,11 @@ static bool knc_titan_init(struct thr_info * const thr)
 static bool die_test_and_add(struct knc_titan_info * const knc, int asic, int die, char * const errbuf)
 {
 	struct knc_die_info die_info;
-	char repr[6];
 	struct knc_titan_die *die_p = &(knc->dies[asic][die]);
 
-	snprintf(repr, sizeof(repr), "%s %d", knc_titan_drv.name, asic);
 	die_info.cores = KNC_TITAN_CORES_PER_DIE; /* core hint */
 	die_info.version = KNC_VERSION_TITAN;
-	if (!knc_titan_get_info(repr, knc->ctx, asic, die, &die_info))
+	if (!knc_titan_get_info(LOG_NOTICE, knc->ctx, asic, die, &die_info))
 		die_info.cores = -1;
 	if (0 < die_info.cores) {
 		die_p->add_request = 0;
@@ -771,7 +769,7 @@ static void knc_titan_poll(struct thr_info * const thr)
 				continue;
 			die_info.cores = die_p->cores; /* core hint */
 			die_info.version = KNC_VERSION_TITAN;
-			if (knc->asic_served_by_fpga[asic] || !knc_titan_get_info(cgpu->dev_repr, knc->ctx, asic, die, &die_info))
+			if (knc->asic_served_by_fpga[asic] || !knc_titan_get_info(LOG_DEBUG, knc->ctx, asic, die, &die_info))
 				continue;
 			thread_reportin(die_p->proc->thr[0]);
 

+ 1 - 1
knc-asic

@@ -1 +1 @@
-Subproject commit 7b26a875349bb79fc2311d606ed4ae6338ab9b83
+Subproject commit 9a7ccd77d528aa328f337059b9f02e7b22960f32

+ 2 - 2
titan-asic.c

@@ -13,10 +13,10 @@
 
 #include "titan-asic.h"
 
-bool knc_titan_get_info(const char *repr, void * const ctx, int channel, int die, struct knc_die_info *die_info)
+bool knc_titan_get_info(int log_level, void * const ctx, int channel, int die, struct knc_die_info *die_info)
 {
 	int rc;
-	rc = knc_detect_die(ctx, channel, die, die_info);
+	rc = knc_detect_die_(log_level, ctx, channel, die, die_info);
 	return (0 == rc);
 }
 

+ 1 - 1
titan-asic.h

@@ -32,7 +32,7 @@ struct nonce_report {
 	uint8_t slot;
 };
 
-bool knc_titan_get_info(const char *repr, void * const ctx, int channel, int die, struct knc_die_info *die_info);
+bool knc_titan_get_info(int log_level, void * const ctx, int channel, int die, struct knc_die_info *die_info);
 bool knc_titan_set_work(const char *repr, void * const ctx, int channel, int die, int core, int slot, struct work *work, bool urgent, bool *work_accepted, struct knc_report *report);
 bool knc_titan_set_work_multi(const char *repr, void * const ctx, int channel, int die, int core_start, int slot, struct work *work, bool urgent, bool *work_accepted, struct knc_report *reports, int num);
 bool knc_titan_get_report(const char *repr, void * const ctx, int channel, int die, int core, struct knc_report *report);