Commit 071fbd3d authored by James Smart's avatar James Smart Committed by James Bottomley

[SCSI] lpfc 8.1.5 : Misc small fixes

Contains the following misc fixes:
 - Fix build warnings
 - Race condition in lpfc_workq_post_event() could corrupt phba->work_list.
 - nlp_sid was not being initialized properly
 - Fix some RSCN handling during the re-discovery after Link Up event.
Signed-off-by: default avatarJames Smart <James.Smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 10d4e957
...@@ -2511,7 +2511,7 @@ lpfc_els_rcv_rscn(struct lpfc_hba * phba, ...@@ -2511,7 +2511,7 @@ lpfc_els_rcv_rscn(struct lpfc_hba * phba,
/* If we are about to begin discovery, just ACC the RSCN. /* If we are about to begin discovery, just ACC the RSCN.
* Discovery processing will satisfy it. * Discovery processing will satisfy it.
*/ */
if (phba->hba_state < LPFC_NS_QRY) { if (phba->hba_state <= LPFC_NS_QRY) {
lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL,
newnode); newnode);
return 0; return 0;
......
...@@ -311,8 +311,8 @@ lpfc_workq_post_event(struct lpfc_hba * phba, void *arg1, void *arg2, ...@@ -311,8 +311,8 @@ lpfc_workq_post_event(struct lpfc_hba * phba, void *arg1, void *arg2,
evtp->evt_arg2 = arg2; evtp->evt_arg2 = arg2;
evtp->evt = evt; evtp->evt = evt;
list_add_tail(&evtp->evt_listp, &phba->work_list);
spin_lock_irq(phba->host->host_lock); spin_lock_irq(phba->host->host_lock);
list_add_tail(&evtp->evt_listp, &phba->work_list);
if (phba->work_wait) if (phba->work_wait)
wake_up(phba->work_wait); wake_up(phba->work_wait);
spin_unlock_irq(phba->host->host_lock); spin_unlock_irq(phba->host->host_lock);
...@@ -1071,10 +1071,6 @@ lpfc_register_remote_port(struct lpfc_hba * phba, ...@@ -1071,10 +1071,6 @@ lpfc_register_remote_port(struct lpfc_hba * phba,
/* initialize static port data */ /* initialize static port data */
rport->maxframe_size = ndlp->nlp_maxframe; rport->maxframe_size = ndlp->nlp_maxframe;
rport->supported_classes = ndlp->nlp_class_sup; rport->supported_classes = ndlp->nlp_class_sup;
if ((rport->scsi_target_id != -1) &&
(rport->scsi_target_id < MAX_FCP_TARGET)) {
ndlp->nlp_sid = rport->scsi_target_id;
}
rdata = rport->dd_data; rdata = rport->dd_data;
rdata->pnode = ndlp; rdata->pnode = ndlp;
...@@ -1087,6 +1083,10 @@ lpfc_register_remote_port(struct lpfc_hba * phba, ...@@ -1087,6 +1083,10 @@ lpfc_register_remote_port(struct lpfc_hba * phba,
if (rport_ids.roles != FC_RPORT_ROLE_UNKNOWN) if (rport_ids.roles != FC_RPORT_ROLE_UNKNOWN)
fc_remote_port_rolechg(rport, rport_ids.roles); fc_remote_port_rolechg(rport, rport_ids.roles);
if ((rport->scsi_target_id != -1) &&
(rport->scsi_target_id < MAX_FCP_TARGET)) {
ndlp->nlp_sid = rport->scsi_target_id;
}
return; return;
} }
...@@ -1905,10 +1905,8 @@ lpfc_setup_disc_node(struct lpfc_hba * phba, uint32_t did) ...@@ -1905,10 +1905,8 @@ lpfc_setup_disc_node(struct lpfc_hba * phba, uint32_t did)
*/ */
if (ndlp->nlp_flag & NLP_DELAY_TMO) if (ndlp->nlp_flag & NLP_DELAY_TMO)
lpfc_cancel_retry_delay_tmo(phba, ndlp); lpfc_cancel_retry_delay_tmo(phba, ndlp);
} else { } else
ndlp->nlp_flag &= ~NLP_NPR_2B_DISC;
ndlp = NULL; ndlp = NULL;
}
} else { } else {
flg = ndlp->nlp_flag & NLP_LIST_MASK; flg = ndlp->nlp_flag & NLP_LIST_MASK;
if ((flg == NLP_ADISC_LIST) || (flg == NLP_PLOGI_LIST)) if ((flg == NLP_ADISC_LIST) || (flg == NLP_PLOGI_LIST))
......
...@@ -795,7 +795,7 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) ...@@ -795,7 +795,7 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp)
int max_speed; int max_speed;
char * ports; char * ports;
char * bus; char * bus;
} m; } m = {"<Unknown>", 0, "", ""};
pci_read_config_byte(phba->pcidev, PCI_HEADER_TYPE, &hdrtype); pci_read_config_byte(phba->pcidev, PCI_HEADER_TYPE, &hdrtype);
ports = (hdrtype == 0x80) ? "2-port " : ""; ports = (hdrtype == 0x80) ? "2-port " : "";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment