Skip to content

Commit dae0bb3

Browse files
Merge patch series "lpfc: Update lpfc to revision 14.2.0.10"
Justin Tee <[email protected]> says: Update lpfc to revision 14.2.0.10 This patch set contains fixes for bugs, kernel test robot, and introduces new attention type event handling. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
2 parents e63d2ea + 191b5a3 commit dae0bb3

File tree

13 files changed

+238
-143
lines changed

13 files changed

+238
-143
lines changed

drivers/scsi/lpfc/lpfc.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************
22
* This file is part of the Emulex Linux Device Driver for *
33
* Fibre Channel Host Bus Adapters. *
4-
* Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
4+
* Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
55
* “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
66
* Copyright (C) 2004-2016 Emulex. All rights reserved. *
77
* EMULEX and SLI are trademarks of Emulex. *
@@ -1592,8 +1592,6 @@ struct lpfc_hba {
15921592
struct timer_list cpuhp_poll_timer;
15931593
struct list_head poll_list; /* slowpath eq polling list */
15941594
#define LPFC_POLL_HB 1 /* slowpath heartbeat */
1595-
#define LPFC_POLL_FASTPATH 0 /* called from fastpath */
1596-
#define LPFC_POLL_SLOWPATH 1 /* called from slowpath */
15971595

15981596
char os_host_name[MAXHOSTNAMELEN];
15991597

drivers/scsi/lpfc/lpfc_attr.c

Lines changed: 25 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************
22
* This file is part of the Emulex Linux Device Driver for *
33
* Fibre Channel Host Bus Adapters. *
4-
* Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
4+
* Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
55
* “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
66
* Copyright (C) 2004-2016 Emulex. All rights reserved. *
77
* EMULEX and SLI are trademarks of Emulex. *
@@ -1905,26 +1905,21 @@ lpfc_xcvr_data_show(struct device *dev, struct device_attribute *attr,
19051905
goto out_free_rdp;
19061906
}
19071907

1908-
strncpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_NAME], 16);
1909-
chbuf[16] = 0;
1908+
strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_NAME], 16);
19101909

