lpfc 8.2.3 : Added support for ASICs that report temperature
Subsystems (2)
PATCH 1/9 lpfc 8.2.3 : Added support for ASICs that report temperature
Added support for ASICs that report temperature. Temperature notices are
reported as events and logged. Temperature can be read via sysfs.
Signed-off-by James Smart <[email protected]>
drivers/scsi/lpfc/lpfc_attr.c +12 -0
@@ -86,6 +86,15 @@ lpfc_serialnum_show(struct class_device }static ssize_t +lpfc_temp_sensor_show (struct class_device *cdev,char *buf) +{ +struct Scsi_Host *shost =class_to_shost (cdev); +struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; +struct lpfc_hba *phba = vport->phba; +return snprintf (buf,PAGE_SIZE ,"%d\n" ,phba->temp_sensor_support); +} + +static ssize_t lpfc_modeldesc_show (struct class_device *cdev,char *buf) {struct Scsi_Host *shost =class_to_shost (cdev);
@@ -908,6 +917,8 @@ static CLASS_DEVICE_ATTR(used_rpi, S_IRU static CLASS_DEVICE_ATTR(max_xri, S_IRUGO, lpfc_max_xri_show, NULL); static CLASS_DEVICE_ATTR(used_xri, S_IRUGO, lpfc_used_xri_show, NULL); static CLASS_DEVICE_ATTR(npiv_info, S_IRUGO, lpfc_npiv_info_show, NULL); +static CLASS_DEVICE_ATTR(lpfc_temp_sensor, S_IRUGO, lpfc_temp_sensor_show, + NULL);static char *lpfc_soft_wwn_key ="C99G71SL8032A" ;
@@ -1494,6 +1505,7 @@ struct class_device_attribute *lpfc_hba_ &class_device_attr_state, &class_device_attr_num_discovered_ports, &class_device_attr_lpfc_drvr_version, + &class_device_attr_lpfc_temp_sensor, &class_device_attr_lpfc_log_verbose, &class_device_attr_lpfc_lun_queue_depth, &class_device_attr_lpfc_hba_queue_depth,
drivers/scsi/lpfc/lpfc_crtn.h +2 -0
@@ -23,6 +23,8 @@ typedef int (*node_filter)(struct lpfc_nstruct fc_rport ;void lpfc_dump_mem (struct lpfc_hba *,LPFC_MBOXQ_t *,uint16_t );void lpfc_read_nv (struct lpfc_hba *,LPFC_MBOXQ_t *); +void lpfc_config_async (struct lpfc_hba *,LPFC_MBOXQ_t *,uint32_t ); +void lpfc_heart_beat (struct lpfc_hba *,LPFC_MBOXQ_t *);int lpfc_read_la (struct lpfc_hba * phba,LPFC_MBOXQ_t * pmb,struct lpfc_dmabuf *mp);
drivers/scsi/lpfc/lpfc.h +13 -2
@@ -569,6 +569,7 @@ struct lpfc_hba {atomic_t slow_ring_trc_cnt;#endif +uint8_t temp_sensor_support;/* Fields used for heart beat. */ unsigned long last_completion_time;struct timer_list hb_tmofunc;
@@ -598,5 +599,15 @@ lpfc_is_link_up(struct lpfc_hba *phba) phba->link_state ==LPFC_HBA_READY ; } -#define FC_REG_DUMP_EVENT 0x10/* Register for Dump events */ - +#define FC_REG_DUMP_EVENT 0x10/* Register for Dump events */ +#define FC_REG_TEMPERATURE_EVENT 0x20/* Register for temperature +event */ + +struct temp_event { +uint32_t event_type; +uint32_t event_code; +uint32_t data; +}; +#define LPFC_CRIT_TEMP 0x1 +#define LPFC_THRESHOLD_TEMP 0x2 +#define LPFC_NORMAL_TEMP 0x3
drivers/scsi/lpfc/lpfc_hw.h +35 -1
@@ -1228,7 +1228,8 @@ typedef struct { /* FireFly BIU registe#define HS_FFER3 0x20000000/* Bit 29 */ #define HS_FFER2 0x40000000/* Bit 30 */ #define HS_FFER1 0x80000000/* Bit 31 */ -#define HS_FFERM 0xFF000000/* Mask for error bits 31:24 */ +#define HS_CRIT_TEMP 0x00000100/* Bit 8 */ +#define HS_FFERM 0xFF000100/* Mask for error bits 31:24 and 8 */ /* Host Control Register */
@@ -1282,6 +1283,7 @@ typedef struct { /* FireFly BIU registe#define MBX_KILL_BOARD 0x24#define MBX_CONFIG_FARP 0x25#define MBX_BEACON 0x2A +#define MBX_ASYNCEVT_ENABLE 0x33#define MBX_HEARTBEAT 0x31#define MBX_CONFIG_HBQ 0x7C
@@ -1344,6 +1346,7 @@ typedef struct { /* FireFly BIU registe/* SLI_2 IOCB Command Set */ +#define CMD_ASYNC_STATUS 0x7C#define CMD_RCV_SEQUENCE64_CX 0x81#define CMD_XMIT_SEQUENCE64_CR 0x82#define CMD_XMIT_SEQUENCE64_CX 0x83
@@ -1406,6 +1409,8 @@ typedef struct { /* FireFly BIU registe#define MBX_BUSY 0xffffff/* Attempted cmd to busy Mailbox */ #define MBX_TIMEOUT 0xfffffe/* time-out expired waiting for */ +#define TEMPERATURE_OFFSET 0xB0/* Slim offset for critical temperature event */ +/* * Begin Structure Definitions for Mailbox Commands */
@@ -2606,6 +2611,18 @@ typedef struct {uint32_t IPAddress; }CONFIG_FARP_VAR ; +/* Structure for MB Command MBX_ASYNCEVT_ENABLE (0x33) */ + +typedef struct { +#ifdef __BIG_ENDIAN_BITFIELD +uint32_t rsvd:30 ; +uint32_t ring:2 ;/* Ring for ASYNC_EVENT iocb Bits 0-1*/ +#else /* __LITTLE_ENDIAN */ +uint32_t ring:2 ;/* Ring for ASYNC_EVENT iocb Bits 0-1*/ +uint32_t rsvd:30 ; +#endif +}ASYNCEVT_ENABLE_VAR ; +/* Union of all Mailbox Command types */ #define MAILBOX_CMD_WSIZE 32#define MAILBOX_CMD_SIZE (MAILBOX_CMD_WSIZE * sizeof(uint32_t))
@@ -2645,6 +2662,7 @@ typedef union {CONFIG_PORT_VAR varCfgPort;/* cmd = 0x88 (CONFIG_PORT) */ REG_VPI_VAR varRegVpi;/* cmd = 0x96 (REG_VPI) */ UNREG_VPI_VAR varUnregVpi;/* cmd = 0x97 (UNREG_VPI) */ +ASYNCEVT_ENABLE_VAR varCfgAsyncEvent;/*cmd = x33 (CONFIG_ASYNC) */ }MAILVARIANTS ;/*
@@ -2987,6 +3005,21 @@ typedef struct {uint32_t fcpt_Length;/* transfer ready for IWRITE */ }FCPT_FIELDS64 ; +/* IOCB Command template for Async Status iocb commands */ +typedef struct { +uint32_t rsvd[4 ]; +uint32_t param; +#ifdef __BIG_ENDIAN_BITFIELD +uint16_t evt_code;/* High order bits word 5 */ +uint16_t sub_ctxt_tag;/* Low order bits word 5 */ +#else /* __LITTLE_ENDIAN_BITFIELD */ +uint16_t sub_ctxt_tag;/* High order bits word 5 */ +uint16_t evt_code;/* Low order bits word 5 */ +#endif +}ASYNCSTAT_FIELDS ; +#define ASYNC_TEMP_WARN 0x100 +#define ASYNC_TEMP_SAFE 0x101 +/* IOCB Command template for CMD_IOCB_RCV_ELS64_CX (0xB7) or CMD_IOCB_RCV_SEQ64_CX (0xB5) */
@@ -3028,6 +3061,7 @@ typedef struct _IOCB { /* IOCB structureXMT_SEQ_FIELDS64 xseq64;/* XMIT / BCAST cmd */ FCPI_FIELDS64 fcpi64;/* FCP 64 bit Initiator template */ FCPT_FIELDS64 fcpt64;/* FCP 64 bit target template */ +ASYNCSTAT_FIELDS asyncstat;/* async_status iocb */ uint32_t ulpWord[IOCB_WORD_SZ -2 ];/* generic 6 'words' */ } un;
drivers/scsi/lpfc/lpfc_init.c +55 -0
80 lines not on this page · raw message
drivers/scsi/lpfc/lpfc_logmsg.h +1 -0
@@ -26,6 +26,7 @@#define LOG_IP 0x20/* IP traffic history */ #define LOG_FCP 0x40/* FCP traffic history */ #define LOG_NODE 0x80/* Node table events */ +#define LOG_TEMP 0x100/* Temperature sensor events */ #define LOG_MISC 0x400/* Miscellaneous events */ #define LOG_SLI 0x800/* SLI events */ #define LOG_FCP_ERROR 0x1000/* log errors, not underruns */
drivers/scsi/lpfc/lpfc_mbox.c +18 -0
@@ -82,6 +82,24 @@ lpfc_read_nv(struct lpfc_hba * phba, LPF }/**********************************************/ +/* lpfc_config_async Issue a */ +/* MBX_ASYNC_EVT_ENABLE mailbox command */ +/**********************************************/ +void +lpfc_config_async (struct lpfc_hba * phba,LPFC_MBOXQ_t * pmb, +uint32_t ring) +{ +MAILBOX_t *mb; + + mb = &pmb->mb; +memset (pmb,0 ,sizeof (LPFC_MBOXQ_t)); + mb->mbxCommand =MBX_ASYNCEVT_ENABLE ; + mb->un.varCfgAsyncEvent.ring = ring; + mb->mbxOwner =OWN_HOST ; +return ; +} + +/**********************************************/ /* lpfc_heart_beat Issue a HEART_BEAT */ /* mailbox command */ /**********************************************/
drivers/scsi/lpfc/lpfc_sli.c +76 -0
112 lines not on this page · raw message
drivers/scsi/lpfc/lpfc_sli.h +2 -0
@@ -166,6 +166,8 @@ struct lpfc_sli_ring {struct lpfc_sli_ring_mask prt[LPFC_MAX_RING_MASK ];uint32_t num_mask;/* number of mask entries in prt array */ +void (*lpfc_sli_rcv_async_status) (struct lpfc_hba *, +struct lpfc_sli_ring *,struct lpfc_iocbq *);struct lpfc_sli_ring_stat stats;/* SLI statistical info */