Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge patch series "lpfc: Update lpfc to revision 14.2.0.10"

Justin Tee <justintee8345@gmail.com> 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/20230109233317.54737-1-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

+238 -143
+1 -3
drivers/scsi/lpfc/lpfc.h
··· 1 1 /******************************************************************* 2 2 * This file is part of the Emulex Linux Device Driver for * 3 3 * 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 * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2004-2016 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 1592 1592 struct timer_list cpuhp_poll_timer; 1593 1593 struct list_head poll_list; /* slowpath eq polling list */ 1594 1594 #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 */ 1597 1595 1598 1596 char os_host_name[MAXHOSTNAMELEN]; 1599 1597
+25 -38
drivers/scsi/lpfc/lpfc_attr.c
··· 1 1 /******************************************************************* 2 2 * This file is part of the Emulex Linux Device Driver for * 3 3 * 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 * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2004-2016 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 1905 1905 goto out_free_rdp; 1906 1906 } 1907 1907 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); 1910 1909 1911 1910 len = scnprintf(buf, PAGE_SIZE - len, "VendorName:\t%s\n", chbuf); 1912 1911 len += scnprintf(buf + len, PAGE_SIZE - len, ··· 1913 1914 (uint8_t)rdp_context->page_a0[SSF_VENDOR_OUI], 1914 1915 (uint8_t)rdp_context->page_a0[SSF_VENDOR_OUI + 1], 1915 1916 (uint8_t)rdp_context->page_a0[SSF_VENDOR_OUI + 2]); 1916 - strncpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_PN], 16); 1917 - chbuf[16] = 0; 1917 + strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_PN], 16); 1918 1918 len += scnprintf(buf + len, PAGE_SIZE - len, "VendorPN:\t%s\n", chbuf); 1919 - strncpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_SN], 16); 1920 - chbuf[16] = 0; 1919 + strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_SN], 16); 1921 1920 len += scnprintf(buf + len, PAGE_SIZE - len, "VendorSN:\t%s\n", chbuf); 1922 - strncpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_REV], 4); 1923 - chbuf[4] = 0; 1921 + strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_REV], 4); 1924 1922 len += scnprintf(buf + len, PAGE_SIZE - len, "VendorRev:\t%s\n", chbuf); 1925 - strncpy(chbuf, &rdp_context->page_a0[SSF_DATE_CODE], 8); 1926 - chbuf[8] = 0; 1923 + strscpy(chbuf, &rdp_context->page_a0[SSF_DATE_CODE], 8); 1927 1924 len += scnprintf(buf + len, PAGE_SIZE - len, "DateCode:\t%s\n", chbuf); 1928 1925 len += scnprintf(buf + len, PAGE_SIZE - len, "Identifier:\t%xh\n", 1929 1926 (uint8_t)rdp_context->page_a0[SSF_IDENTIFIER]); ··· 1936 1941 &rdp_context->page_a0[SSF_TRANSCEIVER_CODE_B7]; 1937 1942 1938 1943 len += scnprintf(buf + len, PAGE_SIZE - len, "Speeds: \t"); 1939 - if (*(uint8_t *)trasn_code_byte7 == 0) { 1940 - len += scnprintf(buf + len, PAGE_SIZE - len, 1941 - "Unknown\n"); 1942 - } else { 1943 - if (trasn_code_byte7->fc_sp_100MB) 1944 - len += scnprintf(buf + len, PAGE_SIZE - len, 1945 - "1 "); 1946 - if (trasn_code_byte7->fc_sp_200mb) 1947 - len += scnprintf(buf + len, PAGE_SIZE - len, 1948 - "2 "); 1949 - if (trasn_code_byte7->fc_sp_400MB) 1950 - len += scnprintf(buf + len, PAGE_SIZE - len, 1951 - "4 "); 1952 - if (trasn_code_byte7->fc_sp_800MB) 1953 - len += scnprintf(buf + len, PAGE_SIZE - len, 1954 - "8 "); 1955 - if (trasn_code_byte7->fc_sp_1600MB) 1956 - len += scnprintf(buf + len, PAGE_SIZE - len, 1957 - "16 "); 1958 - if (trasn_code_byte7->fc_sp_3200MB) 1959 - len += scnprintf(buf + len, PAGE_SIZE - len, 1960 - "32 "); 1961 - if (trasn_code_byte7->speed_chk_ecc) 1962 - len += scnprintf(buf + len, PAGE_SIZE - len, 1963 - "64 "); 1964 - len += scnprintf(buf + len, PAGE_SIZE - len, "GB\n"); 1965 - } 1944 + if (*(uint8_t *)trasn_code_byte7 == 0) { 1945 + len += scnprintf(buf + len, PAGE_SIZE - len, "Unknown\n"); 1946 + } else { 1947 + if (trasn_code_byte7->fc_sp_100MB) 1948 + len += scnprintf(buf + len, PAGE_SIZE - len, "1 "); 1949 + if (trasn_code_byte7->fc_sp_200mb) 1950 + len += scnprintf(buf + len, PAGE_SIZE - len, "2 "); 1951 + if (trasn_code_byte7->fc_sp_400MB) 1952 + len += scnprintf(buf + len, PAGE_SIZE - len, "4 "); 1953 + if (trasn_code_byte7->fc_sp_800MB) 1954 + len += scnprintf(buf + len, PAGE_SIZE - len, "8 "); 1955 + if (trasn_code_byte7->fc_sp_1600MB) 1956 + len += scnprintf(buf + len, PAGE_SIZE - len, "16 "); 1957 + if (trasn_code_byte7->fc_sp_3200MB) 1958 + len += scnprintf(buf + len, PAGE_SIZE - len, "32 "); 1959 + if (trasn_code_byte7->speed_chk_ecc) 1960 + len += scnprintf(buf + len, PAGE_SIZE - len, "64 "); 1961 + len += scnprintf(buf + len, PAGE_SIZE - len, "GB\n"); 1962 + } 1966 1963 temperature = (rdp_context->page_a2[SFF_TEMPERATURE_B1] << 8 | 1967 1964 rdp_context->page_a2[SFF_TEMPERATURE_B0]); 1968 1965 vcc = (rdp_context->page_a2[SFF_VCC_B1] << 8 |
+2 -2
drivers/scsi/lpfc/lpfc_crtn.h
··· 1 1 /******************************************************************* 2 2 * This file is part of the Emulex Linux Device Driver for * 3 3 * 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 * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2004-2016 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 253 253 uint32_t len); 254 254 255 255 void lpfc_sli4_cleanup_poll_list(struct lpfc_hba *phba); 256 - int lpfc_sli4_poll_eq(struct lpfc_queue *q, uint8_t path); 257 256 void lpfc_sli4_poll_hbtimer(struct timer_list *t); 258 257 void lpfc_sli4_start_polling(struct lpfc_queue *q); 259 258 void lpfc_sli4_stop_polling(struct lpfc_queue *q); ··· 683 684 union lpfc_vmid_io_tag *tag); 684 685 void lpfc_vmid_vport_cleanup(struct lpfc_vport *vport); 685 686 int lpfc_issue_els_qfpa(struct lpfc_vport *vport); 687 + void lpfc_reinit_vmid(struct lpfc_vport *vport); 686 688 687 689 void lpfc_sli_rpi_release(struct lpfc_vport *vport, 688 690 struct lpfc_nodelist *ndlp);
+30 -3
drivers/scsi/lpfc/lpfc_els.c
··· 1 1 /******************************************************************* 2 2 * This file is part of the Emulex Linux Device Driver for * 3 3 * 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 * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2004-2016 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 1123 1123 if (sp->cmn.priority_tagging) 1124 1124 vport->phba->pport->vmid_flag |= (LPFC_VMID_ISSUE_QFPA | 1125 1125 LPFC_VMID_TYPE_PRIO); 1126 + /* reinitialize the VMID datastructure before returning */ 1127 + if (lpfc_is_vmid_enabled(phba)) 1128 + lpfc_reinit_vmid(vport); 1126 1129 1127 1130 /* 1128 1131 * Address a timing race with dev_loss. If dev_loss is active on ··· 2376 2373 /* PRLI failed */ 2377 2374 lpfc_printf_vlog(vport, mode, loglevel, 2378 2375 "2754 PRLI failure DID:%06X Status:x%x/x%x, " 2379 - "data: x%x\n", 2376 + "data: x%x x%x\n", 2380 2377 ndlp->nlp_DID, ulp_status, 2381 - ulp_word4, ndlp->fc4_prli_sent); 2378 + ulp_word4, ndlp->nlp_state, 2379 + ndlp->fc4_prli_sent); 2382 2380 2383 2381 /* Do not call DSM for lpfc_els_abort'ed ELS cmds */ 2384 2382 if (!lpfc_error_lost_link(ulp_status, ulp_word4)) 2385 2383 lpfc_disc_state_machine(vport, ndlp, cmdiocb, 2386 2384 NLP_EVT_CMPL_PRLI); 2385 + 2386 + /* The following condition catches an inflight transition 2387 + * mismatch typically caused by an RSCN. Skip any 2388 + * processing to allow recovery. 2389 + */ 2390 + if (ndlp->nlp_state >= NLP_STE_PLOGI_ISSUE && 2391 + ndlp->nlp_state <= NLP_STE_REG_LOGIN_ISSUE) { 2392 + lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, 2393 + "2784 PRLI cmpl: state mismatch " 2394 + "DID x%06x nstate x%x nflag x%x\n", 2395 + ndlp->nlp_DID, ndlp->nlp_state, 2396 + ndlp->nlp_flag); 2397 + goto out; 2398 + } 2387 2399 2388 2400 /* 2389 2401 * For P2P topology, retain the node so that PLOGI can be ··· 4691 4673 /* the nameserver fails */ 4692 4674 maxretry = 0; 4693 4675 delay = 100; 4676 + } else if (cmd == ELS_CMD_PRLI && 4677 + ndlp->nlp_state != NLP_STE_PRLI_ISSUE) { 4678 + /* State-command disagreement. The PRLI was 4679 + * failed with an invalid rpi meaning there 4680 + * some unexpected state change. Don't retry. 4681 + */ 4682 + maxretry = 0; 4683 + retry = 0; 4684 + break; 4694 4685 } 4695 4686 retry = 1; 4696 4687 break;
+1 -16
drivers/scsi/lpfc/lpfc_hbadisc.c
··· 1 1 /******************************************************************* 2 2 * This file is part of the Emulex Linux Device Driver for * 3 3 * 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 * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2004-2016 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 1129 1129 struct lpfc_nodelist *ndlp, *next_ndlp; 1130 1130 1131 1131 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 - 1147 1132 if ((phba->sli3_options & LPFC_SLI3_VPORT_TEARDOWN) || 1148 1133 ((vport->port_type == LPFC_NPIV_PORT) && 1149 1134 ((ndlp->nlp_DID == NameServer_DID) ||
+6 -1
drivers/scsi/lpfc/lpfc_hw4.h
··· 1 1 /******************************************************************* 2 2 * This file is part of the Emulex Linux Device Driver for * 3 3 * 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 * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2009-2016 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 4201 4201 #define LPFC_FC_LA_TYPE_MDS_LOOPBACK 0x5 4202 4202 #define LPFC_FC_LA_TYPE_UNEXP_WWPN 0x6 4203 4203 #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 4204 4206 #define lpfc_acqe_fc_la_port_type_SHIFT 6 4205 4207 #define lpfc_acqe_fc_la_port_type_MASK 0x00000003 4206 4208 #define lpfc_acqe_fc_la_port_type_WORD word0 ··· 4244 4242 #define lpfc_acqe_fc_la_fault_SHIFT 0 4245 4243 #define lpfc_acqe_fc_la_fault_MASK 0x000000FF 4246 4244 #define lpfc_acqe_fc_la_fault_WORD word1 4245 + #define lpfc_acqe_fc_la_link_status_SHIFT 8 4246 + #define lpfc_acqe_fc_la_link_status_MASK 0x0000007F 4247 + #define lpfc_acqe_fc_la_link_status_WORD word1 4247 4248 #define lpfc_acqe_fc_la_trunk_fault_SHIFT 0 4248 4249 #define lpfc_acqe_fc_la_trunk_fault_MASK 0x0000000F 4249 4250 #define lpfc_acqe_fc_la_trunk_fault_WORD word1
+78 -16
drivers/scsi/lpfc/lpfc_init.c
··· 1 1 /******************************************************************* 2 2 * This file is part of the Emulex Linux Device Driver for * 3 3 * 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 * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2004-2016 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 5189 5189 lpfc_sli4_parse_latt_fault(struct lpfc_hba *phba, 5190 5190 struct lpfc_acqe_link *acqe_link) 5191 5191 { 5192 - switch (bf_get(lpfc_acqe_link_fault, acqe_link)) { 5193 - case LPFC_ASYNC_LINK_FAULT_NONE: 5194 - case LPFC_ASYNC_LINK_FAULT_LOCAL: 5195 - case LPFC_ASYNC_LINK_FAULT_REMOTE: 5196 - case LPFC_ASYNC_LINK_FAULT_LR_LRR: 5192 + switch (bf_get(lpfc_acqe_fc_la_att_type, acqe_link)) { 5193 + case LPFC_FC_LA_TYPE_LINK_DOWN: 5194 + case LPFC_FC_LA_TYPE_TRUNKING_EVENT: 5195 + case LPFC_FC_LA_TYPE_ACTIVATE_FAIL: 5196 + case LPFC_FC_LA_TYPE_LINK_RESET_PRTCL_EVT: 5197 5197 break; 5198 5198 default: 5199 - lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, 5200 - "0398 Unknown link fault code: x%x\n", 5201 - bf_get(lpfc_acqe_link_fault, acqe_link)); 5199 + switch (bf_get(lpfc_acqe_link_fault, acqe_link)) { 5200 + case LPFC_ASYNC_LINK_FAULT_NONE: 5201 + case LPFC_ASYNC_LINK_FAULT_LOCAL: 5202 + case LPFC_ASYNC_LINK_FAULT_REMOTE: 5203 + case LPFC_ASYNC_LINK_FAULT_LR_LRR: 5204 + break; 5205 + default: 5206 + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, 5207 + "0398 Unknown link fault code: x%x\n", 5208 + bf_get(lpfc_acqe_link_fault, acqe_link)); 5209 + break; 5210 + } 5202 5211 break; 5203 5212 } 5204 5213 } ··· 6290 6281 LPFC_MBOXQ_t *pmb; 6291 6282 MAILBOX_t *mb; 6292 6283 struct lpfc_mbx_read_top *la; 6284 + char *log_level; 6293 6285 int rc; 6294 6286 6295 6287 if (bf_get(lpfc_trailer_type, acqe_fc) != ··· 6322 6312 bf_get(lpfc_acqe_fc_la_port_number, acqe_fc); 6323 6313 phba->sli4_hba.link_state.fault = 6324 6314 bf_get(lpfc_acqe_link_fault, acqe_fc); 6315 + phba->sli4_hba.link_state.link_status = 6316 + bf_get(lpfc_acqe_fc_la_link_status, acqe_fc); 6325 6317 6326 - if (bf_get(lpfc_acqe_fc_la_att_type, acqe_fc) == 6327 - LPFC_FC_LA_TYPE_LINK_DOWN) 6328 - phba->sli4_hba.link_state.logical_speed = 0; 6329 - else if (!phba->sli4_hba.conf_trunk) 6330 - phba->sli4_hba.link_state.logical_speed = 6318 + /* 6319 + * Only select attention types need logical speed modification to what 6320 + * was previously set. 6321 + */ 6322 + if (phba->sli4_hba.link_state.status >= LPFC_FC_LA_TYPE_LINK_UP && 6323 + phba->sli4_hba.link_state.status < LPFC_FC_LA_TYPE_ACTIVATE_FAIL) { 6324 + if (bf_get(lpfc_acqe_fc_la_att_type, acqe_fc) == 6325 + LPFC_FC_LA_TYPE_LINK_DOWN) 6326 + phba->sli4_hba.link_state.logical_speed = 0; 6327 + else if (!phba->sli4_hba.conf_trunk) 6328 + phba->sli4_hba.link_state.logical_speed = 6331 6329 bf_get(lpfc_acqe_fc_la_llink_spd, acqe_fc) * 10; 6330 + } 6332 6331 6333 6332 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 6334 6333 "2896 Async FC event - Speed:%dGBaud Topology:x%x " 6335 6334 "LA Type:x%x Port Type:%d Port Number:%d Logical speed:" 6336 - "%dMbps Fault:%d\n", 6335 + "%dMbps Fault:x%x Link Status:x%x\n", 6337 6336 phba->sli4_hba.link_state.speed, 6338 6337 phba->sli4_hba.link_state.topology, 6339 6338 phba->sli4_hba.link_state.status, 6340 6339 phba->sli4_hba.link_state.type, 6341 6340 phba->sli4_hba.link_state.number, 6342 6341 phba->sli4_hba.link_state.logical_speed, 6343 - phba->sli4_hba.link_state.fault); 6342 + phba->sli4_hba.link_state.fault, 6343 + phba->sli4_hba.link_state.link_status); 6344 + 6345 + /* 6346 + * The following attention types are informational only, providing 6347 + * further details about link status. Overwrite the value of 6348 + * link_state.status appropriately. No further action is required. 6349 + */ 6350 + if (phba->sli4_hba.link_state.status >= LPFC_FC_LA_TYPE_ACTIVATE_FAIL) { 6351 + switch (phba->sli4_hba.link_state.status) { 6352 + case LPFC_FC_LA_TYPE_ACTIVATE_FAIL: 6353 + log_level = KERN_WARNING; 6354 + phba->sli4_hba.link_state.status = 6355 + LPFC_FC_LA_TYPE_LINK_DOWN; 6356 + break; 6357 + case LPFC_FC_LA_TYPE_LINK_RESET_PRTCL_EVT: 6358 + /* 6359 + * During bb credit recovery establishment, receiving 6360 + * this attention type is normal. Link Up attention 6361 + * type is expected to occur before this informational 6362 + * attention type so keep the Link Up status. 6363 + */ 6364 + log_level = KERN_INFO; 6365 + phba->sli4_hba.link_state.status = 6366 + LPFC_FC_LA_TYPE_LINK_UP; 6367 + break; 6368 + default: 6369 + log_level = KERN_INFO; 6370 + break; 6371 + } 6372 + lpfc_log_msg(phba, log_level, LOG_SLI, 6373 + "2992 Async FC event - Informational Link " 6374 + "Attention Type x%x\n", 6375 + bf_get(lpfc_acqe_fc_la_att_type, acqe_fc)); 6376 + return; 6377 + } 6378 + 6344 6379 pmb = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 6345 6380 if (!pmb) { 6346 6381 lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, ··· 13971 13916 /* Make sure that sge_supp_len can be handled by the driver */ 13972 13917 if (sli4_params->sge_supp_len > LPFC_MAX_SGE_SIZE) 13973 13918 sli4_params->sge_supp_len = LPFC_MAX_SGE_SIZE; 13919 + 13920 + rc = dma_set_max_seg_size(&phba->pcidev->dev, sli4_params->sge_supp_len); 13921 + if (unlikely(rc)) { 13922 + lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 13923 + "6400 Can't set dma maximum segment size\n"); 13924 + return rc; 13925 + } 13974 13926 13975 13927 /* 13976 13928 * Check whether the adapter supports an embedded copy of the
+3 -5
drivers/scsi/lpfc/lpfc_scsi.c
··· 1 1 /******************************************************************* 2 2 * This file is part of the Emulex Linux Device Driver for * 3 3 * 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 * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2004-2016 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 1689 1689 struct lpfc_pde6 *pde6 = NULL; 1690 1690 struct lpfc_pde7 *pde7 = NULL; 1691 1691 dma_addr_t dataphysaddr, protphysaddr; 1692 - unsigned short curr_data = 0, curr_prot = 0; 1692 + unsigned short curr_prot = 0; 1693 1693 unsigned int split_offset; 1694 1694 unsigned int protgroup_len, protgroup_offset = 0, protgroup_remainder; 1695 1695 unsigned int protgrp_blks, protgrp_bytes; ··· 1858 1858 bpl->tus.w = le32_to_cpu(bpl->tus.w); 1859 1859 1860 1860 num_bde++; 1861 - curr_data++; 1862 1861 1863 1862 if (split_offset) 1864 1863 break; ··· 2118 2119 struct scatterlist *sgpe = NULL; /* s/g prot entry */ 2119 2120 struct sli4_sge_diseed *diseed = NULL; 2120 2121 dma_addr_t dataphysaddr, protphysaddr; 2121 - unsigned short curr_data = 0, curr_prot = 0; 2122 + unsigned short curr_prot = 0; 2122 2123 unsigned int split_offset; 2123 2124 unsigned int protgroup_len, protgroup_offset = 0, protgroup_remainder; 2124 2125 unsigned int protgrp_blks, protgrp_bytes; ··· 2363 2364 dma_offset += dma_len; 2364 2365 2365 2366 num_sge++; 2366 - curr_data++; 2367 2367 2368 2368 if (split_offset) { 2369 2369 sgl++;
+43 -40
drivers/scsi/lpfc/lpfc_sli.c
··· 1 1 /******************************************************************* 2 2 * This file is part of the Emulex Linux Device Driver for * 3 3 * 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 * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2004-2016 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 11270 11270 } 11271 11271 } 11272 11272 11273 + inline void lpfc_sli4_poll_eq(struct lpfc_queue *eq) 11274 + { 11275 + struct lpfc_hba *phba = eq->phba; 11276 + 11277 + /* 11278 + * Unlocking an irq is one of the entry point to check 11279 + * for re-schedule, but we are good for io submission 11280 + * path as midlayer does a get_cpu to glue us in. Flush 11281 + * out the invalidate queue so we can see the updated 11282 + * value for flag. 11283 + */ 11284 + smp_rmb(); 11285 + 11286 + if (READ_ONCE(eq->mode) == LPFC_EQ_POLL) 11287 + /* We will not likely get the completion for the caller 11288 + * during this iteration but i guess that's fine. 11289 + * Future io's coming on this eq should be able to 11290 + * pick it up. As for the case of single io's, they 11291 + * will be handled through a sched from polling timer 11292 + * function which is currently triggered every 1msec. 11293 + */ 11294 + lpfc_sli4_process_eq(phba, eq, LPFC_QUEUE_NOARM); 11295 + } 11296 + 11273 11297 /** 11274 11298 * lpfc_sli_issue_iocb - Wrapper function for __lpfc_sli_issue_iocb 11275 11299 * @phba: Pointer to HBA context object. ··· 11333 11309 rc = __lpfc_sli_issue_iocb(phba, ring_number, piocb, flag); 11334 11310 spin_unlock_irqrestore(&pring->ring_lock, iflags); 11335 11311 11336 - lpfc_sli4_poll_eq(eq, LPFC_POLL_FASTPATH); 11312 + lpfc_sli4_poll_eq(eq); 11337 11313 } else { 11338 11314 /* For now, SLI2/3 will still use hbalock */ 11339 11315 spin_lock_irqsave(&phba->hbalock, iflags); ··· 15649 15625 { 15650 15626 struct lpfc_hba *phba = from_timer(phba, t, cpuhp_poll_timer); 15651 15627 struct lpfc_queue *eq; 15652 - int i = 0; 15653 15628 15654 15629 rcu_read_lock(); 15655 15630 15656 15631 list_for_each_entry_rcu(eq, &phba->poll_list, _poll_list) 15657 - i += lpfc_sli4_poll_eq(eq, LPFC_POLL_SLOWPATH); 15632 + lpfc_sli4_poll_eq(eq); 15658 15633 if (!list_empty(&phba->poll_list)) 15659 15634 mod_timer(&phba->cpuhp_poll_timer, 15660 15635 jiffies + msecs_to_jiffies(LPFC_POLL_HB)); 15661 15636 15662 15637 rcu_read_unlock(); 15663 - } 15664 - 15665 - inline int lpfc_sli4_poll_eq(struct lpfc_queue *eq, uint8_t path) 15666 - { 15667 - struct lpfc_hba *phba = eq->phba; 15668 - int i = 0; 15669 - 15670 - /* 15671 - * Unlocking an irq is one of the entry point to check 15672 - * for re-schedule, but we are good for io submission 15673 - * path as midlayer does a get_cpu to glue us in. Flush 15674 - * out the invalidate queue so we can see the updated 15675 - * value for flag. 15676 - */ 15677 - smp_rmb(); 15678 - 15679 - if (READ_ONCE(eq->mode) == LPFC_EQ_POLL) 15680 - /* We will not likely get the completion for the caller 15681 - * during this iteration but i guess that's fine. 15682 - * Future io's coming on this eq should be able to 15683 - * pick it up. As for the case of single io's, they 15684 - * will be handled through a sched from polling timer 15685 - * function which is currently triggered every 1msec. 15686 - */ 15687 - i = lpfc_sli4_process_eq(phba, eq, LPFC_QUEUE_NOARM); 15688 - 15689 - return i; 15690 15638 } 15691 15639 15692 15640 static inline void lpfc_sli4_add_to_poll_list(struct lpfc_queue *eq) ··· 20815 20819 struct lpfc_mbx_wr_object *wr_object; 20816 20820 LPFC_MBOXQ_t *mbox; 20817 20821 int rc = 0, i = 0; 20822 + int mbox_status = 0; 20818 20823 uint32_t shdr_status, shdr_add_status, shdr_add_status_2; 20819 20824 uint32_t shdr_change_status = 0, shdr_csf = 0; 20820 20825 uint32_t mbox_tmo; ··· 20861 20864 wr_object->u.request.bde_count = i; 20862 20865 bf_set(lpfc_wr_object_write_length, &wr_object->u.request, written); 20863 20866 if (!phba->sli4_hba.intr_enable) 20864 - rc = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); 20867 + mbox_status = lpfc_sli_issue_mbox(phba, mbox, MBX_POLL); 20865 20868 else { 20866 20869 mbox_tmo = lpfc_mbox_tmo_val(phba, mbox); 20867 - rc = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); 20870 + mbox_status = lpfc_sli_issue_mbox_wait(phba, mbox, mbox_tmo); 20868 20871 } 20872 + 20873 + /* The mbox status needs to be maintained to detect MBOX_TIMEOUT. */ 20874 + rc = mbox_status; 20875 + 20869 20876 /* The IOCTL status is embedded in the mailbox subheader. */ 20870 20877 shdr_status = bf_get(lpfc_mbox_hdr_status, 20871 20878 &wr_object->header.cfg_shdr.response); ··· 20884 20883 &wr_object->u.response); 20885 20884 } 20886 20885 20887 - if (!phba->sli4_hba.intr_enable) 20888 - mempool_free(mbox, phba->mbox_mem_pool); 20889 - else if (rc != MBX_TIMEOUT) 20890 - mempool_free(mbox, phba->mbox_mem_pool); 20891 20886 if (shdr_status || shdr_add_status || shdr_add_status_2 || rc) { 20892 20887 lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, 20893 20888 "3025 Write Object mailbox failed with " ··· 20901 20904 lpfc_log_fw_write_cmpl(phba, shdr_status, shdr_add_status, 20902 20905 shdr_add_status_2, shdr_change_status, 20903 20906 shdr_csf); 20907 + 20908 + if (!phba->sli4_hba.intr_enable) 20909 + mempool_free(mbox, phba->mbox_mem_pool); 20910 + else if (mbox_status != MBX_TIMEOUT) 20911 + mempool_free(mbox, phba->mbox_mem_pool); 20912 + 20904 20913 return rc; 20905 20914 } 20906 20915 ··· 21279 21276 lpfc_sli_ringtxcmpl_put(phba, pring, pwqe); 21280 21277 spin_unlock_irqrestore(&pring->ring_lock, iflags); 21281 21278 21282 - lpfc_sli4_poll_eq(qp->hba_eq, LPFC_POLL_FASTPATH); 21279 + lpfc_sli4_poll_eq(qp->hba_eq); 21283 21280 return 0; 21284 21281 } 21285 21282 ··· 21301 21298 lpfc_sli_ringtxcmpl_put(phba, pring, pwqe); 21302 21299 spin_unlock_irqrestore(&pring->ring_lock, iflags); 21303 21300 21304 - lpfc_sli4_poll_eq(qp->hba_eq, LPFC_POLL_FASTPATH); 21301 + lpfc_sli4_poll_eq(qp->hba_eq); 21305 21302 return 0; 21306 21303 } 21307 21304 ··· 21331 21328 lpfc_sli_ringtxcmpl_put(phba, pring, pwqe); 21332 21329 spin_unlock_irqrestore(&pring->ring_lock, iflags); 21333 21330 21334 - lpfc_sli4_poll_eq(qp->hba_eq, LPFC_POLL_FASTPATH); 21331 + lpfc_sli4_poll_eq(qp->hba_eq); 21335 21332 return 0; 21336 21333 } 21337 21334 return WQE_ERROR;
+3 -2
drivers/scsi/lpfc/lpfc_sli4.h
··· 1 1 /******************************************************************* 2 2 * This file is part of the Emulex Linux Device Driver for * 3 3 * 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 * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2009-2016 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 291 291 uint8_t type; 292 292 uint8_t number; 293 293 uint8_t fault; 294 - uint32_t logical_speed; 294 + uint8_t link_status; 295 295 uint16_t topology; 296 + uint32_t logical_speed; 296 297 }; 297 298 298 299 struct lpfc_fcf_rec {
+3 -3
drivers/scsi/lpfc/lpfc_version.h
··· 1 1 /******************************************************************* 2 2 * This file is part of the Emulex Linux Device Driver for * 3 3 * 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 * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2004-2016 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 20 20 * included with this package. * 21 21 *******************************************************************/ 22 22 23 - #define LPFC_DRIVER_VERSION "14.2.0.9" 23 + #define LPFC_DRIVER_VERSION "14.2.0.10" 24 24 #define LPFC_DRIVER_NAME "lpfc" 25 25 26 26 /* Used for SLI 2/3 */ ··· 32 32 33 33 #define LPFC_MODULE_DESC "Emulex LightPulse Fibre Channel SCSI driver " \ 34 34 LPFC_DRIVER_VERSION 35 - #define LPFC_COPYRIGHT "Copyright (C) 2017-2022 Broadcom. All Rights " \ 35 + #define LPFC_COPYRIGHT "Copyright (C) 2017-2023 Broadcom. All Rights " \ 36 36 "Reserved. The term \"Broadcom\" refers to Broadcom Inc. " \ 37 37 "and/or its subsidiaries."
+40 -1
drivers/scsi/lpfc/lpfc_vmid.c
··· 1 1 /******************************************************************* 2 2 * This file is part of the Emulex Linux Device Driver for * 3 3 * 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 * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2004-2016 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 283 283 } 284 284 } 285 285 return rc; 286 + } 287 + 288 + /* 289 + * lpfc_reinit_vmid - reinitializes the vmid data structure 290 + * @vport: pointer to vport data structure 291 + * 292 + * This routine reinitializes the vmid post flogi completion 293 + * 294 + * Return codes 295 + * None 296 + */ 297 + void 298 + lpfc_reinit_vmid(struct lpfc_vport *vport) 299 + { 300 + u32 bucket, i, cpu; 301 + struct lpfc_vmid *cur; 302 + struct lpfc_vmid *vmp = NULL; 303 + struct hlist_node *tmp; 304 + 305 + write_lock(&vport->vmid_lock); 306 + vport->cur_vmid_cnt = 0; 307 + 308 + for (i = 0; i < vport->max_vmid; i++) { 309 + vmp = &vport->vmid[i]; 310 + vmp->flag = LPFC_VMID_SLOT_FREE; 311 + memset(vmp->host_vmid, 0, sizeof(vmp->host_vmid)); 312 + vmp->io_rd_cnt = 0; 313 + vmp->io_wr_cnt = 0; 314 + 315 + if (vmp->last_io_time) 316 + for_each_possible_cpu(cpu) 317 + *per_cpu_ptr(vmp->last_io_time, cpu) = 0; 318 + } 319 + 320 + /* for all elements in the hash table */ 321 + if (!hash_empty(vport->hash_table)) 322 + hash_for_each_safe(vport->hash_table, bucket, tmp, cur, hnode) 323 + hash_del(&cur->hnode); 324 + write_unlock(&vport->vmid_lock); 286 325 }
+3 -13
drivers/scsi/lpfc/lpfc_vport.c
··· 1 1 /******************************************************************* 2 2 * This file is part of the Emulex Linux Device Driver for * 3 3 * 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 * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2004-2016 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 534 534 { 535 535 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; 536 536 struct lpfc_hba *phba = vport->phba; 537 - struct lpfc_nodelist *ndlp = NULL, *next_ndlp = NULL; 537 + struct lpfc_nodelist *ndlp = NULL; 538 538 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 539 539 540 540 /* Can't disable during an outstanding delete. */ ··· 546 546 (void)lpfc_send_npiv_logo(vport, ndlp); 547 547 548 548 lpfc_sli_host_down(vport); 549 - 550 - /* Mark all nodes for discovery so we can remove them by 551 - * calling lpfc_cleanup_rpis(vport, 1) 552 - */ 553 - list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { 554 - if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) 555 - continue; 556 - lpfc_disc_state_machine(vport, ndlp, NULL, 557 - NLP_EVT_DEVICE_RECOVERY); 558 - } 559 - lpfc_cleanup_rpis(vport, 1); 549 + lpfc_cleanup_rpis(vport, 0); 560 550 561 551 lpfc_stop_vport_timers(vport); 562 552 lpfc_unreg_all_rpis(vport);