mpt2sas, mpt3sas: log exceeded temperature thresholds
This patch will log a message when driver receives "Temperature Threshold exceeded" event from any temperature sensor. The message will look similar to like: mpt3sas0: Temperature Threshold flags a b c d exceeded for Sensor: x !!! mpt3sas0: Current Temp In Celsius: y where a b c d are threshold flags 0 1 2 3 Change_set: 1. Get the number of sensor count of this IOC by reading IO Unit page 8 at driver initialization time. 2. Also unmask the Temperature Threshold Event at driver initialization time 3. Whenever a MPI2_EVENT_TEMP_THRESHOLD event is received from the firmware, then print the sensor number, the maximum threshold number it has exceed and the current temperature of this sensor. Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:

committed by
Christoph Hellwig

parent
cb16ef384f
commit
2d8ce8c9d4
@@ -3646,6 +3646,31 @@ _scsih_check_volume_delete_events(struct MPT2SAS_ADAPTER *ioc,
|
||||
le16_to_cpu(event_data->VolDevHandle));
|
||||
}
|
||||
|
||||
/**
|
||||
* _scsih_temp_threshold_events - display temperature threshold exceeded events
|
||||
* @ioc: per adapter object
|
||||
* @event_data: the temp threshold event data
|
||||
* Context: interrupt time.
|
||||
*
|
||||
* Return nothing.
|
||||
*/
|
||||
static void
|
||||
_scsih_temp_threshold_events(struct MPT2SAS_ADAPTER *ioc,
|
||||
Mpi2EventDataTemperature_t *event_data)
|
||||
{
|
||||
if (ioc->temp_sensors_count >= event_data->SensorNum) {
|
||||
printk(MPT2SAS_ERR_FMT "Temperature Threshold flags %s%s%s%s"
|
||||
" exceeded for Sensor: %d !!!\n", ioc->name,
|
||||
((le16_to_cpu(event_data->Status) & 0x1) == 1) ? "0 " : " ",
|
||||
((le16_to_cpu(event_data->Status) & 0x2) == 2) ? "1 " : " ",
|
||||
((le16_to_cpu(event_data->Status) & 0x4) == 4) ? "2 " : " ",
|
||||
((le16_to_cpu(event_data->Status) & 0x8) == 8) ? "3 " : " ",
|
||||
event_data->SensorNum);
|
||||
printk(MPT2SAS_ERR_FMT "Current Temp In Celsius: %d\n",
|
||||
ioc->name, event_data->CurrentTemperature);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* _scsih_flush_running_cmds - completing outstanding commands.
|
||||
* @ioc: per adapter object
|
||||
@@ -7557,6 +7582,12 @@ mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index,
|
||||
case MPI2_EVENT_IR_PHYSICAL_DISK:
|
||||
break;
|
||||
|
||||
case MPI2_EVENT_TEMP_THRESHOLD:
|
||||
_scsih_temp_threshold_events(ioc,
|
||||
(Mpi2EventDataTemperature_t *)
|
||||
mpi_reply->EventData);
|
||||
break;
|
||||
|
||||
default: /* ignore the rest */
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user