19111910
len = scnprintf(buf, PAGE_SIZE - len, "VendorName:\t%s\n", chbuf);
19121911
len += scnprintf(buf + len, PAGE_SIZE - len,
19131912
"VendorOUI:\t%02x-%02x-%02x\n",
19141913
(uint8_t)rdp_context->page_a0[SSF_VENDOR_OUI],
19151914
(uint8_t)rdp_context->page_a0[SSF_VENDOR_OUI + 1],
19161915
(uint8_t)rdp_context->page_a0[SSF_VENDOR_OUI + 2]);
1917-
strncpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_PN], 16);
1918-
chbuf[16] = 0;
1916+
strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_PN], 16);
19191917
len += scnprintf(buf + len, PAGE_SIZE - len, "VendorPN:\t%s\n", chbuf);
1920-
strncpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_SN], 16);
1921-
chbuf[16] = 0;
1918+
strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_SN], 16);
19221919
len += scnprintf(buf + len, PAGE_SIZE - len, "VendorSN:\t%s\n", chbuf);
1923-
strncpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_REV], 4);
1924-
chbuf[4] = 0;
1920+
strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_REV], 4);
19251921
len += scnprintf(buf + len, PAGE_SIZE - len, "VendorRev:\t%s\n", chbuf);
1926-
strncpy(chbuf, &rdp_context->page_a0[SSF_DATE_CODE], 8);
1927-
chbuf[8] = 0;
1922+
strscpy(chbuf, &rdp_context->page_a0[SSF_DATE_CODE], 8);
19281923
len += scnprintf(buf + len, PAGE_SIZE - len, "DateCode:\t%s\n", chbuf);
19291924
len += scnprintf(buf + len, PAGE_SIZE - len, "Identifier:\t%xh\n",
19301925
(uint8_t)rdp_context->page_a0[SSF_IDENTIFIER]);
@@ -1941,33 +1936,25 @@ lpfc_xcvr_data_show(struct device *dev, struct device_attribute *attr,
19411936
&rdp_context->page_a0[SSF_TRANSCEIVER_CODE_B7];
19421937

19431938
len += scnprintf(buf + len, PAGE_SIZE - len, "Speeds: \t");
1944-
if (*(uint8_t *)trasn_code_byte7 == 0) {
1945-
len += scnprintf(buf + len, PAGE_SIZE - len,
1946-
"Unknown\n");
1947-
} else {
1948-
if (trasn_code_byte7->fc_sp_100MB)
1949-
len += scnprintf(buf + len, PAGE_SIZE - len,
1950-
"1 ");
1951-
if (trasn_code_byte7->fc_sp_200mb)
1952-
len += scnprintf(buf + len, PAGE_SIZE - len,
1953-
"2 ");
1954-
if (trasn_code_byte7->fc_sp_400MB)
1955-
len += scnprintf(buf + len, PAGE_SIZE - len,
1956-
"4 ");
1957-
if (trasn_code_byte7->fc_sp_800MB)
1958-
len += scnprintf(buf + len, PAGE_SIZE - len,
1959-
"8 ");
1960-
if (trasn_code_byte7->fc_sp_1600MB)
1961-
len += scnprintf(buf + len, PAGE_SIZE - len,
1962-
"16 ");
1963-
if (trasn_code_byte7->fc_sp_3200MB)
1964-
len += scnprintf(buf + len, PAGE_SIZE - len,
1965-
"32 ");
1966-
if (trasn_code_byte7->speed_chk_ecc)
1967-
len += scnprintf(buf + len, PAGE_SIZE - len,
1968-
"64 ");
1969-
len += scnprintf(buf + len, PAGE_SIZE - len, "GB\n");
1970-
}
1939+
if (*(uint8_t *)trasn_code_byte7 == 0) {
1940+
len += scnprintf(buf + len, PAGE_SIZE - len, "Unknown\n");
1941+
} else {
1942+
if (trasn_code_byte7->fc_sp_100MB)
1943+
len += scnprintf(buf + len, PAGE_SIZE - len, "1 ");
1944+
if (trasn_code_byte7->fc_sp_200mb)
1945+
len += scnprintf(buf + len, PAGE_SIZE - len, "2 ");
1946+
if (trasn_code_byte7->fc_sp_400MB)
1947+
len += scnprintf(buf + len, PAGE_SIZE - len, "4 ");
1948+
if (trasn_code_byte7->fc_sp_800MB)
1949+
len += scnprintf(buf + len, PAGE_SIZE - len, "8 ");
1950+
if (trasn_code_byte7->fc_sp_1600MB)
1951+
len += scnprintf(buf + len, PAGE_SIZE - len, "16 ");
1952+
if (trasn_code_byte7->fc_sp_3200MB)
1953+
len += scnprintf(buf + len, PAGE_SIZE - len, "32 ");
1954+
if (trasn_code_byte7->speed_chk_ecc)
1955+
len += scnprintf(buf + len, PAGE_SIZE - len, "64 ");
1956+
len += scnprintf(buf + len, PAGE_SIZE - len, "GB\n");
1957+
}
19711958
temperature = (rdp_context->page_a2[SFF_TEMPERATURE_B1] << 8 |
19721959
rdp_context->page_a2[SFF_TEMPERATURE_B0]);
19731960
vcc = (rdp_context->page_a2[SFF_VCC_B1] << 8 |

drivers/scsi/lpfc/lpfc_crtn.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************
22
* This file is part of the Emulex Linux Device Driver for *
33
* Fibre Channel Host Bus Adapters. *
4-
* Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
4+
* Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
55
* “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
66
* Copyright (C) 2004-2016 Emulex. All rights reserved. *
77
* EMULEX and SLI are trademarks of Emulex. *
@@ -253,7 +253,6 @@ int lpfc_read_object(struct lpfc_hba *phba, char *s, uint32_t *datap,
253253
uint32_t len);
254254

255255
void lpfc_sli4_cleanup_poll_list(struct lpfc_hba *phba);
256-
int lpfc_sli4_poll_eq(struct lpfc_queue *q, uint8_t path);
257256
void lpfc_sli4_poll_hbtimer(struct timer_list *t);
258257
void lpfc_sli4_start_polling(struct lpfc_queue *q);
259258
void lpfc_sli4_stop_polling(struct lpfc_queue *q);
@@ -684,6 +683,7 @@ int lpfc_vmid_get_appid(struct lpfc_vport *vport, char *uuid,
684683
union lpfc_vmid_io_tag *tag);
685684
void lpfc_vmid_vport_cleanup(struct lpfc_vport *vport);
686685
int lpfc_issue_els_qfpa(struct lpfc_vport *vport);
686+
void lpfc_reinit_vmid(struct lpfc_vport *vport);
687687

688688
void lpfc_sli_rpi_release(struct lpfc_vport *vport,
689689
struct lpfc_nodelist *ndlp);

drivers/scsi/lpfc/lpfc_els.c

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************
22
* This file is part of the Emulex Linux Device Driver for *
33
* Fibre Channel Host Bus Adapters. *
4-
* Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
4+
* Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
55
* “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
66
* Copyright (C) 2004-2016 Emulex. All rights reserved. *
77
* EMULEX and SLI are trademarks of Emulex. *
@@ -1123,6 +1123,9 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
11231123
if (sp->cmn.priority_tagging)
11241124
vport->phba->pport->vmid_flag |= (LPFC_VMID_ISSUE_QFPA |
11251125
LPFC_VMID_TYPE_PRIO);
1126+
/* reinitialize the VMID datastructure before returning */
1127+
if (lpfc_is_vmid_enabled(phba))
1128+
lpfc_reinit_vmid(vport);
11261129

11271130
/*
11281131
* Address a timing race with dev_loss. If dev_loss is active on
@@ -2373,15 +2376,30 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
23732376
/* PRLI failed */
23742377
lpfc_printf_vlog(vport, mode, loglevel,
23752378
"2754 PRLI failure DID:%06X Status:x%x/x%x, "
2376-
"data: x%x\n",
2379+
"data: x%x x%x\n",
23772380
ndlp->nlp_DID, ulp_status,
2378-
ulp_word4, ndlp->fc4_prli_sent);
2381+
ulp_word4, ndlp->nlp_state,
2382+
ndlp->fc4_prli_sent);
23792383

23802384
/* Do not call DSM for lpfc_els_abort'ed ELS cmds */
23812385
if (!lpfc_error_lost_link(ulp_status, ulp_word4))
23822386
lpfc_disc_state_machine(vport, ndlp, cmdiocb,
23832387
NLP_EVT_CMPL_PRLI);
23842388

2389+
/* The following condition catches an inflight transition
2390+
* mismatch typically caused by an RSCN. Skip any
2391+
* processing to allow recovery.
2392+
*/
2393+
if (ndlp->nlp_state >= NLP_STE_PLOGI_ISSUE &&
2394+
ndlp->nlp_state <= NLP_STE_REG_LOGIN_ISSUE) {
2395+
lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE,
2396+
"2784 PRLI cmpl: state mismatch "
2397+
"DID x%06x nstate x%x nflag x%x\n",
2398+
ndlp->nlp_DID, ndlp->nlp_state,
2399+
ndlp->nlp_flag);
2400+
goto out;
2401+
}
2402+
23852403
/*
23862404
* For P2P topology, retain the node so that PLOGI can be
23872405
* attempted on it again.
@@ -4673,6 +4691,15 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
46734691
/* the nameserver fails */
46744692
maxretry = 0;
46754693
delay = 100;
4694+
} else if (cmd == ELS_CMD_PRLI &&
4695+
ndlp->nlp_state != NLP_STE_PRLI_ISSUE) {
4696+
/* State-command disagreement. The PRLI was
4697+
* failed with an invalid rpi meaning there
4698+
* some unexpected state change. Don't retry.
4699+
*/
4700+
maxretry = 0;
4701+
retry = 0;
4702+
break;
46764703
}
46774704
retry = 1;
46784705
break;

