Skip to content

Commit

Permalink
Merge patch series "Update lpfc to revision 14.4.0.3"
Browse files Browse the repository at this point in the history
Justin Tee <justintee8345@gmail.com> says:

Update lpfc to revision 14.4.0.3

This patch set contains bug fixes related to discovery, submission of
mailbox commands, and proper endianness conversions.

The patches were cut against Martin's 6.11/scsi-queue tree.

Link: https://lore.kernel.org/r/20240628172011.25921-1-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Martin K. Petersen committed Jul 5, 2024
2 parents 76a2014 + 41972df commit 3443855
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 44 deletions.
5 changes: 4 additions & 1 deletion drivers/scsi/lpfc/lpfc_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1831,6 +1831,7 @@ static int
lpfc_set_trunking(struct lpfc_hba *phba, char *buff_out)
{
LPFC_MBOXQ_t *mbox = NULL;
u32 payload_len;
unsigned long val = 0;
char *pval = NULL;
int rc = 0;
Expand Down Expand Up @@ -1869,9 +1870,11 @@ lpfc_set_trunking(struct lpfc_hba *phba, char *buff_out)
if (!mbox)
return -ENOMEM;

payload_len = sizeof(struct lpfc_mbx_set_trunk_mode) -
sizeof(struct lpfc_sli4_cfg_mhdr);
lpfc_sli4_config(phba, mbox, LPFC_MBOX_SUBSYSTEM_FCOE,
LPFC_MBOX_OPCODE_FCOE_FC_SET_TRUNK_MODE,
12, LPFC_SLI4_MBX_EMBED);
payload_len, LPFC_SLI4_MBX_EMBED);

bf_set(lpfc_mbx_set_trunk_mode,
&mbox->u.mqe.un.set_trunk_mode,
Expand Down
16 changes: 4 additions & 12 deletions drivers/scsi/lpfc/lpfc_ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -1553,22 +1553,14 @@ lpfc_cmpl_ct_cmd_gft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
if (ndlp->nlp_state == NLP_STE_REG_LOGIN_ISSUE &&
ndlp->nlp_fc4_type) {
ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE;
/* This is a fabric topology so if discovery
* started with an unsolicited PLOGI, don't
* send a PRLI. Targets don't issue PLOGI or
* PRLI when acting as a target. Likely this is
* an initiator function.
*/
if (!(ndlp->nlp_flag & NLP_RCV_PLOGI)) {
lpfc_nlp_set_state(vport, ndlp,
NLP_STE_PRLI_ISSUE);
lpfc_issue_els_prli(vport, ndlp, 0);
}
lpfc_nlp_set_state(vport, ndlp,
NLP_STE_PRLI_ISSUE);
lpfc_issue_els_prli(vport, ndlp, 0);
} else if (!ndlp->nlp_fc4_type) {
/* If fc4 type is still unknown, then LOGO */
lpfc_printf_vlog(vport, KERN_INFO,
LOG_DISCOVERY | LOG_NODE,
"6443 Sending LOGO ndlp x%px,"
"6443 Sending LOGO ndlp x%px, "
"DID x%06x with fc4_type: "
"x%08x, state: %d\n",
ndlp, did, ndlp->nlp_fc4_type,
Expand Down
19 changes: 12 additions & 7 deletions drivers/scsi/lpfc/lpfc_els.c
Original file line number Diff line number Diff line change
Expand Up @@ -7302,13 +7302,13 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys);
}
mbox->vport = phba->pport;

rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30);
rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_SLI4_CONFIG_TMO);
if (rc == MBX_NOT_FINISHED) {
rc = 1;
goto error;
}

if (rc == MBX_TIMEOUT)
goto error;
if (phba->sli_rev == LPFC_SLI_REV4)
mp = mbox->ctx_buf;
else
Expand Down Expand Up @@ -7361,7 +7361,10 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys);
}

rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30);
rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_SLI4_CONFIG_TMO);

if (rc == MBX_TIMEOUT)
goto error;
if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) {
rc = 1;
goto error;
Expand All @@ -7372,8 +7375,10 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
DMP_SFF_PAGE_A2_SIZE);

error:
mbox->ctx_buf = mpsave;
lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED);
if (mbox->mbox_flag & LPFC_MBX_WAKE) {
mbox->ctx_buf = mpsave;
lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED);
}

return rc;

Expand Down Expand Up @@ -9665,7 +9670,7 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport)
list_for_each_entry_safe(piocb, tmp_iocb, &abort_list, dlist) {
spin_lock_irqsave(&phba->hbalock, iflags);
list_del_init(&piocb->dlist);
if (mbx_tmo_err)
if (mbx_tmo_err || !(phba->sli.sli_flag & LPFC_SLI_ACTIVE))
list_move_tail(&piocb->list, &cancel_list);
else
lpfc_sli_issue_abort_iotag(phba, pring, piocb, NULL);
Expand Down
10 changes: 9 additions & 1 deletion drivers/scsi/lpfc/lpfc_hbadisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport)
if (ndlp->nlp_state == NLP_STE_MAPPED_NODE)
return;

/* check for recovered fabric node */
if (ndlp->nlp_state == NLP_STE_UNMAPPED_NODE &&
ndlp->nlp_DID == Fabric_DID)
return;

if (rport->port_name != wwn_to_u64(ndlp->nlp_portname.u.wwn))
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
"6789 rport name %llx != node port name %llx",
Expand Down Expand Up @@ -546,6 +551,9 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
ndlp->nlp_DID, kref_read(&ndlp->kref),
ndlp, ndlp->nlp_flag,
vport->port_state);
spin_lock_irqsave(&ndlp->lock, iflags);
ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS;
spin_unlock_irqrestore(&ndlp->lock, iflags);
return fcf_inuse;
}

