Skip to content

Commit 3443855

Browse files
Merge patch series "Update lpfc to revision 14.4.0.3"
Justin Tee <[email protected]> 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/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
2 parents 76a2014 + 41972df commit 3443855

File tree

6 files changed

+51
-44
lines changed

6 files changed

+51
-44
lines changed

drivers/scsi/lpfc/lpfc_attr.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1831,6 +1831,7 @@ static int
18311831
lpfc_set_trunking(struct lpfc_hba *phba, char *buff_out)
18321832
{
18331833
LPFC_MBOXQ_t *mbox = NULL;
1834+
u32 payload_len;
18341835
unsigned long val = 0;
18351836
char *pval = NULL;
18361837
int rc = 0;
@@ -1869,9 +1870,11 @@ lpfc_set_trunking(struct lpfc_hba *phba, char *buff_out)
18691870
if (!mbox)
18701871
return -ENOMEM;
18711872

1873+
payload_len = sizeof(struct lpfc_mbx_set_trunk_mode) -
1874+
sizeof(struct lpfc_sli4_cfg_mhdr);
18721875
lpfc_sli4_config(phba, mbox, LPFC_MBOX_SUBSYSTEM_FCOE,
18731876
LPFC_MBOX_OPCODE_FCOE_FC_SET_TRUNK_MODE,
1874-
12, LPFC_SLI4_MBX_EMBED);
1877+
payload_len, LPFC_SLI4_MBX_EMBED);
18751878

18761879
bf_set(lpfc_mbx_set_trunk_mode,
18771880
&mbox->u.mqe.un.set_trunk_mode,

drivers/scsi/lpfc/lpfc_ct.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,22 +1553,14 @@ lpfc_cmpl_ct_cmd_gft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
15531553
if (ndlp->nlp_state == NLP_STE_REG_LOGIN_ISSUE &&
15541554
ndlp->nlp_fc4_type) {
15551555
ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE;
1556-
/* This is a fabric topology so if discovery
1557-
* started with an unsolicited PLOGI, don't
1558-
* send a PRLI. Targets don't issue PLOGI or
1559-
* PRLI when acting as a target. Likely this is
1560-
* an initiator function.
1561-
*/
1562-
if (!(ndlp->nlp_flag & NLP_RCV_PLOGI)) {
1563-
lpfc_nlp_set_state(vport, ndlp,
1564-
NLP_STE_PRLI_ISSUE);
1565-
lpfc_issue_els_prli(vport, ndlp, 0);
1566-
}
1556+
lpfc_nlp_set_state(vport, ndlp,
1557+
NLP_STE_PRLI_ISSUE);
1558+
lpfc_issue_els_prli(vport, ndlp, 0);
15671559
} else if (!ndlp->nlp_fc4_type) {
15681560
/* If fc4 type is still unknown, then LOGO */
15691561
lpfc_printf_vlog(vport, KERN_INFO,
15701562
LOG_DISCOVERY | LOG_NODE,
1571-
"6443 Sending LOGO ndlp x%px,"
1563+
"6443 Sending LOGO ndlp x%px, "
15721564
"DID x%06x with fc4_type: "
15731565
"x%08x, state: %d\n",
15741566
ndlp, did, ndlp->nlp_fc4_type,

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7302,13 +7302,13 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
73027302
mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys);
73037303
}
73047304
mbox->vport = phba->pport;
7305-
7306-
rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30);
7305+
rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_SLI4_CONFIG_TMO);
73077306
if (rc == MBX_NOT_FINISHED) {
73087307
rc = 1;
73097308
goto error;
73107309
}
7311-
7310+
if (rc == MBX_TIMEOUT)
7311+
goto error;
73127312
if (phba->sli_rev == LPFC_SLI_REV4)
73137313
mp = mbox->ctx_buf;
73147314
else
@@ -7361,7 +7361,10 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
73617361
mbox->u.mqe.un.mem_dump_type3.addr_hi = putPaddrHigh(mp->phys);
73627362
}
73637363