drivers/scsi/lpfc/lpfc_hbadisc.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************
22
* This file is part of the Emulex Linux Device Driver for *
33
* Fibre Channel Host Bus Adapters. *
4-
* Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
4+
* Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
55
* “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
66
* Copyright (C) 2004-2016 Emulex. All rights reserved. *
77
* EMULEX and SLI are trademarks of Emulex. *
@@ -1129,21 +1129,6 @@ lpfc_cleanup_rpis(struct lpfc_vport *vport, int remove)
11291129
struct lpfc_nodelist *ndlp, *next_ndlp;
11301130

11311131
list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) {
1132-
if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) {
1133-
/* It's possible the FLOGI to the fabric node never
1134-
* successfully completed and never registered with the
1135-
* transport. In this case there is no way to clean up
1136-
* the node.
1137-
*/
1138-
if (ndlp->nlp_DID == Fabric_DID) {
1139-
if (ndlp->nlp_prev_state ==
1140-
NLP_STE_UNUSED_NODE &&
1141-
!ndlp->fc4_xpt_flags)
1142-
lpfc_nlp_put(ndlp);
1143-
}
1144-
continue;
1145-
}
1146-
11471132
if ((phba->sli3_options & LPFC_SLI3_VPORT_TEARDOWN) ||
11481133
((vport->port_type == LPFC_NPIV_PORT) &&
11491134
((ndlp->nlp_DID == NameServer_DID) ||

drivers/scsi/lpfc/lpfc_hw4.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*******************************************************************
22
* This file is part of the Emulex Linux Device Driver for *
33
* Fibre Channel Host Bus Adapters. *
4-
* Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
4+
* Copyright (C) 2017-2023 Broadcom. All Rights Reserved. The term *
55
* “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
66
* Copyright (C) 2009-2016 Emulex. All rights reserved. *
77
* EMULEX and SLI are trademarks of Emulex. *
@@ -4201,6 +4201,8 @@ struct lpfc_acqe_fc_la {
42014201
#define LPFC_FC_LA_TYPE_MDS_LOOPBACK 0x5
42024202
#define LPFC_FC_LA_TYPE_UNEXP_WWPN 0x6
42034203
#define LPFC_FC_LA_TYPE_TRUNKING_EVENT 0x7
4204+
#define LPFC_FC_LA_TYPE_ACTIVATE_FAIL 0x8
4205+
#define LPFC_FC_LA_TYPE_LINK_RESET_PRTCL_EVT 0x9
42044206
#define lpfc_acqe_fc_la_port_type_SHIFT 6
42054207
#define lpfc_acqe_fc_la_port_type_MASK 0x00000003
42064208
#define lpfc_acqe_fc_la_port_type_WORD word0
@@ -4242,6 +4244,9 @@ struct lpfc_acqe_fc_la {
42424244
#define lpfc_acqe_fc_la_fault_SHIFT 0
42434245
#define lpfc_acqe_fc_la_fault_MASK 0x000000FF
42444246
#define lpfc_acqe_fc_la_fault_WORD word1
4247+
#define lpfc_acqe_fc_la_link_status_SHIFT 8
4248+
#define lpfc_acqe_fc_la_link_status_MASK 0x0000007F
4249+
#define lpfc_acqe_fc_la_link_status_WORD word1
42454250
#define lpfc_acqe_fc_la_trunk_fault_SHIFT 0
42464251
#define lpfc_acqe_fc_la_trunk_fault_MASK 0x0000000F
42474252
#define lpfc_acqe_fc_la_trunk_fault_WORD word1

0 commit comments

Comments
 (0)