diff options
author | James Smart <james.smart@emulex.com> | 2011-12-13 13:22:17 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-12-15 01:57:44 -0500 |
commit | df9e1b59f9e4671930a7762b9518461df4ea85f5 (patch) | |
tree | b5e81d6b02f138cb272c7f9020828184dccdb966 /drivers/scsi | |
parent | cb69f7decc3777822b240c46890a209df288c7bb (diff) |
[SCSI] Lpfc 8.3.28: FC and SCSI Discovery Fixes
FC and SCSI Discovery Fixes:
- Clear the virtual fabrics bit (word 1 bit 30) when sending the FLOGI
and FDISC. (CR 124339)
- Return a MLQUEUE_DEVICE_BUSY if the driver detects that an I/O is being
retried too quickly (CR 124668)
- Remove NDLP reference put in lpfc_cmpl_els_logo_acc for all but fabric
nodes (CR 123924)
- Only retry FDISCs every second and stop retrying after devloss number
of retries (CR 13939)
- Check to see if vports are unloading before adding them to the vport
work array. (CR 124996)
- Fixed illegal state transition during driver unload (CR 124191)
- Added missing protection on setting/clearing of vport->fc_flag bit (CR 126002)
- Set NPIV flag in lpfc_mbx_process_link_up for all ports sli3 and
above. (CR 126094)
- Clear FCP command bytes that are not used. (CR 126209)
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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 23 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 29 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw.h | 6 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw4.h | 2 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_nportdisc.c | 10 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 13 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.h | 5 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_vport.c | 6 |
8 files changed, 75 insertions, 19 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 46876941bac6..0b662db23284 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c | |||
@@ -1075,6 +1075,7 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
1075 | /* Setup CSPs accordingly for Fabric */ | 1075 | /* Setup CSPs accordingly for Fabric */ |
1076 | sp->cmn.e_d_tov = 0; | 1076 | sp->cmn.e_d_tov = 0; |
1077 | sp->cmn.w2.r_a_tov = 0; | 1077 | sp->cmn.w2.r_a_tov = 0; |
1078 | sp->cmn.virtual_fabric_support = 0; | ||
1078 | sp->cls1.classValid = 0; | 1079 | sp->cls1.classValid = 0; |
1079 | sp->cls2.seqDelivery = 1; | 1080 | sp->cls2.seqDelivery = 1; |
1080 | sp->cls3.seqDelivery = 1; | 1081 | sp->cls3.seqDelivery = 1; |
@@ -3066,17 +3067,22 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, | |||
3066 | if (did == FDMI_DID) | 3067 | if (did == FDMI_DID) |
3067 | retry = 1; | 3068 | retry = 1; |
3068 | 3069 | ||
3069 | if (((cmd == ELS_CMD_FLOGI) || (cmd == ELS_CMD_FDISC)) && | 3070 | if ((cmd == ELS_CMD_FLOGI) && |
3070 | (phba->fc_topology != LPFC_TOPOLOGY_LOOP) && | 3071 | (phba->fc_topology != LPFC_TOPOLOGY_LOOP) && |
3071 | !lpfc_error_lost_link(irsp)) { | 3072 | !lpfc_error_lost_link(irsp)) { |
3072 | /* FLOGI retry policy */ | 3073 | /* FLOGI retry policy */ |
3073 | retry = 1; | 3074 | retry = 1; |
3074 | /* retry forever */ | 3075 | /* retry FLOGI forever */ |
3075 | maxretry = 0; | 3076 | maxretry = 0; |
3076 | if (cmdiocb->retry >= 100) | 3077 | if (cmdiocb->retry >= 100) |
3077 | delay = 5000; | 3078 | delay = 5000; |
3078 | else if (cmdiocb->retry >= 32) | 3079 | else if (cmdiocb->retry >= 32) |
3079 | delay = 1000; | 3080 | delay = 1000; |
3081 | } else if ((cmd == ELS_CMD_FDISC) && !lpfc_error_lost_link(irsp)) { | ||
3082 | /* retry FDISCs every second up to devloss */ | ||
3083 | retry = 1; | ||
3084 | maxretry = vport->cfg_devloss_tmo; | ||
3085 | delay = 1000; | ||
3080 | } | 3086 | } |
3081 | 3087 | ||
3082 | cmdiocb->retry++; | 3088 | cmdiocb->retry++; |
@@ -3389,11 +3395,17 @@ lpfc_cmpl_els_logo_acc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, | |||
3389 | 3395 | ||
3390 | /* | 3396 | /* |
3391 | * The driver received a LOGO from the rport and has ACK'd it. | 3397 | * The driver received a LOGO from the rport and has ACK'd it. |
3392 | * At this point, the driver is done so release the IOCB and | 3398 | * At this point, the driver is done so release the IOCB |
3393 | * remove the ndlp reference. | ||
3394 | */ | 3399 | */ |
3395 | lpfc_els_free_iocb(phba, cmdiocb); | 3400 | lpfc_els_free_iocb(phba, cmdiocb); |
3396 | lpfc_nlp_put(ndlp); | 3401 | |
3402 | /* | ||
3403 | * Remove the ndlp reference if it's a fabric node that has | ||
3404 | * sent us an unsolicted LOGO. | ||
3405 | */ | ||
3406 | if (ndlp->nlp_type & NLP_FABRIC) | ||
3407 | lpfc_nlp_put(ndlp); | ||
3408 | |||
3397 | return; | 3409 | return; |
3398 | } | 3410 | } |
3399 | 3411 | ||
@@ -7231,6 +7243,7 @@ lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
7231 | /* Setup CSPs accordingly for Fabric */ | 7243 | /* Setup CSPs accordingly for Fabric */ |
7232 | sp->cmn.e_d_tov = 0; | 7244 | sp->cmn.e_d_tov = 0; |
7233 | sp->cmn.w2.r_a_tov = 0; | 7245 | sp->cmn.w2.r_a_tov = 0; |
7246 | sp->cmn.virtual_fabric_support = 0; | ||
7234 | sp->cls1.classValid = 0; | 7247 | sp->cls1.classValid = 0; |
7235 | sp->cls2.seqDelivery = 1; | 7248 | sp->cls2.seqDelivery = 1; |
7236 | sp->cls3.seqDelivery = 1; | 7249 | sp->cls3.seqDelivery = 1; |
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 99c76677e394..d96498581ebe 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -2646,9 +2646,14 @@ lpfc_init_vfi_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) | |||
2646 | { | 2646 | { |
2647 | struct lpfc_vport *vport = mboxq->vport; | 2647 | struct lpfc_vport *vport = mboxq->vport; |
2648 | 2648 | ||
2649 | /* VFI not supported on interface type 0, just do the flogi */ | 2649 | /* |
2650 | if (mboxq->u.mb.mbxStatus && (bf_get(lpfc_sli_intf_if_type, | 2650 | * VFI not supported on interface type 0, just do the flogi |
2651 | &phba->sli4_hba.sli_intf) != LPFC_SLI_INTF_IF_TYPE_0)) { | 2651 | * Also continue if the VFI is in use - just use the same one. |
2652 | */ | ||
2653 | if (mboxq->u.mb.mbxStatus && | ||
2654 | (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) != | ||
2655 | LPFC_SLI_INTF_IF_TYPE_0) && | ||
2656 | mboxq->u.mb.mbxStatus != MBX_VFI_IN_USE) { | ||
2652 | lpfc_printf_vlog(vport, KERN_ERR, | 2657 | lpfc_printf_vlog(vport, KERN_ERR, |
2653 | LOG_MBOX, | 2658 | LOG_MBOX, |
2654 | "2891 Init VFI mailbox failed 0x%x\n", | 2659 | "2891 Init VFI mailbox failed 0x%x\n", |
@@ -2922,6 +2927,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la) | |||
2922 | { | 2927 | { |
2923 | struct lpfc_vport *vport = phba->pport; | 2928 | struct lpfc_vport *vport = phba->pport; |
2924 | LPFC_MBOXQ_t *sparam_mbox, *cfglink_mbox = NULL; | 2929 | LPFC_MBOXQ_t *sparam_mbox, *cfglink_mbox = NULL; |
2930 | struct Scsi_Host *shost; | ||
2925 | int i; | 2931 | int i; |
2926 | struct lpfc_dmabuf *mp; | 2932 | struct lpfc_dmabuf *mp; |
2927 | int rc; | 2933 | int rc; |
@@ -2945,6 +2951,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la) | |||
2945 | phba->fc_topology = bf_get(lpfc_mbx_read_top_topology, la); | 2951 | phba->fc_topology = bf_get(lpfc_mbx_read_top_topology, la); |
2946 | phba->link_flag &= ~LS_NPIV_FAB_SUPPORTED; | 2952 | phba->link_flag &= ~LS_NPIV_FAB_SUPPORTED; |
2947 | 2953 | ||
2954 | shost = lpfc_shost_from_vport(vport); | ||
2948 | if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) { | 2955 | if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) { |
2949 | phba->sli3_options &= ~LPFC_SLI3_NPIV_ENABLED; | 2956 | phba->sli3_options &= ~LPFC_SLI3_NPIV_ENABLED; |
2950 | 2957 | ||
@@ -2956,8 +2963,11 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la) | |||
2956 | "1309 Link Up Event npiv not supported in loop " | 2963 | "1309 Link Up Event npiv not supported in loop " |
2957 | "topology\n"); | 2964 | "topology\n"); |
2958 | /* Get Loop Map information */ | 2965 | /* Get Loop Map information */ |
2959 | if (bf_get(lpfc_mbx_read_top_il, la)) | 2966 | if (bf_get(lpfc_mbx_read_top_il, la)) { |
2967 | spin_lock_irq(shost->host_lock); | ||
2960 | vport->fc_flag |= FC_LBIT; | 2968 | vport->fc_flag |= FC_LBIT; |
2969 | spin_unlock_irq(shost->host_lock); | ||
2970 | } | ||
2961 | 2971 | ||
2962 | vport->fc_myDID = bf_get(lpfc_mbx_read_top_alpa_granted, la); | 2972 | vport->fc_myDID = bf_get(lpfc_mbx_read_top_alpa_granted, la); |
2963 | i = la->lilpBde64.tus.f.bdeSize; | 2973 | i = la->lilpBde64.tus.f.bdeSize; |
@@ -3002,11 +3012,13 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la) | |||
3002 | } else { | 3012 | } else { |
3003 | if (!(phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)) { | 3013 | if (!(phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)) { |
3004 | if (phba->max_vpi && phba->cfg_enable_npiv && | 3014 | if (phba->max_vpi && phba->cfg_enable_npiv && |
3005 | (phba->sli_rev == 3)) | 3015 | (phba->sli_rev >= LPFC_SLI_REV3)) |
3006 | phba->sli3_options |= LPFC_SLI3_NPIV_ENABLED; | 3016 | phba->sli3_options |= LPFC_SLI3_NPIV_ENABLED; |
3007 | } | 3017 | } |
3008 | vport->fc_myDID = phba->fc_pref_DID; | 3018 | vport->fc_myDID = phba->fc_pref_DID; |
3019 | spin_lock_irq(shost->host_lock); | ||
3009 | vport->fc_flag |= FC_LBIT; | 3020 | vport->fc_flag |= FC_LBIT; |
3021 | spin_unlock_irq(shost->host_lock); | ||
3010 | } | 3022 | } |
3011 | spin_unlock_irq(&phba->hbalock); | 3023 | spin_unlock_irq(&phba->hbalock); |
3012 | 3024 | ||
@@ -3593,6 +3605,7 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
3593 | MAILBOX_t *mb = &pmb->u.mb; | 3605 | MAILBOX_t *mb = &pmb->u.mb; |
3594 | struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); | 3606 | struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); |
3595 | struct lpfc_nodelist *ndlp; | 3607 | struct lpfc_nodelist *ndlp; |
3608 | struct Scsi_Host *shost; | ||
3596 | 3609 | ||
3597 | ndlp = (struct lpfc_nodelist *) pmb->context2; | 3610 | ndlp = (struct lpfc_nodelist *) pmb->context2; |
3598 | pmb->context1 = NULL; | 3611 | pmb->context1 = NULL; |
@@ -3638,8 +3651,12 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
3638 | * vport discovery */ | 3651 | * vport discovery */ |
3639 | if (!(vport->fc_flag & FC_LOGO_RCVD_DID_CHNG)) | 3652 | if (!(vport->fc_flag & FC_LOGO_RCVD_DID_CHNG)) |
3640 | lpfc_start_fdiscs(phba); | 3653 | lpfc_start_fdiscs(phba); |
3641 | else | 3654 | else { |
3655 | shost = lpfc_shost_from_vport(vport); | ||
3656 | spin_lock_irq(shost->host_lock); | ||
3642 | vport->fc_flag &= ~FC_LOGO_RCVD_DID_CHNG ; | 3657 | vport->fc_flag &= ~FC_LOGO_RCVD_DID_CHNG ; |
3658 | spin_unlock_irq(shost->host_lock); | ||
3659 | } | ||
3643 | lpfc_do_scr_ns_plogi(phba, vport); | 3660 | lpfc_do_scr_ns_plogi(phba, vport); |
3644 | } | 3661 | } |
3645 | 3662 | ||
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index 2dd464b0f29e..73fc5318641b 100644 --- a/drivers/scsi/lpfc/lpfc_hw.h +++ b/drivers/scsi/lpfc/lpfc_hw.h | |||
@@ -349,6 +349,12 @@ struct csp { | |||
349 | * Word 1 Bit 31 in FLOGI response is clean address bit | 349 | * Word 1 Bit 31 in FLOGI response is clean address bit |
350 | */ | 350 | */ |
351 | #define clean_address_bit request_multiple_Nport /* Word 1, bit 31 */ | 351 | #define clean_address_bit request_multiple_Nport /* Word 1, bit 31 */ |
352 | /* | ||
353 | * Word 1 Bit 30 in common service parameter is overloaded. | ||
354 | * Word 1 Bit 30 in FLOGI request is Virtual Fabrics | ||
355 | * Word 1 Bit 30 in PLOGI request is random offset | ||
356 | */ | ||
357 | #define virtual_fabric_support randomOffset /* Word 1, bit 30 */ | ||
352 | #ifdef __BIG_ENDIAN_BITFIELD | 358 | #ifdef __BIG_ENDIAN_BITFIELD |
353 | uint16_t request_multiple_Nport:1; /* FC Word 1, bit 31 */ | 359 | uint16_t request_multiple_Nport:1; /* FC Word 1, bit 31 */ |
354 | uint16_t randomOffset:1; /* FC Word 1, bit 30 */ | 360 | uint16_t randomOffset:1; /* FC Word 1, bit 30 */ |
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index 447da2a546ae..43c4c56f9e68 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h | |||
@@ -1830,6 +1830,8 @@ struct lpfc_mbx_init_vfi { | |||
1830 | #define lpfc_init_vfi_hop_count_MASK 0x000000FF | 1830 | #define lpfc_init_vfi_hop_count_MASK 0x000000FF |
1831 | #define lpfc_init_vfi_hop_count_WORD word4 | 1831 | #define lpfc_init_vfi_hop_count_WORD word4 |
1832 | }; | 1832 | }; |
1833 | #define MBX_VFI_IN_USE 0x9F02 | ||
1834 | |||
1833 | 1835 | ||
1834 | struct lpfc_mbx_reg_vfi { | 1836 | struct lpfc_mbx_reg_vfi { |
1835 | uint32_t word1; | 1837 | uint32_t word1; |
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 2ddd02f7c603..e8bb00559943 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c | |||
@@ -783,6 +783,14 @@ lpfc_device_rm_unused_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
783 | } | 783 | } |
784 | 784 | ||
785 | static uint32_t | 785 | static uint32_t |
786 | lpfc_device_recov_unused_node(struct lpfc_vport *vport, | ||
787 | struct lpfc_nodelist *ndlp, | ||
788 | void *arg, uint32_t evt) | ||
789 | { | ||
790 | return ndlp->nlp_state; | ||
791 | } | ||
792 | |||
793 | static uint32_t | ||
786 | lpfc_rcv_plogi_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | 794 | lpfc_rcv_plogi_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, |
787 | void *arg, uint32_t evt) | 795 | void *arg, uint32_t evt) |
788 | { | 796 | { |
@@ -2147,7 +2155,7 @@ static uint32_t (*lpfc_disc_action[NLP_STE_MAX_STATE * NLP_EVT_MAX_EVENT]) | |||
2147 | lpfc_disc_illegal, /* CMPL_ADISC */ | 2155 | lpfc_disc_illegal, /* CMPL_ADISC */ |
2148 | lpfc_disc_illegal, /* CMPL_REG_LOGIN */ | 2156 | lpfc_disc_illegal, /* CMPL_REG_LOGIN */ |
2149 | lpfc_device_rm_unused_node, /* DEVICE_RM */ | 2157 | lpfc_device_rm_unused_node, /* DEVICE_RM */ |
2150 | lpfc_disc_illegal, /* DEVICE_RECOVERY */ | 2158 | lpfc_device_recov_unused_node, /* DEVICE_RECOVERY */ |
2151 | 2159 | ||
2152 | lpfc_rcv_plogi_plogi_issue, /* RCV_PLOGI PLOGI_ISSUE */ | 2160 | lpfc_rcv_plogi_plogi_issue, /* RCV_PLOGI PLOGI_ISSUE */ |
2153 | lpfc_rcv_prli_plogi_issue, /* RCV_PRLI */ | 2161 | lpfc_rcv_prli_plogi_issue, /* RCV_PRLI */ |
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index f1af3f9dead4..c60f5d0b3869 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -2913,8 +2913,8 @@ lpfc_scsi_prep_cmnd(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd, | |||
2913 | int_to_scsilun(lpfc_cmd->pCmd->device->lun, | 2913 | int_to_scsilun(lpfc_cmd->pCmd->device->lun, |
2914 | &lpfc_cmd->fcp_cmnd->fcp_lun); | 2914 | &lpfc_cmd->fcp_cmnd->fcp_lun); |
2915 | 2915 | ||
2916 | memcpy(&fcp_cmnd->fcpCdb[0], scsi_cmnd->cmnd, 16); | 2916 | memset(&fcp_cmnd->fcpCdb[0], 0, LPFC_FCP_CDB_LEN); |
2917 | 2917 | memcpy(&fcp_cmnd->fcpCdb[0], scsi_cmnd->cmnd, scsi_cmnd->cmd_len); | |
2918 | if (scsi_populate_tag_msg(scsi_cmnd, tag)) { | 2918 | if (scsi_populate_tag_msg(scsi_cmnd, tag)) { |
2919 | switch (tag[0]) { | 2919 | switch (tag[0]) { |
2920 | case HEAD_OF_QUEUE_TAG: | 2920 | case HEAD_OF_QUEUE_TAG: |
@@ -3238,6 +3238,15 @@ lpfc_queuecommand_lck(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *)) | |||
3238 | cmnd->result = err; | 3238 | cmnd->result = err; |
3239 | goto out_fail_command; | 3239 | goto out_fail_command; |
3240 | } | 3240 | } |
3241 | /* | ||
3242 | * Do not let the mid-layer retry I/O too fast. If an I/O is retried | ||
3243 | * without waiting a bit then indicate that the device is busy. | ||
3244 | */ | ||
3245 | if (cmnd->retries && | ||
3246 | time_before(jiffies, (cmnd->jiffies_at_alloc + | ||
3247 | msecs_to_jiffies(LPFC_RETRY_PAUSE * | ||
3248 | cmnd->retries)))) | ||
3249 | return SCSI_MLQUEUE_DEVICE_BUSY; | ||
3241 | ndlp = rdata->pnode; | 3250 | ndlp = rdata->pnode; |
3242 | 3251 | ||
3243 | if ((scsi_get_prot_op(cmnd) != SCSI_PROT_NORMAL) && | 3252 | if ((scsi_get_prot_op(cmnd) != SCSI_PROT_NORMAL) && |
diff --git a/drivers/scsi/lpfc/lpfc_scsi.h b/drivers/scsi/lpfc/lpfc_scsi.h index ce645b20a6ad..9075a08cf781 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.h +++ b/drivers/scsi/lpfc/lpfc_scsi.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
22 | 22 | ||
23 | struct lpfc_hba; | 23 | struct lpfc_hba; |
24 | #define LPFC_FCP_CDB_LEN 16 | ||
24 | 25 | ||
25 | #define list_remove_head(list, entry, type, member) \ | 26 | #define list_remove_head(list, entry, type, member) \ |
26 | do { \ | 27 | do { \ |
@@ -102,7 +103,7 @@ struct fcp_cmnd { | |||
102 | #define WRITE_DATA 0x01 /* Bit 0 */ | 103 | #define WRITE_DATA 0x01 /* Bit 0 */ |
103 | #define READ_DATA 0x02 /* Bit 1 */ | 104 | #define READ_DATA 0x02 /* Bit 1 */ |
104 | 105 | ||
105 | uint8_t fcpCdb[16]; /* SRB cdb field is copied here */ | 106 | uint8_t fcpCdb[LPFC_FCP_CDB_LEN]; /* SRB cdb field is copied here */ |
106 | uint32_t fcpDl; /* Total transfer length */ | 107 | uint32_t fcpDl; /* Total transfer length */ |
107 | 108 | ||
108 | }; | 109 | }; |
@@ -153,5 +154,5 @@ struct lpfc_scsi_buf { | |||
153 | 154 | ||
154 | #define LPFC_SCSI_DMA_EXT_SIZE 264 | 155 | #define LPFC_SCSI_DMA_EXT_SIZE 264 |
155 | #define LPFC_BPL_SIZE 1024 | 156 | #define LPFC_BPL_SIZE 1024 |
156 | 157 | #define LPFC_RETRY_PAUSE 300 | |
157 | #define MDAC_DIRECT_CMD 0x22 | 158 | #define MDAC_DIRECT_CMD 0x22 |
diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c index cff6ca67415c..0fe188e66000 100644 --- a/drivers/scsi/lpfc/lpfc_vport.c +++ b/drivers/scsi/lpfc/lpfc_vport.c | |||
@@ -774,10 +774,10 @@ lpfc_create_vport_work_array(struct lpfc_hba *phba) | |||
774 | return NULL; | 774 | return NULL; |
775 | spin_lock_irq(&phba->hbalock); | 775 | spin_lock_irq(&phba->hbalock); |
776 | list_for_each_entry(port_iterator, &phba->port_list, listentry) { | 776 | list_for_each_entry(port_iterator, &phba->port_list, listentry) { |
777 | if (port_iterator->load_flag & FC_UNLOADING) | ||
778 | continue; | ||
777 | if (!scsi_host_get(lpfc_shost_from_vport(port_iterator))) { | 779 | if (!scsi_host_get(lpfc_shost_from_vport(port_iterator))) { |
778 | if (!(port_iterator->load_flag & FC_UNLOADING)) | 780 | lpfc_printf_vlog(port_iterator, KERN_ERR, LOG_VPORT, |
779 | lpfc_printf_vlog(port_iterator, KERN_ERR, | ||
780 | LOG_VPORT, | ||
781 | "1801 Create vport work array FAILED: " | 781 | "1801 Create vport work array FAILED: " |
782 | "cannot do scsi_host_get\n"); | 782 | "cannot do scsi_host_get\n"); |
783 | continue; | 783 | continue; |