diff options
author | James Smart <james.smart@emulex.com> | 2011-10-10 21:32:43 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-10-16 12:31:19 -0400 |
commit | a183a15f88a6803476abf4c7f097df33f6ca6f92 (patch) | |
tree | 98f4c78eec6d24b9032e1cf099ccda0c9e190212 | |
parent | 73d91e503a60bd164b636258ae9f558b72010602 (diff) |
[SCSI] lpfc 8.3.27: Changed worst case mailbox timeout
Changed the timeout value for flash-based SLI_CONFIG (0x9B)
mailbox command to 300 seconds for worst case flash delays.
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 12 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_crtn.h | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw4.h | 48 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 31 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_mbox.c | 80 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 170 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.h | 18 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli4.h | 4 |
8 files changed, 229 insertions, 136 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 72cb750860d6..4b0333ee2d94 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -4113,8 +4113,10 @@ sysfs_mbox_read(struct file *filp, struct kobject *kobj, | |||
4113 | struct Scsi_Host *shost = class_to_shost(dev); | 4113 | struct Scsi_Host *shost = class_to_shost(dev); |
4114 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; | 4114 | struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; |
4115 | struct lpfc_hba *phba = vport->phba; | 4115 | struct lpfc_hba *phba = vport->phba; |
4116 | int rc; | 4116 | LPFC_MBOXQ_t *mboxq; |
4117 | MAILBOX_t *pmb; | 4117 | MAILBOX_t *pmb; |
4118 | uint32_t mbox_tmo; | ||
4119 | int rc; | ||
4118 | 4120 | ||
4119 | if (off > MAILBOX_CMD_SIZE) | 4121 | if (off > MAILBOX_CMD_SIZE) |
4120 | return -ERANGE; | 4122 | return -ERANGE; |
@@ -4139,7 +4141,8 @@ sysfs_mbox_read(struct file *filp, struct kobject *kobj, | |||
4139 | if (off == 0 && | 4141 | if (off == 0 && |
4140 | phba->sysfs_mbox.state == SMBOX_WRITING && | 4142 | phba->sysfs_mbox.state == SMBOX_WRITING && |
4141 | phba->sysfs_mbox.offset >= 2 * sizeof(uint32_t)) { | 4143 | phba->sysfs_mbox.offset >= 2 * sizeof(uint32_t)) { |
4142 | pmb = &phba->sysfs_mbox.mbox->u.mb; | 4144 | mboxq = (LPFC_MBOXQ_t *)&phba->sysfs_mbox.mbox; |
4145 | pmb = &mboxq->u.mb; | ||
4143 | switch (pmb->mbxCommand) { | 4146 | switch (pmb->mbxCommand) { |
4144 | /* Offline only */ | 4147 | /* Offline only */ |
4145 | case MBX_INIT_LINK: | 4148 | case MBX_INIT_LINK: |
@@ -4249,9 +4252,8 @@ sysfs_mbox_read(struct file *filp, struct kobject *kobj, | |||
4249 | 4252 | ||
4250 | } else { | 4253 | } else { |
4251 | spin_unlock_irq(&phba->hbalock); | 4254 | spin_unlock_irq(&phba->hbalock); |
4252 | rc = lpfc_sli_issue_mbox_wait (phba, | 4255 | mbox_tmo = lpfc_mbox_tmo_val(phba, mboxq); |
4253 | phba->sysfs_mbox.mbox, | 4256 | rc = lpfc_sli_issue_mbox_wait(phba, mboxq, mbox_tmo); |
4254 | lpfc_mbox_tmo_val(phba, pmb->mbxCommand) * HZ); | ||
4255 | spin_lock_irq(&phba->hbalock); | 4257 | spin_lock_irq(&phba->hbalock); |
4256 | } | 4258 | } |
4257 | 4259 | ||
diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index a6db6aef1331..9067831d9223 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h | |||
@@ -209,7 +209,7 @@ void __lpfc_mbox_cmpl_put(struct lpfc_hba *, LPFC_MBOXQ_t *); | |||
209 | void lpfc_mbox_cmpl_put(struct lpfc_hba *, LPFC_MBOXQ_t *); | 209 | void lpfc_mbox_cmpl_put(struct lpfc_hba *, LPFC_MBOXQ_t *); |
210 | int lpfc_mbox_cmd_check(struct lpfc_hba *, LPFC_MBOXQ_t *); | 210 | int lpfc_mbox_cmd_check(struct lpfc_hba *, LPFC_MBOXQ_t *); |
211 | int lpfc_mbox_dev_check(struct lpfc_hba *); | 211 | int lpfc_mbox_dev_check(struct lpfc_hba *); |
212 | int lpfc_mbox_tmo_val(struct lpfc_hba *, int); | 212 | int lpfc_mbox_tmo_val(struct lpfc_hba *, LPFC_MBOXQ_t *); |
213 | void lpfc_init_vfi(struct lpfcMboxq *, struct lpfc_vport *); | 213 | void lpfc_init_vfi(struct lpfcMboxq *, struct lpfc_vport *); |
214 | void lpfc_reg_vfi(struct lpfcMboxq *, struct lpfc_vport *, dma_addr_t); | 214 | void lpfc_reg_vfi(struct lpfcMboxq *, struct lpfc_vport *, dma_addr_t); |
215 | void lpfc_init_vpi(struct lpfc_hba *, struct lpfcMboxq *, uint16_t); | 215 | void lpfc_init_vpi(struct lpfc_hba *, struct lpfcMboxq *, uint16_t); |
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index 7db794aa118c..ca7d137cd45f 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h | |||
@@ -826,6 +826,7 @@ struct mbox_header { | |||
826 | #define LPFC_EXTENT_VERSION_DEFAULT 0 | 826 | #define LPFC_EXTENT_VERSION_DEFAULT 0 |
827 | 827 | ||
828 | /* Subsystem Definitions */ | 828 | /* Subsystem Definitions */ |
829 | #define LPFC_MBOX_SUBSYSTEM_NA 0x0 | ||
829 | #define LPFC_MBOX_SUBSYSTEM_COMMON 0x1 | 830 | #define LPFC_MBOX_SUBSYSTEM_COMMON 0x1 |
830 | #define LPFC_MBOX_SUBSYSTEM_FCOE 0xC | 831 | #define LPFC_MBOX_SUBSYSTEM_FCOE 0xC |
831 | 832 | ||
@@ -836,25 +837,33 @@ struct mbox_header { | |||
836 | #define HOST_ENDIAN_HIGH_WORD1 0xFF7856FF | 837 | #define HOST_ENDIAN_HIGH_WORD1 0xFF7856FF |
837 | 838 | ||
838 | /* Common Opcodes */ | 839 | /* Common Opcodes */ |
839 | #define LPFC_MBOX_OPCODE_CQ_CREATE 0x0C | 840 | #define LPFC_MBOX_OPCODE_NA 0x00 |
840 | #define LPFC_MBOX_OPCODE_EQ_CREATE 0x0D | 841 | #define LPFC_MBOX_OPCODE_CQ_CREATE 0x0C |
841 | #define LPFC_MBOX_OPCODE_MQ_CREATE 0x15 | 842 | #define LPFC_MBOX_OPCODE_EQ_CREATE 0x0D |
842 | #define LPFC_MBOX_OPCODE_GET_CNTL_ATTRIBUTES 0x20 | 843 | #define LPFC_MBOX_OPCODE_MQ_CREATE 0x15 |
843 | #define LPFC_MBOX_OPCODE_NOP 0x21 | 844 | #define LPFC_MBOX_OPCODE_GET_CNTL_ATTRIBUTES 0x20 |
844 | #define LPFC_MBOX_OPCODE_MQ_DESTROY 0x35 | 845 | #define LPFC_MBOX_OPCODE_NOP 0x21 |
845 | #define LPFC_MBOX_OPCODE_CQ_DESTROY 0x36 | 846 | #define LPFC_MBOX_OPCODE_MQ_DESTROY 0x35 |
846 | #define LPFC_MBOX_OPCODE_EQ_DESTROY 0x37 | 847 | #define LPFC_MBOX_OPCODE_CQ_DESTROY 0x36 |
847 | #define LPFC_MBOX_OPCODE_QUERY_FW_CFG 0x3A | 848 | #define LPFC_MBOX_OPCODE_EQ_DESTROY 0x37 |
848 | #define LPFC_MBOX_OPCODE_FUNCTION_RESET 0x3D | 849 | #define LPFC_MBOX_OPCODE_QUERY_FW_CFG 0x3A |
849 | #define LPFC_MBOX_OPCODE_MQ_CREATE_EXT 0x5A | 850 | #define LPFC_MBOX_OPCODE_FUNCTION_RESET 0x3D |
850 | #define LPFC_MBOX_OPCODE_GET_RSRC_EXTENT_INFO 0x9A | 851 | #define LPFC_MBOX_OPCODE_MQ_CREATE_EXT 0x5A |
851 | #define LPFC_MBOX_OPCODE_GET_ALLOC_RSRC_EXTENT 0x9B | 852 | #define LPFC_MBOX_OPCODE_GET_RSRC_EXTENT_INFO 0x9A |
852 | #define LPFC_MBOX_OPCODE_ALLOC_RSRC_EXTENT 0x9C | 853 | #define LPFC_MBOX_OPCODE_GET_ALLOC_RSRC_EXTENT 0x9B |
853 | #define LPFC_MBOX_OPCODE_DEALLOC_RSRC_EXTENT 0x9D | 854 | #define LPFC_MBOX_OPCODE_ALLOC_RSRC_EXTENT 0x9C |
854 | #define LPFC_MBOX_OPCODE_GET_FUNCTION_CONFIG 0xA0 | 855 | #define LPFC_MBOX_OPCODE_DEALLOC_RSRC_EXTENT 0x9D |
855 | #define LPFC_MBOX_OPCODE_GET_PROFILE_CONFIG 0xA4 | 856 | #define LPFC_MBOX_OPCODE_GET_FUNCTION_CONFIG 0xA0 |
856 | #define LPFC_MBOX_OPCODE_WRITE_OBJECT 0xAC | 857 | #define LPFC_MBOX_OPCODE_GET_PROFILE_CONFIG 0xA4 |
857 | #define LPFC_MBOX_OPCODE_GET_SLI4_PARAMETERS 0xB5 | 858 | #define LPFC_MBOX_OPCODE_SET_PROFILE_CONFIG 0xA5 |
859 | #define LPFC_MBOX_OPCODE_GET_PROFILE_LIST 0xA6 | ||
860 | #define LPFC_MBOX_OPCODE_SET_ACT_PROFILE 0xA8 | ||
861 | #define LPFC_MBOX_OPCODE_GET_FACTORY_PROFILE_CONFIG 0xA9 | ||
862 | #define LPFC_MBOX_OPCODE_READ_OBJECT 0xAB | ||
863 | #define LPFC_MBOX_OPCODE_WRITE_OBJECT 0xAC | ||
864 | #define LPFC_MBOX_OPCODE_READ_OBJECT_LIST 0xAD | ||
865 | #define LPFC_MBOX_OPCODE_DELETE_OBJECT 0xAE | ||
866 | #define LPFC_MBOX_OPCODE_GET_SLI4_PARAMETERS 0xB5 | ||
858 | 867 | ||
859 | /* FCoE Opcodes */ | 868 | /* FCoE Opcodes */ |
860 | #define LPFC_MBOX_OPCODE_FCOE_WQ_CREATE 0x01 | 869 | #define LPFC_MBOX_OPCODE_FCOE_WQ_CREATE 0x01 |
@@ -868,6 +877,7 @@ struct mbox_header { | |||
868 | #define LPFC_MBOX_OPCODE_FCOE_DELETE_FCF 0x0A | 877 | #define LPFC_MBOX_OPCODE_FCOE_DELETE_FCF 0x0A |
869 | #define LPFC_MBOX_OPCODE_FCOE_POST_HDR_TEMPLATE 0x0B | 878 | #define LPFC_MBOX_OPCODE_FCOE_POST_HDR_TEMPLATE 0x0B |
870 | #define LPFC_MBOX_OPCODE_FCOE_REDISCOVER_FCF 0x10 | 879 | #define LPFC_MBOX_OPCODE_FCOE_REDISCOVER_FCF 0x10 |
880 | #define LPFC_MBOX_OPCODE_FCOE_SET_FCLINK_SETTINGS 0x21 | ||
871 | #define LPFC_MBOX_OPCODE_FCOE_LINK_DIAG_STATE 0x22 | 881 | #define LPFC_MBOX_OPCODE_FCOE_LINK_DIAG_STATE 0x22 |
872 | #define LPFC_MBOX_OPCODE_FCOE_LINK_DIAG_LOOPBACK 0x23 | 882 | #define LPFC_MBOX_OPCODE_FCOE_LINK_DIAG_LOOPBACK 0x23 |
873 | 883 | ||
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index bdb8f2da27cc..3bdec4b2faae 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -2441,17 +2441,19 @@ lpfc_block_mgmt_io(struct lpfc_hba * phba) | |||
2441 | uint8_t actcmd = MBX_HEARTBEAT; | 2441 | uint8_t actcmd = MBX_HEARTBEAT; |
2442 | unsigned long timeout; | 2442 | unsigned long timeout; |
2443 | 2443 | ||
2444 | 2444 | timeout = msecs_to_jiffies(LPFC_MBOX_TMO * 1000) + jiffies; | |
2445 | spin_lock_irqsave(&phba->hbalock, iflag); | 2445 | spin_lock_irqsave(&phba->hbalock, iflag); |
2446 | phba->sli.sli_flag |= LPFC_BLOCK_MGMT_IO; | 2446 | phba->sli.sli_flag |= LPFC_BLOCK_MGMT_IO; |
2447 | if (phba->sli.mbox_active) | 2447 | if (phba->sli.mbox_active) { |
2448 | actcmd = phba->sli.mbox_active->u.mb.mbxCommand; | 2448 | actcmd = phba->sli.mbox_active->u.mb.mbxCommand; |
2449 | /* Determine how long we might wait for the active mailbox | ||
2450 | * command to be gracefully completed by firmware. | ||
2451 | */ | ||
2452 | timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, | ||
2453 | phba->sli.mbox_active) * 1000) + jiffies; | ||
2454 | } | ||
2449 | spin_unlock_irqrestore(&phba->hbalock, iflag); | 2455 | spin_unlock_irqrestore(&phba->hbalock, iflag); |
2450 | /* Determine how long we might wait for the active mailbox | 2456 | |
2451 | * command to be gracefully completed by firmware. | ||
2452 | */ | ||
2453 | timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, actcmd) * 1000) + | ||
2454 | jiffies; | ||
2455 | /* Wait for the outstnading mailbox command to complete */ | 2457 | /* Wait for the outstnading mailbox command to complete */ |
2456 | while (phba->sli.mbox_active) { | 2458 | while (phba->sli.mbox_active) { |
2457 | /* Check active mailbox complete status every 2ms */ | 2459 | /* Check active mailbox complete status every 2ms */ |
@@ -7158,12 +7160,13 @@ lpfc_sli4_send_nop_mbox_cmds(struct lpfc_hba *phba, uint32_t cnt) | |||
7158 | lpfc_sli4_config(phba, mboxq, LPFC_MBOX_SUBSYSTEM_COMMON, | 7160 | lpfc_sli4_config(phba, mboxq, LPFC_MBOX_SUBSYSTEM_COMMON, |
7159 | LPFC_MBOX_OPCODE_NOP, length, LPFC_SLI4_MBX_EMBED); | 7161 | LPFC_MBOX_OPCODE_NOP, length, LPFC_SLI4_MBX_EMBED); |
7160 | 7162 | ||
7161 | mbox_tmo = lpfc_mbox_tmo_val(phba, MBX_SLI4_CONFIG); | ||
7162 | for (cmdsent = 0; cmdsent < cnt; cmdsent++) { | 7163 | for (cmdsent = 0; cmdsent < cnt; cmdsent++) { |
7163 | if (!phba->sli4_hba.intr_enable) | 7164 | if (!phba->sli4_hba.intr_enable) |
7164 | rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); | 7165 | rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); |
7165 | else | 7166 | else { |
7167 | mbox_tmo = lpfc_mbox_tmo_val(phba, mboxq); | ||
7166 | rc = lpfc_sli_issue_mbox_wait(phba, mboxq, mbox_tmo); | 7168 | rc = lpfc_sli_issue_mbox_wait(phba, mboxq, mbox_tmo); |
7169 | } | ||
7167 | if (rc == MBX_TIMEOUT) | 7170 | if (rc == MBX_TIMEOUT) |
7168 | break; | 7171 | break; |
7169 | /* Check return status */ | 7172 | /* Check return status */ |
@@ -8129,7 +8132,7 @@ lpfc_pc_sli4_params_get(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) | |||
8129 | if (!phba->sli4_hba.intr_enable) | 8132 | if (!phba->sli4_hba.intr_enable) |
8130 | rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); | 8133 | rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); |
8131 | else { | 8134 | else { |
8132 | mbox_tmo = lpfc_mbox_tmo_val(phba, MBX_PORT_CAPABILITIES); | 8135 | mbox_tmo = lpfc_mbox_tmo_val(phba, mboxq); |
8133 | rc = lpfc_sli_issue_mbox_wait(phba, mboxq, mbox_tmo); | 8136 | rc = lpfc_sli_issue_mbox_wait(phba, mboxq, mbox_tmo); |
8134 | } | 8137 | } |
8135 | 8138 | ||
@@ -8191,6 +8194,7 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) | |||
8191 | int rc; | 8194 | int rc; |
8192 | struct lpfc_mqe *mqe = &mboxq->u.mqe; | 8195 | struct lpfc_mqe *mqe = &mboxq->u.mqe; |
8193 | struct lpfc_pc_sli4_params *sli4_params; | 8196 | struct lpfc_pc_sli4_params *sli4_params; |
8197 | uint32_t mbox_tmo; | ||
8194 | int length; | 8198 | int length; |
8195 | struct lpfc_sli4_parameters *mbx_sli4_parameters; | 8199 | struct lpfc_sli4_parameters *mbx_sli4_parameters; |
8196 | 8200 | ||
@@ -8209,9 +8213,10 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) | |||
8209 | length, LPFC_SLI4_MBX_EMBED); | 8213 | length, LPFC_SLI4_MBX_EMBED); |
8210 | if (!phba->sli4_hba.intr_enable) | 8214 | if (!phba->sli4_hba.intr_enable) |
8211 | rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); | 8215 | rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); |
8212 | else | 8216 | else { |
8213 | rc = lpfc_sli_issue_mbox_wait(phba, mboxq, | 8217 | mbox_tmo = lpfc_mbox_tmo_val(phba, mboxq); |
8214 | lpfc_mbox_tmo_val(phba, MBX_SLI4_CONFIG)); | 8218 | rc = lpfc_sli_issue_mbox_wait(phba, mboxq, mbox_tmo); |
8219 | } | ||
8215 | if (unlikely(rc)) | 8220 | if (unlikely(rc)) |
8216 | return rc; | 8221 | return rc; |
8217 | sli4_params = &phba->sli4_hba.pc_sli4_params; | 8222 | sli4_params = &phba->sli4_hba.pc_sli4_params; |
diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c index 83450cc5c4d3..2ebc7d2540c0 100644 --- a/drivers/scsi/lpfc/lpfc_mbox.c +++ b/drivers/scsi/lpfc/lpfc_mbox.c | |||
@@ -1598,9 +1598,12 @@ lpfc_mbox_dev_check(struct lpfc_hba *phba) | |||
1598 | * Timeout value to be used for the given mailbox command | 1598 | * Timeout value to be used for the given mailbox command |
1599 | **/ | 1599 | **/ |
1600 | int | 1600 | int |
1601 | lpfc_mbox_tmo_val(struct lpfc_hba *phba, int cmd) | 1601 | lpfc_mbox_tmo_val(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) |
1602 | { | 1602 | { |
1603 | switch (cmd) { | 1603 | MAILBOX_t *mbox = &mboxq->u.mb; |
1604 | uint8_t subsys, opcode; | ||
1605 | |||
1606 | switch (mbox->mbxCommand) { | ||
1604 | case MBX_WRITE_NV: /* 0x03 */ | 1607 | case MBX_WRITE_NV: /* 0x03 */ |
1605 | case MBX_UPDATE_CFG: /* 0x1B */ | 1608 | case MBX_UPDATE_CFG: /* 0x1B */ |
1606 | case MBX_DOWN_LOAD: /* 0x1C */ | 1609 | case MBX_DOWN_LOAD: /* 0x1C */ |
@@ -1610,6 +1613,28 @@ lpfc_mbox_tmo_val(struct lpfc_hba *phba, int cmd) | |||
1610 | case MBX_LOAD_EXP_ROM: /* 0x9C */ | 1613 | case MBX_LOAD_EXP_ROM: /* 0x9C */ |
1611 | return LPFC_MBOX_TMO_FLASH_CMD; | 1614 | return LPFC_MBOX_TMO_FLASH_CMD; |
1612 | case MBX_SLI4_CONFIG: /* 0x9b */ | 1615 | case MBX_SLI4_CONFIG: /* 0x9b */ |
1616 | subsys = lpfc_sli_config_mbox_subsys_get(phba, mboxq); | ||
1617 | opcode = lpfc_sli_config_mbox_opcode_get(phba, mboxq); | ||
1618 | if (subsys == LPFC_MBOX_SUBSYSTEM_COMMON) { | ||
1619 | switch (opcode) { | ||
1620 | case LPFC_MBOX_OPCODE_READ_OBJECT: | ||
1621 | case LPFC_MBOX_OPCODE_WRITE_OBJECT: | ||
1622 | case LPFC_MBOX_OPCODE_READ_OBJECT_LIST: | ||
1623 | case LPFC_MBOX_OPCODE_DELETE_OBJECT: | ||
1624 | case LPFC_MBOX_OPCODE_GET_FUNCTION_CONFIG: | ||
1625 | case LPFC_MBOX_OPCODE_GET_PROFILE_LIST: | ||
1626 | case LPFC_MBOX_OPCODE_SET_ACT_PROFILE: | ||
1627 | case LPFC_MBOX_OPCODE_SET_PROFILE_CONFIG: | ||
1628 | case LPFC_MBOX_OPCODE_GET_FACTORY_PROFILE_CONFIG: | ||
1629 | return LPFC_MBOX_SLI4_CONFIG_EXTENDED_TMO; | ||
1630 | } | ||
1631 | } | ||
1632 | if (subsys == LPFC_MBOX_SUBSYSTEM_FCOE) { | ||
1633 | switch (opcode) { | ||
1634 | case LPFC_MBOX_OPCODE_FCOE_SET_FCLINK_SETTINGS: | ||
1635 | return LPFC_MBOX_SLI4_CONFIG_EXTENDED_TMO; | ||
1636 | } | ||
1637 | } | ||
1613 | return LPFC_MBOX_SLI4_CONFIG_TMO; | 1638 | return LPFC_MBOX_SLI4_CONFIG_TMO; |
1614 | } | 1639 | } |
1615 | return LPFC_MBOX_TMO; | 1640 | return LPFC_MBOX_TMO; |
@@ -1859,7 +1884,7 @@ lpfc_sli4_mbox_rsrc_extent(struct lpfc_hba *phba, struct lpfcMboxq *mbox, | |||
1859 | } | 1884 | } |
1860 | 1885 | ||
1861 | /* Complete the initialization for the particular Opcode. */ | 1886 | /* Complete the initialization for the particular Opcode. */ |
1862 | opcode = lpfc_sli4_mbox_opcode_get(phba, mbox); | 1887 | opcode = lpfc_sli_config_mbox_opcode_get(phba, mbox); |
1863 | switch (opcode) { | 1888 | switch (opcode) { |
1864 | case LPFC_MBOX_OPCODE_ALLOC_RSRC_EXTENT: | 1889 | case LPFC_MBOX_OPCODE_ALLOC_RSRC_EXTENT: |
1865 | if (emb == LPFC_SLI4_MBX_EMBED) | 1890 | if (emb == LPFC_SLI4_MBX_EMBED) |
@@ -1886,23 +1911,56 @@ lpfc_sli4_mbox_rsrc_extent(struct lpfc_hba *phba, struct lpfcMboxq *mbox, | |||
1886 | } | 1911 | } |
1887 | 1912 | ||
1888 | /** | 1913 | /** |
1889 | * lpfc_sli4_mbox_opcode_get - Get the opcode from a sli4 mailbox command | 1914 | * lpfc_sli_config_mbox_subsys_get - Get subsystem from a sli_config mbox cmd |
1890 | * @phba: pointer to lpfc hba data structure. | 1915 | * @phba: pointer to lpfc hba data structure. |
1891 | * @mbox: pointer to lpfc mbox command. | 1916 | * @mbox: pointer to lpfc mbox command queue entry. |
1917 | * | ||
1918 | * This routine gets the subsystem from a SLI4 specific SLI_CONFIG mailbox | ||
1919 | * command. If the mailbox command is not MBX_SLI4_CONFIG (0x9B) or if the | ||
1920 | * sub-header is not present, subsystem LPFC_MBOX_SUBSYSTEM_NA (0x0) shall | ||
1921 | * be returned. | ||
1922 | **/ | ||
1923 | uint8_t | ||
1924 | lpfc_sli_config_mbox_subsys_get(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) | ||
1925 | { | ||
1926 | struct lpfc_mbx_sli4_config *sli4_cfg; | ||
1927 | union lpfc_sli4_cfg_shdr *cfg_shdr; | ||
1928 | |||
1929 | if (mbox->u.mb.mbxCommand != MBX_SLI4_CONFIG) | ||
1930 | return LPFC_MBOX_SUBSYSTEM_NA; | ||
1931 | sli4_cfg = &mbox->u.mqe.un.sli4_config; | ||
1932 | |||
1933 | /* For embedded mbox command, get opcode from embedded sub-header*/ | ||
1934 | if (bf_get(lpfc_mbox_hdr_emb, &sli4_cfg->header.cfg_mhdr)) { | ||
1935 | cfg_shdr = &mbox->u.mqe.un.sli4_config.header.cfg_shdr; | ||
1936 | return bf_get(lpfc_mbox_hdr_subsystem, &cfg_shdr->request); | ||
1937 | } | ||
1938 | |||
1939 | /* For non-embedded mbox command, get opcode from first dma page */ | ||
1940 | if (unlikely(!mbox->sge_array)) | ||
1941 | return LPFC_MBOX_SUBSYSTEM_NA; | ||
1942 | cfg_shdr = (union lpfc_sli4_cfg_shdr *)mbox->sge_array->addr[0]; | ||
1943 | return bf_get(lpfc_mbox_hdr_subsystem, &cfg_shdr->request); | ||
1944 | } | ||
1945 | |||
1946 | /** | ||
1947 | * lpfc_sli_config_mbox_opcode_get - Get opcode from a sli_config mbox cmd | ||
1948 | * @phba: pointer to lpfc hba data structure. | ||
1949 | * @mbox: pointer to lpfc mbox command queue entry. | ||
1892 | * | 1950 | * |
1893 | * This routine gets the opcode from a SLI4 specific mailbox command for | 1951 | * This routine gets the opcode from a SLI4 specific SLI_CONFIG mailbox |
1894 | * sending IOCTL command. If the mailbox command is not MBX_SLI4_CONFIG | 1952 | * command. If the mailbox command is not MBX_SLI4_CONFIG (0x9B) or if |
1895 | * (0x9B) or if the IOCTL sub-header is not present, opcode 0x0 shall be | 1953 | * the sub-header is not present, opcode LPFC_MBOX_OPCODE_NA (0x0) be |
1896 | * returned. | 1954 | * returned. |
1897 | **/ | 1955 | **/ |
1898 | uint8_t | 1956 | uint8_t |
1899 | lpfc_sli4_mbox_opcode_get(struct lpfc_hba *phba, struct lpfcMboxq *mbox) | 1957 | lpfc_sli_config_mbox_opcode_get(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) |
1900 | { | 1958 | { |
1901 | struct lpfc_mbx_sli4_config *sli4_cfg; | 1959 | struct lpfc_mbx_sli4_config *sli4_cfg; |
1902 | union lpfc_sli4_cfg_shdr *cfg_shdr; | 1960 | union lpfc_sli4_cfg_shdr *cfg_shdr; |
1903 | 1961 | ||
1904 | if (mbox->u.mb.mbxCommand != MBX_SLI4_CONFIG) | 1962 | if (mbox->u.mb.mbxCommand != MBX_SLI4_CONFIG) |
1905 | return 0; | 1963 | return LPFC_MBOX_OPCODE_NA; |
1906 | sli4_cfg = &mbox->u.mqe.un.sli4_config; | 1964 | sli4_cfg = &mbox->u.mqe.un.sli4_config; |
1907 | 1965 | ||
1908 | /* For embedded mbox command, get opcode from embedded sub-header*/ | 1966 | /* For embedded mbox command, get opcode from embedded sub-header*/ |
@@ -1913,7 +1971,7 @@ lpfc_sli4_mbox_opcode_get(struct lpfc_hba *phba, struct lpfcMboxq *mbox) | |||
1913 | 1971 | ||
1914 | /* For non-embedded mbox command, get opcode from first dma page */ | 1972 | /* For non-embedded mbox command, get opcode from first dma page */ |
1915 | if (unlikely(!mbox->sge_array)) | 1973 | if (unlikely(!mbox->sge_array)) |
1916 | return 0; | 1974 | return LPFC_MBOX_OPCODE_NA; |
1917 | cfg_shdr = (union lpfc_sli4_cfg_shdr *)mbox->sge_array->addr[0]; | 1975 | cfg_shdr = (union lpfc_sli4_cfg_shdr *)mbox->sge_array->addr[0]; |
1918 | return bf_get(lpfc_mbox_hdr_opcode, &cfg_shdr->request); | 1976 | return bf_get(lpfc_mbox_hdr_opcode, &cfg_shdr->request); |
1919 | } | 1977 | } |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 332c6b716f81..c48cd0be1a59 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -2200,10 +2200,13 @@ lpfc_sli_handle_mb_event(struct lpfc_hba *phba) | |||
2200 | /* Unknown mailbox command compl */ | 2200 | /* Unknown mailbox command compl */ |
2201 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, | 2201 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, |
2202 | "(%d):0323 Unknown Mailbox command " | 2202 | "(%d):0323 Unknown Mailbox command " |
2203 | "x%x (x%x) Cmpl\n", | 2203 | "x%x (x%x/x%x) Cmpl\n", |
2204 | pmb->vport ? pmb->vport->vpi : 0, | 2204 | pmb->vport ? pmb->vport->vpi : 0, |
2205 | pmbox->mbxCommand, | 2205 | pmbox->mbxCommand, |
2206 | lpfc_sli4_mbox_opcode_get(phba, pmb)); | 2206 | lpfc_sli_config_mbox_subsys_get(phba, |
2207 | pmb), | ||
2208 | lpfc_sli_config_mbox_opcode_get(phba, | ||
2209 | pmb)); | ||
2207 | phba->link_state = LPFC_HBA_ERROR; | 2210 | phba->link_state = LPFC_HBA_ERROR; |
2208 | phba->work_hs = HS_FFER3; | 2211 | phba->work_hs = HS_FFER3; |
2209 | lpfc_handle_eratt(phba); | 2212 | lpfc_handle_eratt(phba); |
@@ -2215,17 +2218,19 @@ lpfc_sli_handle_mb_event(struct lpfc_hba *phba) | |||
2215 | if (pmbox->mbxStatus == MBXERR_NO_RESOURCES) { | 2218 | if (pmbox->mbxStatus == MBXERR_NO_RESOURCES) { |
2216 | /* Mbox cmd cmpl error - RETRYing */ | 2219 | /* Mbox cmd cmpl error - RETRYing */ |
2217 | lpfc_printf_log(phba, KERN_INFO, | 2220 | lpfc_printf_log(phba, KERN_INFO, |
2218 | LOG_MBOX | LOG_SLI, | 2221 | LOG_MBOX | LOG_SLI, |
2219 | "(%d):0305 Mbox cmd cmpl " | 2222 | "(%d):0305 Mbox cmd cmpl " |
2220 | "error - RETRYing Data: x%x " | 2223 | "error - RETRYing Data: x%x " |
2221 | "(x%x) x%x x%x x%x\n", | 2224 | "(x%x/x%x) x%x x%x x%x\n", |
2222 | pmb->vport ? pmb->vport->vpi :0, | 2225 | pmb->vport ? pmb->vport->vpi : 0, |
2223 | pmbox->mbxCommand, | 2226 | pmbox->mbxCommand, |
2224 | lpfc_sli4_mbox_opcode_get(phba, | 2227 | lpfc_sli_config_mbox_subsys_get(phba, |
2225 | pmb), | 2228 | pmb), |
2226 | pmbox->mbxStatus, | 2229 | lpfc_sli_config_mbox_opcode_get(phba, |
2227 | pmbox->un.varWords[0], | 2230 | pmb), |
2228 | pmb->vport->port_state); | 2231 | pmbox->mbxStatus, |
2232 | pmbox->un.varWords[0], | ||
2233 | pmb->vport->port_state); | ||
2229 | pmbox->mbxStatus = 0; | 2234 | pmbox->mbxStatus = 0; |
2230 | pmbox->mbxOwner = OWN_HOST; | 2235 | pmbox->mbxOwner = OWN_HOST; |
2231 | rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT); | 2236 | rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT); |
@@ -2236,11 +2241,12 @@ lpfc_sli_handle_mb_event(struct lpfc_hba *phba) | |||
2236 | 2241 | ||
2237 | /* Mailbox cmd <cmd> Cmpl <cmpl> */ | 2242 | /* Mailbox cmd <cmd> Cmpl <cmpl> */ |
2238 | lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, | 2243 | lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, |
2239 | "(%d):0307 Mailbox cmd x%x (x%x) Cmpl x%p " | 2244 | "(%d):0307 Mailbox cmd x%x (x%x/x%x) Cmpl x%p " |
2240 | "Data: x%x x%x x%x x%x x%x x%x x%x x%x x%x\n", | 2245 | "Data: x%x x%x x%x x%x x%x x%x x%x x%x x%x\n", |
2241 | pmb->vport ? pmb->vport->vpi : 0, | 2246 | pmb->vport ? pmb->vport->vpi : 0, |
2242 | pmbox->mbxCommand, | 2247 | pmbox->mbxCommand, |
2243 | lpfc_sli4_mbox_opcode_get(phba, pmb), | 2248 | lpfc_sli_config_mbox_subsys_get(phba, pmb), |
2249 | lpfc_sli_config_mbox_opcode_get(phba, pmb), | ||
2244 | pmb->mbox_cmpl, | 2250 | pmb->mbox_cmpl, |
2245 | *((uint32_t *) pmbox), | 2251 | *((uint32_t *) pmbox), |
2246 | pmbox->un.varWords[0], | 2252 | pmbox->un.varWords[0], |
@@ -4754,7 +4760,7 @@ lpfc_sli4_get_avail_extnt_rsrc(struct lpfc_hba *phba, uint16_t type, | |||
4754 | if (!phba->sli4_hba.intr_enable) | 4760 | if (!phba->sli4_hba.intr_enable) |
4755 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); | 4761 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); |
4756 | else { | 4762 | else { |
4757 | mbox_tmo = lpfc_mbox_tmo_val(phba, MBX_SLI4_CONFIG); | 4763 | mbox_tmo = lpfc_mbox_tmo_val(phba, mbox); |
4758 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); | 4764 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); |
4759 | } | 4765 | } |
4760 | if (unlikely(rc)) { | 4766 | if (unlikely(rc)) { |
@@ -4911,7 +4917,7 @@ lpfc_sli4_cfg_post_extnts(struct lpfc_hba *phba, uint16_t *extnt_cnt, | |||
4911 | if (!phba->sli4_hba.intr_enable) | 4917 | if (!phba->sli4_hba.intr_enable) |
4912 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); | 4918 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); |
4913 | else { | 4919 | else { |
4914 | mbox_tmo = lpfc_mbox_tmo_val(phba, MBX_SLI4_CONFIG); | 4920 | mbox_tmo = lpfc_mbox_tmo_val(phba, mbox); |
4915 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); | 4921 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); |
4916 | } | 4922 | } |
4917 | 4923 | ||
@@ -5194,7 +5200,7 @@ lpfc_sli4_dealloc_extent(struct lpfc_hba *phba, uint16_t type) | |||
5194 | if (!phba->sli4_hba.intr_enable) | 5200 | if (!phba->sli4_hba.intr_enable) |
5195 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); | 5201 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); |
5196 | else { | 5202 | else { |
5197 | mbox_tmo = lpfc_mbox_tmo_val(phba, mbox_tmo); | 5203 | mbox_tmo = lpfc_mbox_tmo_val(phba, mbox); |
5198 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); | 5204 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); |
5199 | } | 5205 | } |
5200 | if (unlikely(rc)) { | 5206 | if (unlikely(rc)) { |
@@ -5619,7 +5625,7 @@ lpfc_sli4_get_allocated_extnts(struct lpfc_hba *phba, uint16_t type, | |||
5619 | if (!phba->sli4_hba.intr_enable) | 5625 | if (!phba->sli4_hba.intr_enable) |
5620 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); | 5626 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); |
5621 | else { | 5627 | else { |
5622 | mbox_tmo = lpfc_mbox_tmo_val(phba, MBX_SLI4_CONFIG); | 5628 | mbox_tmo = lpfc_mbox_tmo_val(phba, mbox); |
5623 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); | 5629 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); |
5624 | } | 5630 | } |
5625 | 5631 | ||
@@ -6322,7 +6328,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, | |||
6322 | } | 6328 | } |
6323 | /* timeout active mbox command */ | 6329 | /* timeout active mbox command */ |
6324 | mod_timer(&psli->mbox_tmo, (jiffies + | 6330 | mod_timer(&psli->mbox_tmo, (jiffies + |
6325 | (HZ * lpfc_mbox_tmo_val(phba, mb->mbxCommand)))); | 6331 | (HZ * lpfc_mbox_tmo_val(phba, pmbox)))); |
6326 | } | 6332 | } |
6327 | 6333 | ||
6328 | /* Mailbox cmd <cmd> issue */ | 6334 | /* Mailbox cmd <cmd> issue */ |
@@ -6446,9 +6452,8 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, | |||
6446 | drvr_flag); | 6452 | drvr_flag); |
6447 | goto out_not_finished; | 6453 | goto out_not_finished; |
6448 | } | 6454 | } |
6449 | timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, | 6455 | timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, pmbox) * |
6450 | mb->mbxCommand) * | 6456 | 1000) + jiffies; |
6451 | 1000) + jiffies; | ||
6452 | i = 0; | 6457 | i = 0; |
6453 | /* Wait for command to complete */ | 6458 | /* Wait for command to complete */ |
6454 | while (((word0 & OWN_CHIP) == OWN_CHIP) || | 6459 | while (((word0 & OWN_CHIP) == OWN_CHIP) || |
@@ -6559,21 +6564,21 @@ static int | |||
6559 | lpfc_sli4_async_mbox_block(struct lpfc_hba *phba) | 6564 | lpfc_sli4_async_mbox_block(struct lpfc_hba *phba) |
6560 | { | 6565 | { |
6561 | struct lpfc_sli *psli = &phba->sli; | 6566 | struct lpfc_sli *psli = &phba->sli; |
6562 | uint8_t actcmd = MBX_HEARTBEAT; | ||
6563 | int rc = 0; | 6567 | int rc = 0; |
6564 | unsigned long timeout; | 6568 | unsigned long timeout = 0; |
6565 | 6569 | ||
6566 | /* Mark the asynchronous mailbox command posting as blocked */ | 6570 | /* Mark the asynchronous mailbox command posting as blocked */ |
6567 | spin_lock_irq(&phba->hbalock); | 6571 | spin_lock_irq(&phba->hbalock); |
6568 | psli->sli_flag |= LPFC_SLI_ASYNC_MBX_BLK; | 6572 | psli->sli_flag |= LPFC_SLI_ASYNC_MBX_BLK; |
6569 | if (phba->sli.mbox_active) | ||
6570 | actcmd = phba->sli.mbox_active->u.mb.mbxCommand; | ||
6571 | spin_unlock_irq(&phba->hbalock); | ||
6572 | /* Determine how long we might wait for the active mailbox | 6573 | /* Determine how long we might wait for the active mailbox |
6573 | * command to be gracefully completed by firmware. | 6574 | * command to be gracefully completed by firmware. |
6574 | */ | 6575 | */ |
6575 | timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, actcmd) * 1000) + | 6576 | if (phba->sli.mbox_active) |
6576 | jiffies; | 6577 | timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, |
6578 | phba->sli.mbox_active) * | ||
6579 | 1000) + jiffies; | ||
6580 | spin_unlock_irq(&phba->hbalock); | ||
6581 | |||
6577 | /* Wait for the outstnading mailbox command to complete */ | 6582 | /* Wait for the outstnading mailbox command to complete */ |
6578 | while (phba->sli.mbox_active) { | 6583 | while (phba->sli.mbox_active) { |
6579 | /* Check active mailbox complete status every 2ms */ | 6584 | /* Check active mailbox complete status every 2ms */ |
@@ -6668,11 +6673,12 @@ lpfc_sli4_post_sync_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) | |||
6668 | if (psli->sli_flag & LPFC_SLI_MBOX_ACTIVE) { | 6673 | if (psli->sli_flag & LPFC_SLI_MBOX_ACTIVE) { |
6669 | spin_unlock_irqrestore(&phba->hbalock, iflag); | 6674 | spin_unlock_irqrestore(&phba->hbalock, iflag); |
6670 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, | 6675 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, |
6671 | "(%d):2532 Mailbox command x%x (x%x) " | 6676 | "(%d):2532 Mailbox command x%x (x%x/x%x) " |
6672 | "cannot issue Data: x%x x%x\n", | 6677 | "cannot issue Data: x%x x%x\n", |
6673 | mboxq->vport ? mboxq->vport->vpi : 0, | 6678 | mboxq->vport ? mboxq->vport->vpi : 0, |
6674 | mboxq->u.mb.mbxCommand, | 6679 | mboxq->u.mb.mbxCommand, |
6675 | lpfc_sli4_mbox_opcode_get(phba, mboxq), | 6680 | lpfc_sli_config_mbox_subsys_get(phba, mboxq), |
6681 | lpfc_sli_config_mbox_opcode_get(phba, mboxq), | ||
6676 | psli->sli_flag, MBX_POLL); | 6682 | psli->sli_flag, MBX_POLL); |
6677 | return MBXERR_ERROR; | 6683 | return MBXERR_ERROR; |
6678 | } | 6684 | } |
@@ -6695,7 +6701,7 @@ lpfc_sli4_post_sync_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) | |||
6695 | dma_address = &phba->sli4_hba.bmbx.dma_address; | 6701 | dma_address = &phba->sli4_hba.bmbx.dma_address; |
6696 | writel(dma_address->addr_hi, phba->sli4_hba.BMBXregaddr); | 6702 | writel(dma_address->addr_hi, phba->sli4_hba.BMBXregaddr); |
6697 | 6703 | ||
6698 | timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, mbx_cmnd) | 6704 | timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, mboxq) |
6699 | * 1000) + jiffies; | 6705 | * 1000) + jiffies; |
6700 | do { | 6706 | do { |
6701 | bmbx_reg.word0 = readl(phba->sli4_hba.BMBXregaddr); | 6707 | bmbx_reg.word0 = readl(phba->sli4_hba.BMBXregaddr); |
@@ -6711,7 +6717,7 @@ lpfc_sli4_post_sync_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) | |||
6711 | 6717 | ||
6712 | /* Post the low mailbox dma address to the port. */ | 6718 | /* Post the low mailbox dma address to the port. */ |
6713 | writel(dma_address->addr_lo, phba->sli4_hba.BMBXregaddr); | 6719 | writel(dma_address->addr_lo, phba->sli4_hba.BMBXregaddr); |
6714 | timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, mbx_cmnd) | 6720 | timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, mboxq) |
6715 | * 1000) + jiffies; | 6721 | * 1000) + jiffies; |
6716 | do { | 6722 | do { |
6717 | bmbx_reg.word0 = readl(phba->sli4_hba.BMBXregaddr); | 6723 | bmbx_reg.word0 = readl(phba->sli4_hba.BMBXregaddr); |
@@ -6750,11 +6756,12 @@ lpfc_sli4_post_sync_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) | |||
6750 | lpfc_sli4_swap_str(phba, mboxq); | 6756 | lpfc_sli4_swap_str(phba, mboxq); |
6751 | 6757 | ||
6752 | lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, | 6758 | lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, |
6753 | "(%d):0356 Mailbox cmd x%x (x%x) Status x%x " | 6759 | "(%d):0356 Mailbox cmd x%x (x%x/x%x) Status x%x " |
6754 | "Data: x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x" | 6760 | "Data: x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x x%x" |
6755 | " x%x x%x CQ: x%x x%x x%x x%x\n", | 6761 | " x%x x%x CQ: x%x x%x x%x x%x\n", |
6756 | mboxq->vport ? mboxq->vport->vpi : 0, | 6762 | mboxq->vport ? mboxq->vport->vpi : 0, mbx_cmnd, |
6757 | mbx_cmnd, lpfc_sli4_mbox_opcode_get(phba, mboxq), | 6763 | lpfc_sli_config_mbox_subsys_get(phba, mboxq), |
6764 | lpfc_sli_config_mbox_opcode_get(phba, mboxq), | ||
6758 | bf_get(lpfc_mqe_status, mb), | 6765 | bf_get(lpfc_mqe_status, mb), |
6759 | mb->un.mb_words[0], mb->un.mb_words[1], | 6766 | mb->un.mb_words[0], mb->un.mb_words[1], |
6760 | mb->un.mb_words[2], mb->un.mb_words[3], | 6767 | mb->un.mb_words[2], mb->un.mb_words[3], |
@@ -6800,11 +6807,12 @@ lpfc_sli_issue_mbox_s4(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq, | |||
6800 | rc = lpfc_mbox_dev_check(phba); | 6807 | rc = lpfc_mbox_dev_check(phba); |
6801 | if (unlikely(rc)) { | 6808 | if (unlikely(rc)) { |
6802 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, | 6809 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, |
6803 | "(%d):2544 Mailbox command x%x (x%x) " | 6810 | "(%d):2544 Mailbox command x%x (x%x/x%x) " |
6804 | "cannot issue Data: x%x x%x\n", | 6811 | "cannot issue Data: x%x x%x\n", |
6805 | mboxq->vport ? mboxq->vport->vpi : 0, | 6812 | mboxq->vport ? mboxq->vport->vpi : 0, |
6806 | mboxq->u.mb.mbxCommand, | 6813 | mboxq->u.mb.mbxCommand, |
6807 | lpfc_sli4_mbox_opcode_get(phba, mboxq), | 6814 | lpfc_sli_config_mbox_subsys_get(phba, mboxq), |
6815 | lpfc_sli_config_mbox_opcode_get(phba, mboxq), | ||
6808 | psli->sli_flag, flag); | 6816 | psli->sli_flag, flag); |
6809 | goto out_not_finished; | 6817 | goto out_not_finished; |
6810 | } | 6818 | } |
@@ -6818,20 +6826,25 @@ lpfc_sli_issue_mbox_s4(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq, | |||
6818 | if (rc != MBX_SUCCESS) | 6826 | if (rc != MBX_SUCCESS) |
6819 | lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI, | 6827 | lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI, |
6820 | "(%d):2541 Mailbox command x%x " | 6828 | "(%d):2541 Mailbox command x%x " |
6821 | "(x%x) cannot issue Data: x%x x%x\n", | 6829 | "(x%x/x%x) cannot issue Data: " |
6830 | "x%x x%x\n", | ||
6822 | mboxq->vport ? mboxq->vport->vpi : 0, | 6831 | mboxq->vport ? mboxq->vport->vpi : 0, |
6823 | mboxq->u.mb.mbxCommand, | 6832 | mboxq->u.mb.mbxCommand, |
6824 | lpfc_sli4_mbox_opcode_get(phba, mboxq), | 6833 | lpfc_sli_config_mbox_subsys_get(phba, |
6834 | mboxq), | ||
6835 | lpfc_sli_config_mbox_opcode_get(phba, | ||
6836 | mboxq), | ||
6825 | psli->sli_flag, flag); | 6837 | psli->sli_flag, flag); |
6826 | return rc; | 6838 | return rc; |
6827 | } else if (flag == MBX_POLL) { | 6839 | } else if (flag == MBX_POLL) { |
6828 | lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI, | 6840 | lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI, |
6829 | "(%d):2542 Try to issue mailbox command " | 6841 | "(%d):2542 Try to issue mailbox command " |
6830 | "x%x (x%x) synchronously ahead of async" | 6842 | "x%x (x%x/x%x) synchronously ahead of async" |
6831 | "mailbox command queue: x%x x%x\n", | 6843 | "mailbox command queue: x%x x%x\n", |
6832 | mboxq->vport ? mboxq->vport->vpi : 0, | 6844 | mboxq->vport ? mboxq->vport->vpi : 0, |
6833 | mboxq->u.mb.mbxCommand, | 6845 | mboxq->u.mb.mbxCommand, |
6834 | lpfc_sli4_mbox_opcode_get(phba, mboxq), | 6846 | lpfc_sli_config_mbox_subsys_get(phba, mboxq), |
6847 | lpfc_sli_config_mbox_opcode_get(phba, mboxq), | ||
6835 | psli->sli_flag, flag); | 6848 | psli->sli_flag, flag); |
6836 | /* Try to block the asynchronous mailbox posting */ | 6849 | /* Try to block the asynchronous mailbox posting */ |
6837 | rc = lpfc_sli4_async_mbox_block(phba); | 6850 | rc = lpfc_sli4_async_mbox_block(phba); |
@@ -6840,16 +6853,18 @@ lpfc_sli_issue_mbox_s4(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq, | |||
6840 | rc = lpfc_sli4_post_sync_mbox(phba, mboxq); | 6853 | rc = lpfc_sli4_post_sync_mbox(phba, mboxq); |
6841 | if (rc != MBX_SUCCESS) | 6854 | if (rc != MBX_SUCCESS) |
6842 | lpfc_printf_log(phba, KERN_ERR, | 6855 | lpfc_printf_log(phba, KERN_ERR, |
6843 | LOG_MBOX | LOG_SLI, | 6856 | LOG_MBOX | LOG_SLI, |
6844 | "(%d):2597 Mailbox command " | 6857 | "(%d):2597 Mailbox command " |
6845 | "x%x (x%x) cannot issue " | 6858 | "x%x (x%x/x%x) cannot issue " |
6846 | "Data: x%x x%x\n", | 6859 | "Data: x%x x%x\n", |
6847 | mboxq->vport ? | 6860 | mboxq->vport ? |
6848 | mboxq->vport->vpi : 0, | 6861 | mboxq->vport->vpi : 0, |
6849 | mboxq->u.mb.mbxCommand, | 6862 | mboxq->u.mb.mbxCommand, |
6850 | lpfc_sli4_mbox_opcode_get(phba, | 6863 | lpfc_sli_config_mbox_subsys_get(phba, |
6851 | mboxq), | 6864 | mboxq), |
6852 | psli->sli_flag, flag); | 6865 | lpfc_sli_config_mbox_opcode_get(phba, |
6866 | mboxq), | ||
6867 | psli->sli_flag, flag); | ||
6853 | /* Unblock the async mailbox posting afterward */ | 6868 | /* Unblock the async mailbox posting afterward */ |
6854 | lpfc_sli4_async_mbox_unblock(phba); | 6869 | lpfc_sli4_async_mbox_unblock(phba); |
6855 | } | 6870 | } |
@@ -6860,11 +6875,12 @@ lpfc_sli_issue_mbox_s4(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq, | |||
6860 | rc = lpfc_mbox_cmd_check(phba, mboxq); | 6875 | rc = lpfc_mbox_cmd_check(phba, mboxq); |
6861 | if (rc) { | 6876 | if (rc) { |
6862 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, | 6877 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, |
6863 | "(%d):2543 Mailbox command x%x (x%x) " | 6878 | "(%d):2543 Mailbox command x%x (x%x/x%x) " |
6864 | "cannot issue Data: x%x x%x\n", | 6879 | "cannot issue Data: x%x x%x\n", |
6865 | mboxq->vport ? mboxq->vport->vpi : 0, | 6880 | mboxq->vport ? mboxq->vport->vpi : 0, |
6866 | mboxq->u.mb.mbxCommand, | 6881 | mboxq->u.mb.mbxCommand, |
6867 | lpfc_sli4_mbox_opcode_get(phba, mboxq), | 6882 | lpfc_sli_config_mbox_subsys_get(phba, mboxq), |
6883 | lpfc_sli_config_mbox_opcode_get(phba, mboxq), | ||
6868 | psli->sli_flag, flag); | 6884 | psli->sli_flag, flag); |
6869 | goto out_not_finished; | 6885 | goto out_not_finished; |
6870 | } | 6886 | } |
@@ -6876,10 +6892,11 @@ lpfc_sli_issue_mbox_s4(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq, | |||
6876 | spin_unlock_irqrestore(&phba->hbalock, iflags); | 6892 | spin_unlock_irqrestore(&phba->hbalock, iflags); |
6877 | lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, | 6893 | lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, |
6878 | "(%d):0354 Mbox cmd issue - Enqueue Data: " | 6894 | "(%d):0354 Mbox cmd issue - Enqueue Data: " |
6879 | "x%x (x%x) x%x x%x x%x\n", | 6895 | "x%x (x%x/x%x) x%x x%x x%x\n", |
6880 | mboxq->vport ? mboxq->vport->vpi : 0xffffff, | 6896 | mboxq->vport ? mboxq->vport->vpi : 0xffffff, |
6881 | bf_get(lpfc_mqe_command, &mboxq->u.mqe), | 6897 | bf_get(lpfc_mqe_command, &mboxq->u.mqe), |
6882 | lpfc_sli4_mbox_opcode_get(phba, mboxq), | 6898 | lpfc_sli_config_mbox_subsys_get(phba, mboxq), |
6899 | lpfc_sli_config_mbox_opcode_get(phba, mboxq), | ||
6883 | phba->pport->port_state, | 6900 | phba->pport->port_state, |
6884 | psli->sli_flag, MBX_NOWAIT); | 6901 | psli->sli_flag, MBX_NOWAIT); |
6885 | /* Wake up worker thread to transport mailbox command from head */ | 6902 | /* Wake up worker thread to transport mailbox command from head */ |
@@ -6956,13 +6973,14 @@ lpfc_sli4_post_async_mbox(struct lpfc_hba *phba) | |||
6956 | 6973 | ||
6957 | /* Start timer for the mbox_tmo and log some mailbox post messages */ | 6974 | /* Start timer for the mbox_tmo and log some mailbox post messages */ |
6958 | mod_timer(&psli->mbox_tmo, (jiffies + | 6975 | mod_timer(&psli->mbox_tmo, (jiffies + |
6959 | (HZ * lpfc_mbox_tmo_val(phba, mbx_cmnd)))); | 6976 | (HZ * lpfc_mbox_tmo_val(phba, mboxq)))); |
6960 | 6977 | ||
6961 | lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, | 6978 | lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, |
6962 | "(%d):0355 Mailbox cmd x%x (x%x) issue Data: " | 6979 | "(%d):0355 Mailbox cmd x%x (x%x/x%x) issue Data: " |
6963 | "x%x x%x\n", | 6980 | "x%x x%x\n", |
6964 | mboxq->vport ? mboxq->vport->vpi : 0, mbx_cmnd, | 6981 | mboxq->vport ? mboxq->vport->vpi : 0, mbx_cmnd, |
6965 | lpfc_sli4_mbox_opcode_get(phba, mboxq), | 6982 | lpfc_sli_config_mbox_subsys_get(phba, mboxq), |
6983 | lpfc_sli_config_mbox_opcode_get(phba, mboxq), | ||
6966 | phba->pport->port_state, psli->sli_flag); | 6984 | phba->pport->port_state, psli->sli_flag); |
6967 | 6985 | ||
6968 | if (mbx_cmnd != MBX_HEARTBEAT) { | 6986 | if (mbx_cmnd != MBX_HEARTBEAT) { |
@@ -6986,11 +7004,12 @@ lpfc_sli4_post_async_mbox(struct lpfc_hba *phba) | |||
6986 | rc = lpfc_sli4_mq_put(phba->sli4_hba.mbx_wq, mqe); | 7004 | rc = lpfc_sli4_mq_put(phba->sli4_hba.mbx_wq, mqe); |
6987 | if (rc != MBX_SUCCESS) { | 7005 | if (rc != MBX_SUCCESS) { |
6988 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, | 7006 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, |
6989 | "(%d):2533 Mailbox command x%x (x%x) " | 7007 | "(%d):2533 Mailbox command x%x (x%x/x%x) " |
6990 | "cannot issue Data: x%x x%x\n", | 7008 | "cannot issue Data: x%x x%x\n", |
6991 | mboxq->vport ? mboxq->vport->vpi : 0, | 7009 | mboxq->vport ? mboxq->vport->vpi : 0, |
6992 | mboxq->u.mb.mbxCommand, | 7010 | mboxq->u.mb.mbxCommand, |
6993 | lpfc_sli4_mbox_opcode_get(phba, mboxq), | 7011 | lpfc_sli_config_mbox_subsys_get(phba, mboxq), |
7012 | lpfc_sli_config_mbox_opcode_get(phba, mboxq), | ||
6994 | psli->sli_flag, MBX_NOWAIT); | 7013 | psli->sli_flag, MBX_NOWAIT); |
6995 | goto out_not_finished; | 7014 | goto out_not_finished; |
6996 | } | 7015 | } |
@@ -9407,23 +9426,24 @@ void | |||
9407 | lpfc_sli_mbox_sys_shutdown(struct lpfc_hba *phba) | 9426 | lpfc_sli_mbox_sys_shutdown(struct lpfc_hba *phba) |
9408 | { | 9427 | { |
9409 | struct lpfc_sli *psli = &phba->sli; | 9428 | struct lpfc_sli *psli = &phba->sli; |
9410 | uint8_t actcmd = MBX_HEARTBEAT; | ||
9411 | unsigned long timeout; | 9429 | unsigned long timeout; |
9412 | 9430 | ||
9431 | timeout = msecs_to_jiffies(LPFC_MBOX_TMO * 1000) + jiffies; | ||
9413 | spin_lock_irq(&phba->hbalock); | 9432 | spin_lock_irq(&phba->hbalock); |
9414 | psli->sli_flag |= LPFC_SLI_ASYNC_MBX_BLK; | 9433 | psli->sli_flag |= LPFC_SLI_ASYNC_MBX_BLK; |
9415 | spin_unlock_irq(&phba->hbalock); | 9434 | spin_unlock_irq(&phba->hbalock); |
9416 | 9435 | ||
9417 | if (psli->sli_flag & LPFC_SLI_ACTIVE) { | 9436 | if (psli->sli_flag & LPFC_SLI_ACTIVE) { |
9418 | spin_lock_irq(&phba->hbalock); | 9437 | spin_lock_irq(&phba->hbalock); |
9419 | if (phba->sli.mbox_active) | ||
9420 | actcmd = phba->sli.mbox_active->u.mb.mbxCommand; | ||
9421 | spin_unlock_irq(&phba->hbalock); | ||
9422 | /* Determine how long we might wait for the active mailbox | 9438 | /* Determine how long we might wait for the active mailbox |
9423 | * command to be gracefully completed by firmware. | 9439 | * command to be gracefully completed by firmware. |
9424 | */ | 9440 | */ |
9425 | timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, actcmd) * | 9441 | if (phba->sli.mbox_active) |
9426 | 1000) + jiffies; | 9442 | timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, |
9443 | phba->sli.mbox_active) * | ||
9444 | 1000) + jiffies; | ||
9445 | spin_unlock_irq(&phba->hbalock); | ||
9446 | |||
9427 | while (phba->sli.mbox_active) { | 9447 | while (phba->sli.mbox_active) { |
9428 | /* Check active mailbox complete status every 2ms */ | 9448 | /* Check active mailbox complete status every 2ms */ |
9429 | msleep(2); | 9449 | msleep(2); |
@@ -12532,7 +12552,7 @@ lpfc_sli4_post_sgl(struct lpfc_hba *phba, | |||
12532 | if (!phba->sli4_hba.intr_enable) | 12552 | if (!phba->sli4_hba.intr_enable) |
12533 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); | 12553 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); |
12534 | else { | 12554 | else { |
12535 | mbox_tmo = lpfc_mbox_tmo_val(phba, MBX_SLI4_CONFIG); | 12555 | mbox_tmo = lpfc_mbox_tmo_val(phba, mbox); |
12536 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); | 12556 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); |
12537 | } | 12557 | } |
12538 | /* The IOCTL status is embedded in the mailbox subheader. */ | 12558 | /* The IOCTL status is embedded in the mailbox subheader. */ |
@@ -12747,7 +12767,7 @@ lpfc_sli4_post_els_sgl_list(struct lpfc_hba *phba) | |||
12747 | if (!phba->sli4_hba.intr_enable) | 12767 | if (!phba->sli4_hba.intr_enable) |
12748 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); | 12768 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); |
12749 | else { | 12769 | else { |
12750 | mbox_tmo = lpfc_mbox_tmo_val(phba, MBX_SLI4_CONFIG); | 12770 | mbox_tmo = lpfc_mbox_tmo_val(phba, mbox); |
12751 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); | 12771 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); |
12752 | } | 12772 | } |
12753 | shdr = (union lpfc_sli4_cfg_shdr *) &sgl->cfg_shdr; | 12773 | shdr = (union lpfc_sli4_cfg_shdr *) &sgl->cfg_shdr; |
@@ -12910,7 +12930,7 @@ lpfc_sli4_post_els_sgl_list_ext(struct lpfc_hba *phba) | |||
12910 | if (!phba->sli4_hba.intr_enable) | 12930 | if (!phba->sli4_hba.intr_enable) |
12911 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); | 12931 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); |
12912 | else { | 12932 | else { |
12913 | mbox_tmo = lpfc_mbox_tmo_val(phba, MBX_SLI4_CONFIG); | 12933 | mbox_tmo = lpfc_mbox_tmo_val(phba, mbox); |
12914 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); | 12934 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); |
12915 | } | 12935 | } |
12916 | shdr = (union lpfc_sli4_cfg_shdr *) &sgl->cfg_shdr; | 12936 | shdr = (union lpfc_sli4_cfg_shdr *) &sgl->cfg_shdr; |
@@ -13034,7 +13054,7 @@ lpfc_sli4_post_scsi_sgl_block(struct lpfc_hba *phba, struct list_head *sblist, | |||
13034 | if (!phba->sli4_hba.intr_enable) | 13054 | if (!phba->sli4_hba.intr_enable) |
13035 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); | 13055 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); |
13036 | else { | 13056 | else { |
13037 | mbox_tmo = lpfc_mbox_tmo_val(phba, MBX_SLI4_CONFIG); | 13057 | mbox_tmo = lpfc_mbox_tmo_val(phba, mbox); |
13038 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); | 13058 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); |
13039 | } | 13059 | } |
13040 | shdr = (union lpfc_sli4_cfg_shdr *) &sgl->cfg_shdr; | 13060 | shdr = (union lpfc_sli4_cfg_shdr *) &sgl->cfg_shdr; |
@@ -13190,7 +13210,7 @@ lpfc_sli4_post_scsi_sgl_blk_ext(struct lpfc_hba *phba, struct list_head *sblist, | |||
13190 | if (!phba->sli4_hba.intr_enable) | 13210 | if (!phba->sli4_hba.intr_enable) |
13191 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); | 13211 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); |
13192 | else { | 13212 | else { |
13193 | mbox_tmo = lpfc_mbox_tmo_val(phba, MBX_SLI4_CONFIG); | 13213 | mbox_tmo = lpfc_mbox_tmo_val(phba, mbox); |
13194 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); | 13214 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); |
13195 | } | 13215 | } |
13196 | shdr = (union lpfc_sli4_cfg_shdr *) &sgl->cfg_shdr; | 13216 | shdr = (union lpfc_sli4_cfg_shdr *) &sgl->cfg_shdr; |
@@ -14356,7 +14376,7 @@ lpfc_sli4_init_vpi(struct lpfc_vport *vport) | |||
14356 | if (!mboxq) | 14376 | if (!mboxq) |
14357 | return -ENOMEM; | 14377 | return -ENOMEM; |
14358 | lpfc_init_vpi(phba, mboxq, vport->vpi); | 14378 | lpfc_init_vpi(phba, mboxq, vport->vpi); |
14359 | mbox_tmo = lpfc_mbox_tmo_val(phba, MBX_INIT_VPI); | 14379 | mbox_tmo = lpfc_mbox_tmo_val(phba, mboxq); |
14360 | rc = lpfc_sli_issue_mbox_wait(phba, mboxq, mbox_tmo); | 14380 | rc = lpfc_sli_issue_mbox_wait(phba, mboxq, mbox_tmo); |
14361 | if (rc != MBX_SUCCESS) { | 14381 | if (rc != MBX_SUCCESS) { |
14362 | lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI, | 14382 | lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI, |
@@ -15232,7 +15252,7 @@ lpfc_wr_object(struct lpfc_hba *phba, struct list_head *dmabuf_list, | |||
15232 | if (!phba->sli4_hba.intr_enable) | 15252 | if (!phba->sli4_hba.intr_enable) |
15233 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); | 15253 | rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); |
15234 | else { | 15254 | else { |
15235 | mbox_tmo = lpfc_mbox_tmo_val(phba, MBX_SLI4_CONFIG); | 15255 | mbox_tmo = lpfc_mbox_tmo_val(phba, mbox); |
15236 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); | 15256 | rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); |
15237 | } | 15257 | } |
15238 | /* The IOCTL status is embedded in the mailbox subheader. */ | 15258 | /* The IOCTL status is embedded in the mailbox subheader. */ |
diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h index a0075b0af142..29c13b63e323 100644 --- a/drivers/scsi/lpfc/lpfc_sli.h +++ b/drivers/scsi/lpfc/lpfc_sli.h | |||
@@ -293,13 +293,11 @@ struct lpfc_sli { | |||
293 | struct lpfc_lnk_stat lnk_stat_offsets; | 293 | struct lpfc_lnk_stat lnk_stat_offsets; |
294 | }; | 294 | }; |
295 | 295 | ||
296 | #define LPFC_MBOX_TMO 30 /* Sec tmo for outstanding mbox | 296 | /* Timeout for normal outstanding mbox command (Seconds) */ |
297 | command */ | 297 | #define LPFC_MBOX_TMO 30 |
298 | #define LPFC_MBOX_SLI4_CONFIG_TMO 60 /* Sec tmo for outstanding mbox | 298 | /* Timeout for non-flash-based outstanding sli_config mbox command (Seconds) */ |
299 | command */ | 299 | #define LPFC_MBOX_SLI4_CONFIG_TMO 60 |
300 | #define LPFC_MBOX_TMO_FLASH_CMD 300 /* Sec tmo for outstanding FLASH write | 300 | /* Timeout for flash-based outstanding sli_config mbox command (Seconds) */ |
301 | * or erase cmds. This is especially | 301 | #define LPFC_MBOX_SLI4_CONFIG_EXTENDED_TMO 300 |
302 | * long because of the potential of | 302 | /* Timeout for other flash-based outstanding mbox command (Seconds) */ |
303 | * multiple flash erases that can be | 303 | #define LPFC_MBOX_TMO_FLASH_CMD 300 |
304 | * spawned. | ||
305 | */ | ||
diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h index 7888964d5b7a..78c6038c5abc 100644 --- a/drivers/scsi/lpfc/lpfc_sli4.h +++ b/drivers/scsi/lpfc/lpfc_sli4.h | |||
@@ -635,5 +635,5 @@ void lpfc_mbx_cmpl_fcf_rr_read_fcf_rec(struct lpfc_hba *, LPFC_MBOXQ_t *); | |||
635 | void lpfc_mbx_cmpl_read_fcf_rec(struct lpfc_hba *, LPFC_MBOXQ_t *); | 635 | void lpfc_mbx_cmpl_read_fcf_rec(struct lpfc_hba *, LPFC_MBOXQ_t *); |
636 | int lpfc_sli4_unregister_fcf(struct lpfc_hba *); | 636 | int lpfc_sli4_unregister_fcf(struct lpfc_hba *); |
637 | int lpfc_sli4_post_status_check(struct lpfc_hba *); | 637 | int lpfc_sli4_post_status_check(struct lpfc_hba *); |
638 | uint8_t lpfc_sli4_mbox_opcode_get(struct lpfc_hba *, struct lpfcMboxq *); | 638 | uint8_t lpfc_sli_config_mbox_subsys_get(struct lpfc_hba *, LPFC_MBOXQ_t *); |
639 | 639 | uint8_t lpfc_sli_config_mbox_opcode_get(struct lpfc_hba *, LPFC_MBOXQ_t *); | |