lpfc 8.3.0 : Add small features, enhance PCIE EEH support
Subsystems (2)
PATCH 6/14 lpfc 8.3.0 : Add small features, enhance PCIE EEH support
lpfc 8.3.0 : Added 3 small features and improve PCI EEH support
- Added FC_REG_VPORTRSCN_EVENT to lpfc_nl.h
- Added code to provide option ROM version from HBA and via sysfs
- Added support for HPS bit in config port mailbox command to tell HBA that host group pointers are in host memory.
- Bugfix for Extended Error Handling (EEH) support on IBM PowerPC P6 platform with MSI enabled
Signed-off-by James Smart <[email protected]>
---
drivers/scsi/lpfc/lpfc_crtn.h | 1 + drivers/scsi/lpfc/lpfc_hw.h | 37 +++++++++++++++++++++++-- drivers/scsi/lpfc/lpfc_init.c | 61 ++++++++++++++++++++++++++++++++++++++++- drivers/scsi/lpfc/lpfc_mbox.c | 35 ++++++++++++++++++++++++ drivers/scsi/lpfc/lpfc_nl.h | 16 ++++++----- 5 files changed, 139 insertions(+), 11 deletions(-)
drivers/scsi/lpfc/lpfc_crtn.h +1 -0
@@ -22,6 +22,7 @@ typedef int (*node_filter)(struct lpfc_nodelist *, void *);struct fc_rport ;void lpfc_dump_mem (struct lpfc_hba *,LPFC_MBOXQ_t *,uint16_t ); +void lpfc_dump_wakeup_param (struct lpfc_hba *,LPFC_MBOXQ_t *);void lpfc_read_nv (struct lpfc_hba *,LPFC_MBOXQ_t *);void lpfc_config_async (struct lpfc_hba *,LPFC_MBOXQ_t *,uint32_t );
drivers/scsi/lpfc/lpfc_hw.h +34 -3
@@ -2362,6 +2362,30 @@ typedef struct {#define DMP_RSP_OFFSET 0x14/* word 5 contains first word of rsp */ #define DMP_RSP_SIZE 0x6C/* maximum of 27 words of rsp data */ +#define WAKE_UP_PARMS_REGION_ID 4 +#define WAKE_UP_PARMS_WORD_SIZE 15 + +/* Option rom version structure */ +struct prog_id { +#ifdef __BIG_ENDIAN_BITFIELD +uint8_t type; +uint8_t id; +uint32_t ver:4 ;/* Major Version */ +uint32_t rev:4 ;/* Revision */ +uint32_t lev:2 ;/* Level */ +uint32_t dist:2 ;/* Dist Type */ +uint32_t num:4 ;/* number after dist type */ +#else /* __LITTLE_ENDIAN_BITFIELD */ +uint32_t num:4 ;/* number after dist type */ +uint32_t dist:2 ;/* Dist Type */ +uint32_t lev:2 ;/* Level */ +uint32_t rev:4 ;/* Revision */ +uint32_t ver:4 ;/* Major Version */ +uint8_t id; +uint8_t type; +#endif +}; +/* Structure for MB Command UPDATE_CFG (0x1B) */ struct update_cfg_var {
@@ -2555,10 +2579,17 @@ typedef struct {uint32_t pcbLow;/* bit 31:0 of memory based port config block */ uint32_t pcbHigh;/* bit 63:32 of memory based port config block */ -uint32_t hbainit[6 ]; +uint32_t hbainit[5 ]; +#ifdef __BIG_ENDIAN_BITFIELD + uint32_t hps : 1; /* bit 31 word9 Host Pointer in slim */ + uint32_t rsvd : 31; /* least significant 31 bits of word 9 */ +#else /* __LITTLE_ENDIAN */ + uint32_t rsvd : 31; /* least significant 31 bits of word 9 */ + uint32_t hps : 1; /* bit 31 word9 Host Pointer in slim */ +#endif #ifdef __BIG_ENDIAN_BITFIELD - uint32_t rsvd : 24; /* Reserved */ + uint32_t rsvd1 : 24; /* Reserved */ uint32_t cmv : 1; /* Configure Max VPIs */ uint32_t ccrp : 1; /* Config Command Ring Polling */ uint32_t csah : 1; /* Configure Synchronous Abort Handling */
@@ -2576,7 +2607,7 @@ typedef struct { uint32_t csah : 1; /* Configure Synchronous Abort Handling */ uint32_t ccrp : 1; /* Config Command Ring Polling */ uint32_t cmv : 1; /* Configure Max VPIs */ - uint32_t rsvd : 24; /* Reserved */ + uint32_t rsvd1 : 24; /* Reserved */#endif #ifdef __BIG_ENDIAN_BITFIELD uint32_t rsvd2 : 24; /* Reserved */
drivers/scsi/lpfc/lpfc_init.c +60 -1
85 lines not on this page · raw message
drivers/scsi/lpfc/lpfc_mbox.c +35 -0
@@ -77,6 +77,38 @@ lpfc_dump_mem(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb, uint16_t offset) }/** +* lpfc_dump_mem: Prepare a mailbox command for retrieving wakeup params. +* @phba: pointer to lpfc hba data structure. +* @pmb: pointer to the driver internal queue element for mailbox command. +* This function create a dump memory mailbox command to dump wake up +* parameters. +*/ +void +lpfc_dump_wakeup_param (struct lpfc_hba *phba,LPFC_MBOXQ_t *pmb) +{ +MAILBOX_t *mb; +void *ctx; + + mb = &pmb->mb; +/* Save context so that we can restore after memset */ + ctx = pmb->context2; + +/* Setup to dump VPD region */ +memset (pmb,0 ,sizeof (LPFC_MBOXQ_t)); + mb->mbxCommand =MBX_DUMP_MEMORY ; + mb->mbxOwner =OWN_HOST ; + mb->un.varDmp.cv =1 ; + mb->un.varDmp.type =DMP_NV_PARAMS ; + mb->un.varDmp.entry_index =0 ; + mb->un.varDmp.region_id =WAKE_UP_PARMS_REGION_ID ; + mb->un.varDmp.word_cnt =WAKE_UP_PARMS_WORD_SIZE ; + mb->un.varDmp.co =0 ; + mb->un.varDmp.resp_offset =0 ; + pmb->context2 = ctx; +return ; +} + +/** * lpfc_read_nv: Prepare a mailbox command for reading HBA's NVRAM param. * @phba: pointer to lpfc hba data structure. * @pmb: pointer to the driver internal queue element for mailbox command.
@@ -1061,6 +1093,9 @@ lpfc_config_port(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) mb->un.varCfgPort.pcbLow =putPaddrLow (pdma_addr); mb->un.varCfgPort.pcbHigh =putPaddrHigh (pdma_addr); +/* Always Host Group Pointer is in SLIM */ + mb->un.varCfgPort.hps =1 ; +/* If HBA supports SLI=3 ask for it */ if (phba->sli_rev ==3 && phba->vpd.sli3Feat.cerbm) {
drivers/scsi/lpfc/lpfc_nl.h +9 -7
@@ -22,18 +22,20 @@#define FC_REG_LINK_EVENT 0x0001/* link up / down events */ #define FC_REG_RSCN_EVENT 0x0002/* RSCN events */ #define FC_REG_CT_EVENT 0x0004/* CT request events */ -#define FC_REG_DUMP_EVENT 0x0008/* Dump events */ -#define FC_REG_TEMPERATURE_EVENT 0x0010/* temperature events */ -#define FC_REG_ELS_EVENT 0x0020/* lpfc els events */ -#define FC_REG_FABRIC_EVENT 0x0040/* lpfc fabric events */ -#define FC_REG_SCSI_EVENT 0x0080/* lpfc scsi events */ -#define FC_REG_BOARD_EVENT 0x0100/* lpfc board events */ -#define FC_REG_ADAPTER_EVENT 0x0200/* lpfc adapter events */ +#define FC_REG_DUMP_EVENT 0x0010/* Dump events */ +#define FC_REG_TEMPERATURE_EVENT 0x0020/* temperature events */ +#define FC_REG_VPORTRSCN_EVENT 0x0040/* Vport RSCN events */ +#define FC_REG_ELS_EVENT 0x0080/* lpfc els events */ +#define FC_REG_FABRIC_EVENT 0x0100/* lpfc fabric events */ +#define FC_REG_SCSI_EVENT 0x0200/* lpfc scsi events */ +#define FC_REG_BOARD_EVENT 0x0400/* lpfc board events */ +#define FC_REG_ADAPTER_EVENT 0x0800/* lpfc adapter events */ #define FC_REG_EVENT_MASK (FC_REG_LINK_EVENT | \ FC_REG_RSCN_EVENT | \ FC_REG_CT_EVENT | \ FC_REG_DUMP_EVENT | \ FC_REG_TEMPERATURE_EVENT | \ + FC_REG_VPORTRSCN_EVENT | \ FC_REG_ELS_EVENT | \ FC_REG_FABRIC_EVENT | \ FC_REG_SCSI_EVENT | \