Expand Down Expand Up @@ -5725,7 +5733,7 @@ lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did)
return ndlp;

if (ndlp->nlp_state > NLP_STE_UNUSED_NODE &&
ndlp->nlp_state < NLP_STE_PRLI_ISSUE) {
ndlp->nlp_state <= NLP_STE_PRLI_ISSUE) {
lpfc_disc_state_machine(vport, ndlp, NULL,
NLP_EVT_DEVICE_RECOVERY);
}
Expand Down
43 changes: 21 additions & 22 deletions drivers/scsi/lpfc/lpfc_sli.c
Original file line number Diff line number Diff line change
Expand Up @@ -10579,10 +10579,11 @@ lpfc_prep_embed_io(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
{
struct lpfc_iocbq *piocb = &lpfc_cmd->cur_iocbq;
union lpfc_wqe128 *wqe = &lpfc_cmd->cur_iocbq.wqe;
struct sli4_sge *sgl;
struct sli4_sge_le *sgl;
u32 type_size;

/* 128 byte wqe support here */
sgl = (struct sli4_sge *)lpfc_cmd->dma_sgl;
sgl = (struct sli4_sge_le *)lpfc_cmd->dma_sgl;

if (phba->fcp_embed_io) {
struct fcp_cmnd *fcp_cmnd;
Expand All @@ -10591,9 +10592,9 @@ lpfc_prep_embed_io(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
fcp_cmnd = lpfc_cmd->fcp_cmnd;

/* Word 0-2 - FCP_CMND */
wqe->generic.bde.tus.f.bdeFlags =
BUFF_TYPE_BDE_IMMED;
wqe->generic.bde.tus.f.bdeSize = sgl->sge_len;
type_size = le32_to_cpu(sgl->sge_len);
type_size |= ULP_BDE64_TYPE_BDE_IMMED;
wqe->generic.bde.tus.w = type_size;
wqe->generic.bde.addrHigh = 0;
wqe->generic.bde.addrLow = 72; /* Word 18 */

Expand All @@ -10602,13 +10603,13 @@ lpfc_prep_embed_io(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)

/* Word 18-29 FCP CMND Payload */
ptr = &wqe->words[18];
memcpy(ptr, fcp_cmnd, sgl->sge_len);
lpfc_sli_pcimem_bcopy(fcp_cmnd, ptr, le32_to_cpu(sgl->sge_len));
} else {
/* Word 0-2 - Inline BDE */
wqe->generic.bde.tus.f.bdeFlags = BUFF_TYPE_BDE_64;
wqe->generic.bde.tus.f.bdeSize = sgl->sge_len;
wqe->generic.bde.addrHigh = sgl->addr_hi;
wqe->generic.bde.addrLow = sgl->addr_lo;
wqe->generic.bde.tus.f.bdeSize = le32_to_cpu(sgl->sge_len);
wqe->generic.bde.addrHigh = le32_to_cpu(sgl->addr_hi);
wqe->generic.bde.addrLow = le32_to_cpu(sgl->addr_lo);

/* Word 10 */
bf_set(wqe_dbde, &wqe->generic.wqe_com, 1);
Expand Down Expand Up @@ -12301,18 +12302,16 @@ lpfc_sli_abort_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
goto release_iocb;
}
}

lpfc_printf_log(phba, KERN_WARNING, LOG_ELS | LOG_SLI,
"0327 Cannot abort els iocb x%px "
"with io cmd xri %x abort tag : x%x, "
"abort status %x abort code %x\n",
cmdiocb, get_job_abtsiotag(phba, cmdiocb),
(phba->sli_rev == LPFC_SLI_REV4) ?
get_wqe_reqtag(cmdiocb) :
cmdiocb->iocb.un.acxri.abortContextTag,
ulp_status, ulp_word4);

}

lpfc_printf_log(phba, KERN_INFO, LOG_ELS | LOG_SLI,
"0327 Abort els iocb complete x%px with io cmd xri %x "
"abort tag x%x abort status %x abort code %x\n",
cmdiocb, get_job_abtsiotag(phba, cmdiocb),
(phba->sli_rev == LPFC_SLI_REV4) ?
get_wqe_reqtag(cmdiocb) :
cmdiocb->iocb.ulpIoTag,
ulp_status, ulp_word4);
release_iocb:
lpfc_sli_release_iocbq(phba, cmdiocb);
return;
Expand Down Expand Up @@ -12509,10 +12508,10 @@ lpfc_sli_issue_abort_iotag(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI,
"0339 Abort IO XRI x%x, Original iotag x%x, "
"abort tag x%x Cmdjob : x%px Abortjob : x%px "
"retval x%x : IA %d\n",
"retval x%x : IA %d cmd_cmpl %ps\n",
ulp_context, (phba->sli_rev == LPFC_SLI_REV4) ?
cmdiocb->iotag : iotag, iotag, cmdiocb, abtsiocbp,
retval, ia);
retval, ia, abtsiocbp->cmd_cmpl);
if (retval) {
cmdiocb->cmd_flag &= ~LPFC_DRIVER_ABORTED;
__lpfc_sli_release_iocbq(phba, abtsiocbp);
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/lpfc/lpfc_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* included with this package. *
*******************************************************************/

#define LPFC_DRIVER_VERSION "14.4.0.2"
#define LPFC_DRIVER_VERSION "14.4.0.3"
#define LPFC_DRIVER_NAME "lpfc"

/* Used for SLI 2/3 */
Expand Down

0 comments on commit 3443855

Please sign in to comment.