7364-
rc = lpfc_sli_issue_mbox_wait(phba, mbox, 30);
7364+
rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_SLI4_CONFIG_TMO);
7365+
7366+
if (rc == MBX_TIMEOUT)
7367+
goto error;
73657368
if (bf_get(lpfc_mqe_status, &mbox->u.mqe)) {
73667369
rc = 1;
73677370
goto error;
@@ -7372,8 +7375,10 @@ int lpfc_get_sfp_info_wait(struct lpfc_hba *phba,
73727375
DMP_SFF_PAGE_A2_SIZE);
73737376

73747377
error:
7375-
mbox->ctx_buf = mpsave;
7376-
lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED);
7378+
if (mbox->mbox_flag & LPFC_MBX_WAKE) {
7379+
mbox->ctx_buf = mpsave;
7380+
lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED);
7381+
}
73777382

73787383
return rc;
73797384

@@ -9665,7 +9670,7 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport)
96659670
list_for_each_entry_safe(piocb, tmp_iocb, &abort_list, dlist) {
96669671
spin_lock_irqsave(&phba->hbalock, iflags);
96679672
list_del_init(&piocb->dlist);
9668-
if (mbx_tmo_err)
9673+
if (mbx_tmo_err || !(phba->sli.sli_flag & LPFC_SLI_ACTIVE))
96699674
list_move_tail(&piocb->list, &cancel_list);
96709675
else
96719676
lpfc_sli_issue_abort_iotag(phba, pring, piocb, NULL);

drivers/scsi/lpfc/lpfc_hbadisc.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport)
214214
if (ndlp->nlp_state == NLP_STE_MAPPED_NODE)
215215
return;
216216

217+
/* check for recovered fabric node */
218+
if (ndlp->nlp_state == NLP_STE_UNMAPPED_NODE &&
219+
ndlp->nlp_DID == Fabric_DID)
220+
return;
221+
217222
if (rport->port_name != wwn_to_u64(ndlp->nlp_portname.u.wwn))
218223
lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
219224
"6789 rport name %llx != node port name %llx",
@@ -546,6 +551,9 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
546551
ndlp->nlp_DID, kref_read(&ndlp->kref),
547552
ndlp, ndlp->nlp_flag,
548553
vport->port_state);
554+
spin_lock_irqsave(&ndlp->lock, iflags);
555+
ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS;
556+
spin_unlock_irqrestore(&ndlp->lock, iflags);
549557
return fcf_inuse;
550558
}
551559

@@ -5725,7 +5733,7 @@ lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did)
57255733
return ndlp;
57265734

57275735
if (ndlp->nlp_state > NLP_STE_UNUSED_NODE &&
5728-
ndlp->nlp_state < NLP_STE_PRLI_ISSUE) {
5736+
ndlp->nlp_state <= NLP_STE_PRLI_ISSUE) {
57295737
lpfc_disc_state_machine(vport, ndlp, NULL,
57305738
NLP_EVT_DEVICE_RECOVERY);
57315739
}

