aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
authorJoe Carnuccio <joe.carnuccio@qlogic.com>2013-02-08 01:58:03 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-02-22 09:39:27 -0500
commitfe52f6e121a8e6b66a608b79deb1c383e08aa32f (patch)
tree626270189331cabc1a86693ee3bacbfa15dbb28e /drivers/scsi/qla2xxx/qla_attr.c
parent6c3943cdb87f68a9dbb6d586f40b84622e803574 (diff)
[SCSI] qla2xxx: Integrate generic card temperature with mezz card temperature.
Give priority to I2C thermal. Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 7256167d579e..1d82eef4e1eb 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1272,22 +1272,29 @@ qla2x00_thermal_temp_show(struct device *dev,
1272 struct device_attribute *attr, char *buf) 1272 struct device_attribute *attr, char *buf)
1273{ 1273{
1274 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); 1274 scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
1275 int rval = QLA_FUNCTION_FAILED; 1275 uint16_t temp = 0;
1276 uint16_t temp, frac;
1277 1276
1278 if (!vha->hw->flags.thermal_supported) 1277 if (!vha->hw->thermal_support) {
1279 return snprintf(buf, PAGE_SIZE, "\n"); 1278 ql_log(ql_log_warn, vha, 0x70db,
1279 "Thermal not supported by this card.\n");
1280 goto done;
1281 }
1280 1282
1281 temp = frac = 0; 1283 if (qla2x00_reset_active(vha)) {
1282 if (qla2x00_reset_active(vha)) 1284 ql_log(ql_log_warn, vha, 0x70dc, "ISP reset active.\n");
1283 ql_log(ql_log_warn, vha, 0x707b, 1285 goto done;
1284 "ISP reset active.\n"); 1286 }
1285 else if (!vha->hw->flags.eeh_busy) 1287
1286 rval = qla2x00_get_thermal_temp(vha, &temp, &frac); 1288 if (vha->hw->flags.eeh_busy) {
1287 if (rval != QLA_SUCCESS) 1289 ql_log(ql_log_warn, vha, 0x70dd, "PCI EEH busy.\n");
1288 return snprintf(buf, PAGE_SIZE, "\n"); 1290 goto done;
1291 }
1292
1293 if (qla2x00_get_thermal_temp(vha, &temp) == QLA_SUCCESS)
1294 return snprintf(buf, PAGE_SIZE, "%d\n", temp);
1289 1295
1290 return snprintf(buf, PAGE_SIZE, "%d.%02d\n", temp, frac); 1296done:
1297 return snprintf(buf, PAGE_SIZE, "\n");
1291} 1298}
1292 1299
1293static ssize_t 1300static ssize_t