pm80xx: Firmware logging support.
Subsystems (2)
PATCH RESEND v3 10/10 pm80xx: Firmware logging support.
Quoted 1 line
From
04613f7a890f4a3d4bcf3dcd9f7b001b03acc1ecMon Sep 17 00:00:00 2001
From: Anand Kumar Santhanam <[email protected]>
Date: Wed, 4 Sep 2013 12:57:00 +0530
Subject: [PATCH V3 10/10 RESEND] pm80xx: Firmware logging support.
Supports below logging facilities,
Inbound outbound queues dump.
Non fatal dump in case of IO failures.
Fatal dump in case of firmware failure.
Signed-off-by [email protected]
Reviewed-by Jack Wang <[email protected]>
--- drivers/scsi/pm8001/pm8001_ctl.c | 113 +++++++++++++++++++ drivers/scsi/pm8001/pm8001_ctl.h | 4 + drivers/scsi/pm8001/pm8001_defs.h | 3 +- drivers/scsi/pm8001/pm8001_hwi.c | 83 ++++++++++++++ drivers/scsi/pm8001/pm8001_hwi.h | 3 + drivers/scsi/pm8001/pm8001_init.c | 4 + drivers/scsi/pm8001/pm8001_sas.h | 68 +++++++++++ drivers/scsi/pm8001/pm80xx_hwi.c | 225 +++++++++++++++++++++++++++++++++++++ drivers/scsi/pm8001/pm80xx_hwi.h | 2 + 9 files changed, 504 insertions(+), 1 deletions(-)
drivers/scsi/pm8001/pm8001_ctl.c +113 -0
@@ -309,6 +309,78 @@ static ssize_t pm8001_ctl_aap_log_show(struct device *cdev, } static DEVICE_ATTR(aap_log, S_IRUGO, pm8001_ctl_aap_log_show, NULL);/** +* pm8001_ctl_ib_queue_log_show - Out bound Queue log +* @cdev:pointer to embedded class device +* @buf: the buffer returned +* A sysfs 'read-only' shost attribute. +*/ +static ssize_t pm8001_ctl_ib_queue_log_show (struct device *cdev, +struct device_attribute *attr,char *buf) +{ +struct Scsi_Host *shost =class_to_shost (cdev); +struct sas_ha_struct *sha =SHOST_TO_SAS_HA (shost); +struct pm8001_hba_info *pm8001_ha = sha->lldd_ha; +int offset; +char *str = buf; +int start =0 ; +#define IB_MEMMAP (c) \ + (*(u32 *)((u8 *)pm8001_ha-> \ + memoryMap.region[IB].virt_ptr + \ + pm8001_ha->evtlog_ib_offset + (c))) + +for (offset =0 ; offset <IB_OB_READ_TIMES ; offset++) { + str +=sprintf (str,"0x%08x\n" ,IB_MEMMAP (start)); + start = start +4 ; + } + pm8001_ha->evtlog_ib_offset +=SYSFS_OFFSET ; +if ((((pm8001_ha->evtlog_ib_offset) % (PM80XX_IB_OB_QUEUE_SIZE )) ==0 ) + && (pm8001_ha->chip_id != chip_8001)) + pm8001_ha->evtlog_ib_offset =0 ; +if ((((pm8001_ha->evtlog_ib_offset) % (PM8001_IB_OB_QUEUE_SIZE )) ==0 ) + && (pm8001_ha->chip_id == chip_8001)) + pm8001_ha->evtlog_ib_offset =0 ; + +return str - buf; +} + +static DEVICE_ATTR(ib_log, S_IRUGO, pm8001_ctl_ib_queue_log_show, NULL); +/** +* pm8001_ctl_ob_queue_log_show - Out bound Queue log +* @cdev:pointer to embedded class device +* @buf: the buffer returned +* A sysfs 'read-only' shost attribute. +*/ + +static ssize_t pm8001_ctl_ob_queue_log_show (struct device *cdev, +struct device_attribute *attr,char *buf) +{ +struct Scsi_Host *shost =class_to_shost (cdev); +struct sas_ha_struct *sha =SHOST_TO_SAS_HA (shost); +struct pm8001_hba_info *pm8001_ha = sha->lldd_ha; +int offset; +char *str = buf; +int start =0 ; +#define OB_MEMMAP (c) \ + (*(u32 *)((u8 *)pm8001_ha-> \ + memoryMap.region[OB].virt_ptr + \ + pm8001_ha->evtlog_ob_offset + (c))) + +for (offset =0 ; offset <IB_OB_READ_TIMES ; offset++) { + str +=sprintf (str,"0x%08x\n" ,OB_MEMMAP (start)); + start = start +4 ; + } + pm8001_ha->evtlog_ob_offset +=SYSFS_OFFSET ; +if ((((pm8001_ha->evtlog_ob_offset) % (PM80XX_IB_OB_QUEUE_SIZE )) ==0 ) + && (pm8001_ha->chip_id != chip_8001)) + pm8001_ha->evtlog_ob_offset =0 ; +if ((((pm8001_ha->evtlog_ob_offset) % (PM8001_IB_OB_QUEUE_SIZE )) ==0 ) + && (pm8001_ha->chip_id == chip_8001)) + pm8001_ha->evtlog_ob_offset =0 ; + +return str - buf; +} +static DEVICE_ATTR(ob_log, S_IRUGO, pm8001_ctl_ob_queue_log_show, NULL); +/** * pm8001_ctl_bios_version_show - Bios version Display * @cdev:pointer to embedded class device * @buf:the buffer returned
@@ -377,6 +449,43 @@ static ssize_t pm8001_ctl_iop_log_show(struct device *cdev, } static DEVICE_ATTR(iop_log, S_IRUGO, pm8001_ctl_iop_log_show, NULL); +/** +** pm8001_ctl_fatal_log_show - fatal error logging +** @cdev:pointer to embedded class device +** @buf: the buffer returned +** +** A sysfs 'read-only' shost attribute. +**/ + +static ssize_t pm8001_ctl_fatal_log_show (struct device *cdev, +struct device_attribute *attr,char *buf) +{ +u32 count; + + count =pm80xx_get_fatal_dump (cdev, attr, buf); +return count; +} + +static DEVICE_ATTR(fatal_log, S_IRUGO, pm8001_ctl_fatal_log_show, NULL); + + +/** +** pm8001_ctl_gsm_log_show - gsm dump collection +** @cdev:pointer to embedded class device +** @buf: the buffer returned +**A sysfs 'read-only' shost attribute. +**/ +static ssize_t pm8001_ctl_gsm_log_show (struct device *cdev, +struct device_attribute *attr,char *buf) +{ +u32 count; + + count =pm8001_get_gsm_dump (cdev,SYSFS_OFFSET , buf); +return count; +} + +static DEVICE_ATTR(gsm_log, S_IRUGO, pm8001_ctl_gsm_log_show, NULL); +#define FLASH_CMD_NONE 0x00#define FLASH_CMD_UPDATE 0x01#define FLASH_CMD_SET_NVMD 0x02
@@ -636,6 +745,8 @@ struct device_attribute *pm8001_host_attrs[] = { &dev_attr_update_fw, &dev_attr_aap_log, &dev_attr_iop_log, + &dev_attr_fatal_log, + &dev_attr_gsm_log, &dev_attr_max_out_io, &dev_attr_max_devices, &dev_attr_max_sg_list,
@@ -643,6 +754,8 @@ struct device_attribute *pm8001_host_attrs[] = { &dev_attr_logging_level, &dev_attr_host_sas_address, &dev_attr_bios_version, + &dev_attr_ib_log, + &dev_attr_ob_log, NULL, };
drivers/scsi/pm8001/pm8001_ctl.h +4 -0
@@ -55,5 +55,9 @@#define FAIL_OUT_MEMORY 0x000c00#define FLASH_IN_PROGRESS 0x001000 +#define IB_OB_READ_TIMES 256 +#define SYSFS_OFFSET 1024 +#define PM80XX_IB_OB_QUEUE_SIZE (32 * 1024) +#define PM8001_IB_OB_QUEUE_SIZE (16 * 1024)#endif /* PM8001_CTL_H_INCLUDED */
drivers/scsi/pm8001/pm8001_defs.h +2 -1
@@ -102,7 +102,8 @@ enum memory_region_num {NVMD ,/* NVM device */ DEV_MEM ,/* memory for devices */ CCB_MEM ,/* memory for command control block */ - FW_FLASH /* memory for fw flash update */ +FW_FLASH ,/* memory for fw flash update */ + FORENSIC_MEM /* memory for fw forensic data */ };#define PM8001_EVENT_LOG_SIZE (128 * 1024)
drivers/scsi/pm8001/pm8001_hwi.c +83 -0
89 lines not on this page · raw message
drivers/scsi/pm8001/pm8001_hwi.h +3 -0
@@ -1027,5 +1027,8 @@ struct set_dev_state_resp {#define DEVREG_FAILURE_PORT_NOT_VALID_STATE 0x06#define DEVREG_FAILURE_DEVICE_TYPE_NOT_VALID 0x07 +#define GSM_BASE 0x4F0000 +#define SHIFT_REG_64K_MASK 0xffff0000 +#define SHIFT_REG_BIT_SHIFT 8#endif
drivers/scsi/pm8001/pm8001_init.c +4 -0
@@ -347,6 +347,10 @@ static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha,/* Memory region for fw flash */ pm8001_ha->memoryMap.region[FW_FLASH ].total_len =4096 ; + pm8001_ha->memoryMap.region[FORENSIC_MEM ].num_elements =1 ; + pm8001_ha->memoryMap.region[FORENSIC_MEM ].total_len =0x10000 ; + pm8001_ha->memoryMap.region[FORENSIC_MEM ].element_size =0x10000 ; + pm8001_ha->memoryMap.region[FORENSIC_MEM ].alignment =0x10000 ;for (i =0 ; i <USI_MAX_MEMCNT ; i++) { if (pm8001_mem_alloc(pm8001_ha->pdev, &pm8001_ha->memoryMap.region[i].virt_ptr,
drivers/scsi/pm8001/pm8001_sas.h +68 -0
98 lines not on this page · raw message
drivers/scsi/pm8001/pm80xx_hwi.c +225 -0
237 lines not on this page · raw message
drivers/scsi/pm8001/pm80xx_hwi.h +2 -0
@@ -1525,4 +1525,6 @@ typedef struct SASProtocolTimerConfig SASProtocolTimerConfig_t;#define DEVREG_FAILURE_PORT_NOT_VALID_STATE 0x06#define DEVREG_FAILURE_DEVICE_TYPE_NOT_VALID 0x07 + +#define MEMBASE_II_SHIFT_REGISTER 0x1010#endif
Signature · 1 line
1.7.1