drivers/scsi/lpfc/lpfc_sli.c

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10579,10 +10579,11 @@ lpfc_prep_embed_io(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
1057910579
{
1058010580
struct lpfc_iocbq *piocb = &lpfc_cmd->cur_iocbq;
1058110581
union lpfc_wqe128 *wqe = &lpfc_cmd->cur_iocbq.wqe;
10582-
struct sli4_sge *sgl;
10582+
struct sli4_sge_le *sgl;
10583+
u32 type_size;
1058310584

1058410585
/* 128 byte wqe support here */
10585-
sgl = (struct sli4_sge *)lpfc_cmd->dma_sgl;
10586+
sgl = (struct sli4_sge_le *)lpfc_cmd->dma_sgl;
1058610587

1058710588
if (phba->fcp_embed_io) {
1058810589
struct fcp_cmnd *fcp_cmnd;
@@ -10591,9 +10592,9 @@ lpfc_prep_embed_io(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd)
1059110592
fcp_cmnd = lpfc_cmd->fcp_cmnd;
1059210593

1059310594
/* Word 0-2 - FCP_CMND */
10594-
wqe->generic.bde.tus.f.bdeFlags =
10595-
BUFF_TYPE_BDE_IMMED;
10596-
wqe->generic.bde.tus.f.bdeSize = sgl->sge_len;
10595+
type_size = le32_to_cpu(sgl->sge_len);
10596+
type_size |= ULP_BDE64_TYPE_BDE_IMMED;
10597+
wqe->generic.bde.tus.w = type_size;
1059710598
wqe->generic.bde.addrHigh = 0;
1059810599
wqe->generic.bde.addrLow = 72; /* Word 18 */
1059910600

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

1060310604
/* Word 18-29 FCP CMND Payload */
1060410605
ptr = &wqe->words[18];
10605-
memcpy(ptr, fcp_cmnd, sgl->sge_len);
10606+
lpfc_sli_pcimem_bcopy(fcp_cmnd, ptr, le32_to_cpu(sgl->sge_len));
1060610607
} else {
1060710608
/* Word 0-2 - Inline BDE */
1060810609
wqe->generic.bde.tus.f.bdeFlags = BUFF_TYPE_BDE_64;
10609-
wqe->generic.bde.tus.f.bdeSize = sgl->sge_len;
10610-
wqe->generic.bde.addrHigh = sgl->addr_hi;
10611-
wqe->generic.bde.addrLow = sgl->addr_lo;
10610+
wqe->generic.bde.tus.f.bdeSize = le32_to_cpu(sgl->sge_len);
10611+
wqe->generic.bde.addrHigh = le32_to_cpu(sgl->addr_hi);
10612+
wqe->generic.bde.addrLow = le32_to_cpu(sgl->addr_lo);
1061210613

1061310614
/* Word 10 */
1061410615
bf_set(wqe_dbde, &wqe->generic.wqe_com, 1);
@@ -12301,18 +12302,16 @@ lpfc_sli_abort_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1230112302
goto release_iocb;
1230212303
}
1230312304
}
12304-
12305-
lpfc_printf_log(phba, KERN_WARNING, LOG_ELS | LOG_SLI,
12306-
"0327 Cannot abort els iocb x%px "
12307-
"with io cmd xri %x abort tag : x%x, "
12308-
"abort status %x abort code %x\n",
12309-
cmdiocb, get_job_abtsiotag(phba, cmdiocb),
12310-
(phba->sli_rev == LPFC_SLI_REV4) ?
12311-
get_wqe_reqtag(cmdiocb) :
12312-
cmdiocb->iocb.un.acxri.abortContextTag,
12313-
ulp_status, ulp_word4);
12314-
1231512305
}
12306+
12307+
lpfc_printf_log(phba, KERN_INFO, LOG_ELS | LOG_SLI,
12308+
"0327 Abort els iocb complete x%px with io cmd xri %x "
12309+
"abort tag x%x abort status %x abort code %x\n",
12310+
cmdiocb, get_job_abtsiotag(phba, cmdiocb),
12311+
(phba->sli_rev == LPFC_SLI_REV4) ?
12312+
get_wqe_reqtag(cmdiocb) :
12313+
cmdiocb->iocb.ulpIoTag,
12314+
ulp_status, ulp_word4);
1231612315
release_iocb:
1231712316
lpfc_sli_release_iocbq(phba, cmdiocb);
1231812317
return;
@@ -12509,10 +12508,10 @@ lpfc_sli_issue_abort_iotag(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
1250912508
lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI,
1251012509
"0339 Abort IO XRI x%x, Original iotag x%x, "
1251112510
"abort tag x%x Cmdjob : x%px Abortjob : x%px "
12512-
"retval x%x : IA %d\n",
12511+
"retval x%x : IA %d cmd_cmpl %ps\n",
1251312512
ulp_context, (phba->sli_rev == LPFC_SLI_REV4) ?
1251412513
cmdiocb->iotag : iotag, iotag, cmdiocb, abtsiocbp,
12515-
retval, ia);
12514+
retval, ia, abtsiocbp->cmd_cmpl);
1251612515
if (retval) {
1251712516
cmdiocb->cmd_flag &= ~LPFC_DRIVER_ABORTED;
1251812517
__lpfc_sli_release_iocbq(phba, abtsiocbp);

drivers/scsi/lpfc/lpfc_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* included with this package. *
2121
*******************************************************************/
2222

23-
#define LPFC_DRIVER_VERSION "14.4.0.2"
23+
#define LPFC_DRIVER_VERSION "14.4.0.3"
2424
#define LPFC_DRIVER_NAME "lpfc"
2525

2626
/* Used for SLI 2/3 */

0 commit comments

Comments
 (0)