Browse Source

Merge commit 'eacd745' into bfgminer

Conflicts:
	driver-x6500.c
Luke Dashjr 12 years ago
parent
commit
f1259f55f7
1 changed files with 6 additions and 22 deletions
  1. 6 22
      driver-x6500.c

+ 6 - 22
driver-x6500.c

@@ -204,8 +204,6 @@ struct x6500_fpga_data {
 	// Time the clock was last reduced due to temperature
 	// Time the clock was last reduced due to temperature
 	time_t last_cutoff_reduced;
 	time_t last_cutoff_reduced;
 
 
-	float temp;
-	
 	uint32_t prepwork_last_register;
 	uint32_t prepwork_last_register;
 };
 };
 
 
@@ -490,15 +488,16 @@ void x6500_get_temperature(struct cgpu_info *x6500)
 		if (!fpga) continue;
 		if (!fpga) continue;
 
 
 		if (code[i] == 0xffff || !code[i]) {
 		if (code[i] == 0xffff || !code[i]) {
-			fpga->temp = 0;
+			x6500->temp = 0;
 			continue;
 			continue;
 		}
 		}
 		if ((code[i] >> 15) & 1)
 		if ((code[i] >> 15) & 1)
 			code[i] -= 0x10000;
 			code[i] -= 0x10000;
-		fpga->temp = (float)(code[i] >> 2) * 0.03125f;
-		applog(LOG_DEBUG,"x6500_get_temperature: fpga[%d]->temp=%.1fC",i,fpga->temp);
+		x6500->temp = (float)(code[i] >> 2) * 0.03125f;
+		applog(LOG_DEBUG,"x6500_get_temperature: fpga[%d]->temp=%.1fC",
+		       i, x6500->temp);
 
 
-		int temperature = round(fpga->temp);
+		int temperature = round(x6500->temp);
 		if (temperature > x6500->targettemp + opt_hysteresis) {
 		if (temperature > x6500->targettemp + opt_hysteresis) {
 			time_t now = time(NULL);
 			time_t now = time(NULL);
 			if (fpga->last_cutoff_reduced != now) {
 			if (fpga->last_cutoff_reduced != now) {
@@ -508,7 +507,7 @@ void x6500_get_temperature(struct cgpu_info *x6500)
 					applog(LOG_NOTICE, "%"PRIprepr": Frequency dropped from %u to %u MHz (temp: %.1fC)",
 					applog(LOG_NOTICE, "%"PRIprepr": Frequency dropped from %u to %u MHz (temp: %.1fC)",
 					       x6500->proc_repr,
 					       x6500->proc_repr,
 					       oldFreq * 2, fpga->dclk.freqM * 2,
 					       oldFreq * 2, fpga->dclk.freqM * 2,
-					       fpga->temp
+					       x6500->temp
 					);
 					);
 				fpga->dclk.freqMaxM = fpga->dclk.freqM;
 				fpga->dclk.freqMaxM = fpga->dclk.freqM;
 			}
 			}
@@ -536,7 +535,6 @@ bool x6500_all_idle(struct cgpu_info *any_proc)
 
 
 static bool x6500_get_stats(struct cgpu_info *x6500)
 static bool x6500_get_stats(struct cgpu_info *x6500)
 {
 {
-	float hottest = 0;
 	if (x6500_all_idle(x6500)) {
 	if (x6500_all_idle(x6500)) {
 		struct cgpu_info *cgpu = x6500->device;
 		struct cgpu_info *cgpu = x6500->device;
 		// Getting temperature more efficiently while running
 		// Getting temperature more efficiently while running
@@ -549,18 +547,6 @@ static bool x6500_get_stats(struct cgpu_info *x6500)
 		mutex_unlock(mutexp);
 		mutex_unlock(mutexp);
 	}
 	}
 
 
-	for (int i = x6500->threads; i--; ) {
-		struct thr_info *thr = x6500->thr[i];
-		struct x6500_fpga_data *fpga = thr->cgpu_data;
-		if (!fpga)
-			continue;
-		float temp = fpga->temp;
-		if (temp > hottest)
-			hottest = temp;
-	}
-
-	x6500->temp = hottest;
-
 	return true;
 	return true;
 }
 }
 
 
@@ -583,8 +569,6 @@ get_x6500_api_extra_device_status(struct cgpu_info *x6500)
 	struct x6500_fpga_data *fpga = thr->cgpu_data;
 	struct x6500_fpga_data *fpga = thr->cgpu_data;
 	double d;
 	double d;
 
 
-	if (fpga->temp)
-		root = api_add_temp(root, "Temperature", &fpga->temp, true);
 	d = (double)fpga->dclk.freqM * 2;
 	d = (double)fpga->dclk.freqM * 2;
 	root = api_add_freq(root, "Frequency", &d, true);
 	root = api_add_freq(root, "Frequency", &d, true);
 	d = (double)fpga->dclk.freqMaxM * 2;
 	d = (double)fpga->dclk.freqMaxM * 2;