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 "Update lpfc to revision 14.4.0.6"

Justin Tee <justintee8345@gmail.com> says:

Update lpfc to revision 14.4.0.6

This patch set contains bug fixes related to congestion handling,
accounting for internal remoteport objects, resource release during
HBA unload and reset, and clean up regarding the abuse of a global
spinlock.

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

Link: https://lore.kernel.org/r/20241031223219.152342-1-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

+667 -816
+5 -1
drivers/scsi/lpfc/lpfc_bsg.c
··· 398 398 /* in case no data is transferred */ 399 399 bsg_reply->reply_payload_rcv_len = 0; 400 400 401 - if (ndlp->nlp_flag & NLP_ELS_SND_MASK) 401 + if (test_bit(NLP_PLOGI_SND, &ndlp->nlp_flag) || 402 + test_bit(NLP_PRLI_SND, &ndlp->nlp_flag) || 403 + test_bit(NLP_ADISC_SND, &ndlp->nlp_flag) || 404 + test_bit(NLP_LOGO_SND, &ndlp->nlp_flag) || 405 + test_bit(NLP_RNID_SND, &ndlp->nlp_flag)) 402 406 return -ENODEV; 403 407 404 408 /* allocate our bsg tracking structure */
+3 -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-2023 Broadcom. All Rights Reserved. The term * 4 + * Copyright (C) 2017-2024 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. * ··· 571 571 int lpfc_issue_unreg_vfi(struct lpfc_vport *); 572 572 int lpfc_selective_reset(struct lpfc_hba *); 573 573 int lpfc_sli4_read_config(struct lpfc_hba *); 574 - void lpfc_sli4_node_prep(struct lpfc_hba *); 574 + void lpfc_sli4_node_rpi_restore(struct lpfc_hba *phba); 575 575 int lpfc_sli4_els_sgl_update(struct lpfc_hba *phba); 576 576 int lpfc_sli4_nvmet_sgl_update(struct lpfc_hba *phba); 577 577 int lpfc_io_buf_flush(struct lpfc_hba *phba, struct list_head *sglist); ··· 660 660 void lpfc_nvmet_cmd_template(void); 661 661 void lpfc_nvme_cancel_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, 662 662 uint32_t stat, uint32_t param); 663 + void lpfc_nvmels_flush_cmd(struct lpfc_hba *phba); 663 664 extern int lpfc_enable_nvmet_cnt; 664 665 extern unsigned long long lpfc_enable_nvmet[]; 665 666 extern int lpfc_no_hba_reset_cnt;
+21 -18
drivers/scsi/lpfc/lpfc_ct.c
··· 735 735 736 736 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 737 737 "0238 Process x%06x NameServer Rsp " 738 - "Data: x%x x%x x%x x%lx x%x\n", Did, 738 + "Data: x%lx x%x x%x x%lx x%x\n", Did, 739 739 ndlp->nlp_flag, ndlp->nlp_fc4_type, 740 740 ndlp->nlp_state, vport->fc_flag, 741 741 vport->fc_rscn_id_cnt); ··· 744 744 * state of ndlp hit devloss, change state to 745 745 * allow rediscovery. 746 746 */ 747 - if (ndlp->nlp_flag & NLP_NPR_2B_DISC && 747 + if (test_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag) && 748 748 ndlp->nlp_state == NLP_STE_UNUSED_NODE) { 749 749 lpfc_nlp_set_state(vport, ndlp, 750 750 NLP_STE_NPR_NODE); ··· 832 832 if (ndlp->nlp_type != NLP_NVME_INITIATOR || 833 833 ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) 834 834 continue; 835 - spin_lock_irq(&ndlp->lock); 836 835 if (ndlp->nlp_DID == Did) 837 - ndlp->nlp_flag &= ~NLP_NVMET_RECOV; 836 + clear_bit(NLP_NVMET_RECOV, &ndlp->nlp_flag); 838 837 else 839 - ndlp->nlp_flag |= NLP_NVMET_RECOV; 840 - spin_unlock_irq(&ndlp->lock); 838 + set_bit(NLP_NVMET_RECOV, &ndlp->nlp_flag); 841 839 } 842 840 } 843 841 } ··· 892 894 */ 893 895 if (vport->phba->nvmet_support) { 894 896 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { 895 - if (!(ndlp->nlp_flag & NLP_NVMET_RECOV)) 897 + if (!test_bit(NLP_NVMET_RECOV, &ndlp->nlp_flag)) 896 898 continue; 897 899 lpfc_disc_state_machine(vport, ndlp, NULL, 898 900 NLP_EVT_DEVICE_RECOVERY); 899 - spin_lock_irq(&ndlp->lock); 900 - ndlp->nlp_flag &= ~NLP_NVMET_RECOV; 901 - spin_unlock_irq(&ndlp->lock); 901 + clear_bit(NLP_NVMET_RECOV, &ndlp->nlp_flag); 902 902 } 903 903 } 904 904 ··· 1436 1440 if (ndlp) { 1437 1441 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 1438 1442 "0242 Process x%x GFF " 1439 - "NameServer Rsp Data: x%x x%lx x%x\n", 1443 + "NameServer Rsp Data: x%lx x%lx x%x\n", 1440 1444 did, ndlp->nlp_flag, vport->fc_flag, 1441 1445 vport->fc_rscn_id_cnt); 1442 1446 } else { ··· 2222 2226 ulp_status, ulp_word4, latt); 2223 2227 2224 2228 if (latt || ulp_status) { 2229 + lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY, 2230 + "0229 FDMI cmd %04x failed, latt = %d " 2231 + "ulp_status: (x%x/x%x), sli_flag x%x\n", 2232 + be16_to_cpu(fdmi_cmd), latt, ulp_status, 2233 + ulp_word4, phba->sli.sli_flag); 2225 2234 2226 2235 /* Look for a retryable error */ 2227 2236 if (ulp_status == IOSTAT_LOCAL_REJECT) { ··· 2235 2234 case IOERR_SLI_DOWN: 2236 2235 /* Driver aborted this IO. No retry as error 2237 2236 * is likely Offline->Online or some adapter 2238 - * error. Recovery will try again. 2237 + * error. Recovery will try again, but if port 2238 + * is not active there's no point to continue 2239 + * issuing follow up FDMI commands. 2239 2240 */ 2241 + if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE)) { 2242 + free_ndlp = cmdiocb->ndlp; 2243 + lpfc_ct_free_iocb(phba, cmdiocb); 2244 + lpfc_nlp_put(free_ndlp); 2245 + return; 2246 + } 2240 2247 break; 2241 2248 case IOERR_ABORT_IN_PROGRESS: 2242 2249 case IOERR_SEQUENCE_TIMEOUT: ··· 2265 2256 break; 2266 2257 } 2267 2258 } 2268 - 2269 - lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 2270 - "0229 FDMI cmd %04x latt = %d " 2271 - "ulp_status: x%x, rid x%x\n", 2272 - be16_to_cpu(fdmi_cmd), latt, ulp_status, 2273 - ulp_word4); 2274 2259 } 2275 2260 2276 2261 free_ndlp = cmdiocb->ndlp;
+2 -2
drivers/scsi/lpfc/lpfc_debugfs.c
··· 870 870 wwn_to_u64(ndlp->nlp_nodename.u.wwn)); 871 871 len += scnprintf(buf+len, size-len, "RPI:x%04x ", 872 872 ndlp->nlp_rpi); 873 - len += scnprintf(buf+len, size-len, "flag:x%08x ", 874 - ndlp->nlp_flag); 873 + len += scnprintf(buf+len, size-len, "flag:x%08lx ", 874 + ndlp->nlp_flag); 875 875 if (!ndlp->nlp_type) 876 876 len += scnprintf(buf+len, size-len, "UNKNOWN_TYPE "); 877 877 if (ndlp->nlp_type & NLP_FC_NODE)
+31 -31
drivers/scsi/lpfc/lpfc_disc.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-2024 Broadcom. All Rights Reserved. The term * 5 5 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * 6 6 * Copyright (C) 2004-2013 Emulex. All rights reserved. * 7 7 * EMULEX and SLI are trademarks of Emulex. * ··· 102 102 103 103 spinlock_t lock; /* Node management lock */ 104 104 105 - uint32_t nlp_flag; /* entry flags */ 105 + unsigned long nlp_flag; /* entry flags */ 106 106 uint32_t nlp_DID; /* FC D_ID of entry */ 107 107 uint32_t nlp_last_elscmd; /* Last ELS cmd sent */ 108 108 uint16_t nlp_type; ··· 182 182 #define lpfc_ndlp_check_qdepth(phba, ndlp) \ 183 183 (ndlp->cmd_qdepth < phba->sli4_hba.max_cfg_param.max_xri) 184 184 185 - /* Defines for nlp_flag (uint32) */ 186 - #define NLP_IGNR_REG_CMPL 0x00000001 /* Rcvd rscn before we cmpl reg login */ 187 - #define NLP_REG_LOGIN_SEND 0x00000002 /* sent reglogin to adapter */ 188 - #define NLP_RELEASE_RPI 0x00000004 /* Release RPI to free pool */ 189 - #define NLP_SUPPRESS_RSP 0x00000010 /* Remote NPort supports suppress rsp */ 190 - #define NLP_PLOGI_SND 0x00000020 /* sent PLOGI request for this entry */ 191 - #define NLP_PRLI_SND 0x00000040 /* sent PRLI request for this entry */ 192 - #define NLP_ADISC_SND 0x00000080 /* sent ADISC request for this entry */ 193 - #define NLP_LOGO_SND 0x00000100 /* sent LOGO request for this entry */ 194 - #define NLP_RNID_SND 0x00000400 /* sent RNID request for this entry */ 195 - #define NLP_ELS_SND_MASK 0x000007e0 /* sent ELS request for this entry */ 196 - #define NLP_NVMET_RECOV 0x00001000 /* NVMET auditing node for recovery. */ 197 - #define NLP_UNREG_INP 0x00008000 /* UNREG_RPI cmd is in progress */ 198 - #define NLP_DROPPED 0x00010000 /* Init ref count has been dropped */ 199 - #define NLP_DELAY_TMO 0x00020000 /* delay timeout is running for node */ 200 - #define NLP_NPR_2B_DISC 0x00040000 /* node is included in num_disc_nodes */ 201 - #define NLP_RCV_PLOGI 0x00080000 /* Rcv'ed PLOGI from remote system */ 202 - #define NLP_LOGO_ACC 0x00100000 /* Process LOGO after ACC completes */ 203 - #define NLP_TGT_NO_SCSIID 0x00200000 /* good PRLI but no binding for scsid */ 204 - #define NLP_ISSUE_LOGO 0x00400000 /* waiting to issue a LOGO */ 205 - #define NLP_IN_DEV_LOSS 0x00800000 /* devloss in progress */ 206 - #define NLP_ACC_REGLOGIN 0x01000000 /* Issue Reg Login after successful 185 + /* nlp_flag mask bits */ 186 + enum lpfc_nlp_flag { 187 + NLP_IGNR_REG_CMPL = 0, /* Rcvd rscn before we cmpl reg login */ 188 + NLP_REG_LOGIN_SEND = 1, /* sent reglogin to adapter */ 189 + NLP_SUPPRESS_RSP = 4, /* Remote NPort supports suppress rsp */ 190 + NLP_PLOGI_SND = 5, /* sent PLOGI request for this entry */ 191 + NLP_PRLI_SND = 6, /* sent PRLI request for this entry */ 192 + NLP_ADISC_SND = 7, /* sent ADISC request for this entry */ 193 + NLP_LOGO_SND = 8, /* sent LOGO request for this entry */ 194 + NLP_RNID_SND = 10, /* sent RNID request for this entry */ 195 + NLP_NVMET_RECOV = 12, /* NVMET auditing node for recovery. */ 196 + NLP_UNREG_INP = 15, /* UNREG_RPI cmd is in progress */ 197 + NLP_DROPPED = 16, /* Init ref count has been dropped */ 198 + NLP_DELAY_TMO = 17, /* delay timeout is running for node */ 199 + NLP_NPR_2B_DISC = 18, /* node is included in num_disc_nodes */ 200 + NLP_RCV_PLOGI = 19, /* Rcv'ed PLOGI from remote system */ 201 + NLP_LOGO_ACC = 20, /* Process LOGO after ACC completes */ 202 + NLP_TGT_NO_SCSIID = 21, /* good PRLI but no binding for scsid */ 203 + NLP_ISSUE_LOGO = 22, /* waiting to issue a LOGO */ 204 + NLP_IN_DEV_LOSS = 23, /* devloss in progress */ 205 + NLP_ACC_REGLOGIN = 24, /* Issue Reg Login after successful 207 206 ACC */ 208 - #define NLP_NPR_ADISC 0x02000000 /* Issue ADISC when dq'ed from 207 + NLP_NPR_ADISC = 25, /* Issue ADISC when dq'ed from 209 208 NPR list */ 210 - #define NLP_RM_DFLT_RPI 0x04000000 /* need to remove leftover dflt RPI */ 211 - #define NLP_NODEV_REMOVE 0x08000000 /* Defer removal till discovery ends */ 212 - #define NLP_TARGET_REMOVE 0x10000000 /* Target remove in process */ 213 - #define NLP_SC_REQ 0x20000000 /* Target requires authentication */ 214 - #define NLP_FIRSTBURST 0x40000000 /* Target supports FirstBurst */ 215 - #define NLP_RPI_REGISTERED 0x80000000 /* nlp_rpi is valid */ 209 + NLP_RM_DFLT_RPI = 26, /* need to remove leftover dflt RPI */ 210 + NLP_NODEV_REMOVE = 27, /* Defer removal till discovery ends */ 211 + NLP_TARGET_REMOVE = 28, /* Target remove in process */ 212 + NLP_SC_REQ = 29, /* Target requires authentication */ 213 + NLP_FIRSTBURST = 30, /* Target supports FirstBurst */ 214 + NLP_RPI_REGISTERED = 31 /* nlp_rpi is valid */ 215 + }; 216 216 217 217 /* There are 4 different double linked lists nodelist entries can reside on. 218 218 * The Port Login (PLOGI) list and Address Discovery (ADISC) list are used
+190 -273
drivers/scsi/lpfc/lpfc_els.c
··· 725 725 list_for_each_entry_safe(np, next_np, 726 726 &vport->fc_nodes, nlp_listp) { 727 727 if ((np->nlp_state != NLP_STE_NPR_NODE) || 728 - !(np->nlp_flag & NLP_NPR_ADISC)) 728 + !test_bit(NLP_NPR_ADISC, &np->nlp_flag)) 729 729 continue; 730 - spin_lock_irq(&np->lock); 731 - np->nlp_flag &= ~NLP_NPR_ADISC; 732 - spin_unlock_irq(&np->lock); 730 + clear_bit(NLP_NPR_ADISC, &np->nlp_flag); 733 731 lpfc_unreg_rpi(vport, np); 734 732 } 735 733 lpfc_cleanup_pending_mbox(vport); ··· 862 864 sizeof(struct lpfc_name)); 863 865 /* Set state will put ndlp onto node list if not already done */ 864 866 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); 865 - spin_lock_irq(&ndlp->lock); 866 - ndlp->nlp_flag |= NLP_NPR_2B_DISC; 867 - spin_unlock_irq(&ndlp->lock); 867 + set_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 868 868 869 869 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 870 870 if (!mbox) ··· 1014 1018 * registered with the SCSI transport, remove the initial 1015 1019 * reference to trigger node release. 1016 1020 */ 1017 - if (!(ndlp->nlp_flag & NLP_IN_DEV_LOSS) && 1021 + if (!test_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag) && 1018 1022 !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) 1019 1023 lpfc_nlp_put(ndlp); 1020 1024 ··· 1232 1236 1233 1237 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 1234 1238 "6445 ELS completes after LINK_DOWN: " 1235 - " Status %x/%x cmd x%x flg x%x\n", 1239 + " Status %x/%x cmd x%x flg x%x iotag x%x\n", 1236 1240 ulp_status, ulp_word4, cmd, 1237 - cmdiocb->cmd_flag); 1241 + cmdiocb->cmd_flag, cmdiocb->iotag); 1238 1242 1239 1243 if (cmdiocb->cmd_flag & LPFC_IO_FABRIC) { 1240 1244 cmdiocb->cmd_flag &= ~LPFC_IO_FABRIC; ··· 1544 1548 * Otherwise, decrement node reference to trigger release. 1545 1549 */ 1546 1550 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD)) && 1547 - !(ndlp->nlp_flag & NLP_IN_DEV_LOSS)) 1551 + !test_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag)) 1548 1552 lpfc_nlp_put(ndlp); 1549 1553 return 0; 1550 1554 } ··· 1593 1597 * Otherwise, decrement node reference to trigger release. 1594 1598 */ 1595 1599 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD)) && 1596 - !(ndlp->nlp_flag & NLP_IN_DEV_LOSS)) 1600 + !test_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag)) 1597 1601 lpfc_nlp_put(ndlp); 1598 1602 return 0; 1599 1603 } ··· 1671 1675 struct lpfc_nodelist *new_ndlp; 1672 1676 struct serv_parm *sp; 1673 1677 uint8_t name[sizeof(struct lpfc_name)]; 1674 - uint32_t keepDID = 0, keep_nlp_flag = 0; 1678 + uint32_t keepDID = 0; 1675 1679 int rc; 1676 - uint32_t keep_new_nlp_flag = 0; 1680 + unsigned long keep_nlp_flag = 0, keep_new_nlp_flag = 0; 1677 1681 uint16_t keep_nlp_state; 1678 1682 u32 keep_nlp_fc4_type = 0; 1679 1683 struct lpfc_nvme_rport *keep_nrport = NULL; ··· 1700 1704 } 1701 1705 1702 1706 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_NODE, 1703 - "3178 PLOGI confirm: ndlp x%x x%x x%x: " 1704 - "new_ndlp x%x x%x x%x\n", 1707 + "3178 PLOGI confirm: ndlp x%x x%lx x%x: " 1708 + "new_ndlp x%x x%lx x%x\n", 1705 1709 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_fc4_type, 1706 1710 (new_ndlp ? new_ndlp->nlp_DID : 0), 1707 1711 (new_ndlp ? new_ndlp->nlp_flag : 0), ··· 1765 1769 new_ndlp->nlp_flag = ndlp->nlp_flag; 1766 1770 1767 1771 /* if new_ndlp had NLP_UNREG_INP set, keep it */ 1768 - if (keep_new_nlp_flag & NLP_UNREG_INP) 1769 - new_ndlp->nlp_flag |= NLP_UNREG_INP; 1772 + if (test_bit(NLP_UNREG_INP, &keep_new_nlp_flag)) 1773 + set_bit(NLP_UNREG_INP, &new_ndlp->nlp_flag); 1770 1774 else 1771 - new_ndlp->nlp_flag &= ~NLP_UNREG_INP; 1775 + clear_bit(NLP_UNREG_INP, &new_ndlp->nlp_flag); 1772 1776 1773 1777 /* if new_ndlp had NLP_RPI_REGISTERED set, keep it */ 1774 - if (keep_new_nlp_flag & NLP_RPI_REGISTERED) 1775 - new_ndlp->nlp_flag |= NLP_RPI_REGISTERED; 1778 + if (test_bit(NLP_RPI_REGISTERED, &keep_new_nlp_flag)) 1779 + set_bit(NLP_RPI_REGISTERED, &new_ndlp->nlp_flag); 1776 1780 else 1777 - new_ndlp->nlp_flag &= ~NLP_RPI_REGISTERED; 1781 + clear_bit(NLP_RPI_REGISTERED, &new_ndlp->nlp_flag); 1778 1782 1779 1783 /* 1780 1784 * Retain the DROPPED flag. This will take care of the init 1781 1785 * refcount when affecting the state change 1782 1786 */ 1783 - if (keep_new_nlp_flag & NLP_DROPPED) 1784 - new_ndlp->nlp_flag |= NLP_DROPPED; 1787 + if (test_bit(NLP_DROPPED, &keep_new_nlp_flag)) 1788 + set_bit(NLP_DROPPED, &new_ndlp->nlp_flag); 1785 1789 else 1786 - new_ndlp->nlp_flag &= ~NLP_DROPPED; 1790 + clear_bit(NLP_DROPPED, &new_ndlp->nlp_flag); 1787 1791 1788 1792 ndlp->nlp_flag = keep_new_nlp_flag; 1789 1793 1790 1794 /* if ndlp had NLP_UNREG_INP set, keep it */ 1791 - if (keep_nlp_flag & NLP_UNREG_INP) 1792 - ndlp->nlp_flag |= NLP_UNREG_INP; 1795 + if (test_bit(NLP_UNREG_INP, &keep_nlp_flag)) 1796 + set_bit(NLP_UNREG_INP, &ndlp->nlp_flag); 1793 1797 else 1794 - ndlp->nlp_flag &= ~NLP_UNREG_INP; 1798 + clear_bit(NLP_UNREG_INP, &ndlp->nlp_flag); 1795 1799 1796 1800 /* if ndlp had NLP_RPI_REGISTERED set, keep it */ 1797 - if (keep_nlp_flag & NLP_RPI_REGISTERED) 1798 - ndlp->nlp_flag |= NLP_RPI_REGISTERED; 1801 + if (test_bit(NLP_RPI_REGISTERED, &keep_nlp_flag)) 1802 + set_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag); 1799 1803 else 1800 - ndlp->nlp_flag &= ~NLP_RPI_REGISTERED; 1804 + clear_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag); 1801 1805 1802 1806 /* 1803 1807 * Retain the DROPPED flag. This will take care of the init 1804 1808 * refcount when affecting the state change 1805 1809 */ 1806 - if (keep_nlp_flag & NLP_DROPPED) 1807 - ndlp->nlp_flag |= NLP_DROPPED; 1810 + if (test_bit(NLP_DROPPED, &keep_nlp_flag)) 1811 + set_bit(NLP_DROPPED, &ndlp->nlp_flag); 1808 1812 else 1809 - ndlp->nlp_flag &= ~NLP_DROPPED; 1813 + clear_bit(NLP_DROPPED, &ndlp->nlp_flag); 1810 1814 1811 1815 spin_unlock_irq(&new_ndlp->lock); 1812 1816 spin_unlock_irq(&ndlp->lock); ··· 1884 1888 phba->active_rrq_pool); 1885 1889 1886 1890 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_NODE, 1887 - "3173 PLOGI confirm exit: new_ndlp x%x x%x x%x\n", 1891 + "3173 PLOGI confirm exit: new_ndlp x%x x%lx x%x\n", 1888 1892 new_ndlp->nlp_DID, new_ndlp->nlp_flag, 1889 1893 new_ndlp->nlp_fc4_type); 1890 1894 ··· 2005 2009 IOCB_t *irsp; 2006 2010 struct lpfc_nodelist *ndlp, *free_ndlp; 2007 2011 struct lpfc_dmabuf *prsp; 2008 - int disc; 2012 + bool disc; 2009 2013 struct serv_parm *sp = NULL; 2010 2014 u32 ulp_status, ulp_word4, did, iotag; 2011 2015 bool release_node = false; ··· 2040 2044 /* Since ndlp can be freed in the disc state machine, note if this node 2041 2045 * is being used during discovery. 2042 2046 */ 2043 - spin_lock_irq(&ndlp->lock); 2044 - disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC); 2045 - ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 2046 - spin_unlock_irq(&ndlp->lock); 2047 + disc = test_and_clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2047 2048 2048 2049 /* PLOGI completes to NPort <nlp_DID> */ 2049 2050 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, ··· 2053 2060 2054 2061 /* Check to see if link went down during discovery */ 2055 2062 if (lpfc_els_chk_latt(vport)) { 2056 - spin_lock_irq(&ndlp->lock); 2057 - ndlp->nlp_flag |= NLP_NPR_2B_DISC; 2058 - spin_unlock_irq(&ndlp->lock); 2063 + set_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2059 2064 goto out; 2060 2065 } 2061 2066 ··· 2061 2070 /* Check for retry */ 2062 2071 if (lpfc_els_retry(phba, cmdiocb, rspiocb)) { 2063 2072 /* ELS command is being retried */ 2064 - if (disc) { 2065 - spin_lock_irq(&ndlp->lock); 2066 - ndlp->nlp_flag |= NLP_NPR_2B_DISC; 2067 - spin_unlock_irq(&ndlp->lock); 2068 - } 2073 + if (disc) 2074 + set_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2069 2075 goto out; 2070 2076 } 2071 2077 /* Warn PLOGI status Don't print the vport to vport rjts */ ··· 2085 2097 * with the reglogin process. 2086 2098 */ 2087 2099 spin_lock_irq(&ndlp->lock); 2088 - if ((ndlp->nlp_flag & (NLP_ACC_REGLOGIN | NLP_RCV_PLOGI)) && 2100 + if ((test_bit(NLP_ACC_REGLOGIN, &ndlp->nlp_flag) || 2101 + test_bit(NLP_RCV_PLOGI, &ndlp->nlp_flag)) && 2089 2102 ndlp->nlp_state == NLP_STE_REG_LOGIN_ISSUE) { 2090 2103 spin_unlock_irq(&ndlp->lock); 2091 2104 goto out; ··· 2097 2108 * start the device remove process. 2098 2109 */ 2099 2110 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD))) { 2100 - ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 2101 - if (!(ndlp->nlp_flag & NLP_IN_DEV_LOSS)) 2111 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2112 + if (!test_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag)) 2102 2113 release_node = true; 2103 2114 } 2104 2115 spin_unlock_irq(&ndlp->lock); ··· 2201 2212 * outstanding UNREG_RPI mbox command completes, unless we 2202 2213 * are going offline. This logic does not apply for Fabric DIDs 2203 2214 */ 2204 - if ((ndlp->nlp_flag & (NLP_IGNR_REG_CMPL | NLP_UNREG_INP)) && 2215 + if ((test_bit(NLP_IGNR_REG_CMPL, &ndlp->nlp_flag) || 2216 + test_bit(NLP_UNREG_INP, &ndlp->nlp_flag)) && 2205 2217 ((ndlp->nlp_DID & Fabric_DID_MASK) != Fabric_DID_MASK) && 2206 2218 !test_bit(FC_OFFLINE_MODE, &vport->fc_flag)) { 2207 2219 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 2208 2220 "4110 Issue PLOGI x%x deferred " 2209 - "on NPort x%x rpi x%x flg x%x Data:" 2221 + "on NPort x%x rpi x%x flg x%lx Data:" 2210 2222 " x%px\n", 2211 2223 ndlp->nlp_defer_did, ndlp->nlp_DID, 2212 2224 ndlp->nlp_rpi, ndlp->nlp_flag, ndlp); ··· 2325 2335 ulp_status = get_job_ulpstatus(phba, rspiocb); 2326 2336 ulp_word4 = get_job_word4(phba, rspiocb); 2327 2337 2328 - spin_lock_irq(&ndlp->lock); 2329 - ndlp->nlp_flag &= ~NLP_PRLI_SND; 2338 + clear_bit(NLP_PRLI_SND, &ndlp->nlp_flag); 2330 2339 2331 2340 /* Driver supports multiple FC4 types. Counters matter. */ 2341 + spin_lock_irq(&ndlp->lock); 2332 2342 vport->fc_prli_sent--; 2333 2343 ndlp->fc4_prli_sent--; 2334 2344 spin_unlock_irq(&ndlp->lock); ··· 2369 2379 /* Warn PRLI status */ 2370 2380 lpfc_printf_vlog(vport, mode, LOG_ELS, 2371 2381 "2754 PRLI DID:%06X Status:x%x/x%x, " 2372 - "data: x%x x%x x%x\n", 2382 + "data: x%x x%x x%lx\n", 2373 2383 ndlp->nlp_DID, ulp_status, 2374 2384 ulp_word4, ndlp->nlp_state, 2375 2385 ndlp->fc4_prli_sent, ndlp->nlp_flag); ··· 2386 2396 if ((ndlp->nlp_state >= NLP_STE_PLOGI_ISSUE && 2387 2397 ndlp->nlp_state <= NLP_STE_REG_LOGIN_ISSUE) || 2388 2398 (ndlp->nlp_state == NLP_STE_NPR_NODE && 2389 - ndlp->nlp_flag & NLP_DELAY_TMO)) { 2390 - lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, 2399 + test_bit(NLP_DELAY_TMO, &ndlp->nlp_flag))) { 2400 + lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, 2391 2401 "2784 PRLI cmpl: Allow Node recovery " 2392 - "DID x%06x nstate x%x nflag x%x\n", 2402 + "DID x%06x nstate x%x nflag x%lx\n", 2393 2403 ndlp->nlp_DID, ndlp->nlp_state, 2394 2404 ndlp->nlp_flag); 2395 2405 goto out; ··· 2410 2420 spin_lock_irq(&ndlp->lock); 2411 2421 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD)) && 2412 2422 !ndlp->fc4_prli_sent) { 2413 - ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 2414 - if (!(ndlp->nlp_flag & NLP_IN_DEV_LOSS)) 2423 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2424 + if (!test_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag)) 2415 2425 release_node = true; 2416 2426 } 2417 2427 spin_unlock_irq(&ndlp->lock); ··· 2486 2496 ndlp->nlp_type &= ~(NLP_FCP_TARGET | NLP_FCP_INITIATOR); 2487 2497 ndlp->nlp_type &= ~(NLP_NVME_TARGET | NLP_NVME_INITIATOR); 2488 2498 ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; 2489 - ndlp->nlp_flag &= ~(NLP_FIRSTBURST | NLP_NPR_2B_DISC); 2499 + clear_bit(NLP_FIRSTBURST, &ndlp->nlp_flag); 2500 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2490 2501 ndlp->nvme_fb_size = 0; 2491 2502 2492 2503 send_next_prli: ··· 2618 2627 * the ndlp is used to track outstanding PRLIs for different 2619 2628 * FC4 types. 2620 2629 */ 2630 + set_bit(NLP_PRLI_SND, &ndlp->nlp_flag); 2621 2631 spin_lock_irq(&ndlp->lock); 2622 - ndlp->nlp_flag |= NLP_PRLI_SND; 2623 2632 vport->fc_prli_sent++; 2624 2633 ndlp->fc4_prli_sent++; 2625 2634 spin_unlock_irq(&ndlp->lock); ··· 2780 2789 struct lpfc_vport *vport = cmdiocb->vport; 2781 2790 IOCB_t *irsp; 2782 2791 struct lpfc_nodelist *ndlp; 2783 - int disc; 2792 + bool disc; 2784 2793 u32 ulp_status, ulp_word4, tmo, iotag; 2785 2794 bool release_node = false; 2786 2795 ··· 2809 2818 /* Since ndlp can be freed in the disc state machine, note if this node 2810 2819 * is being used during discovery. 2811 2820 */ 2812 - spin_lock_irq(&ndlp->lock); 2813 - disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC); 2814 - ndlp->nlp_flag &= ~(NLP_ADISC_SND | NLP_NPR_2B_DISC); 2815 - spin_unlock_irq(&ndlp->lock); 2821 + disc = test_and_clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2822 + clear_bit(NLP_ADISC_SND, &ndlp->nlp_flag); 2816 2823 /* ADISC completes to NPort <nlp_DID> */ 2817 2824 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 2818 2825 "0104 ADISC completes to NPort x%x " ··· 2821 2832 2822 2833 /* Check to see if link went down during discovery */ 2823 2834 if (lpfc_els_chk_latt(vport)) { 2824 - spin_lock_irq(&ndlp->lock); 2825 - ndlp->nlp_flag |= NLP_NPR_2B_DISC; 2826 - spin_unlock_irq(&ndlp->lock); 2835 + set_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2827 2836 goto out; 2828 2837 } 2829 2838 ··· 2830 2843 if (lpfc_els_retry(phba, cmdiocb, rspiocb)) { 2831 2844 /* ELS command is being retried */ 2832 2845 if (disc) { 2833 - spin_lock_irq(&ndlp->lock); 2834 - ndlp->nlp_flag |= NLP_NPR_2B_DISC; 2835 - spin_unlock_irq(&ndlp->lock); 2846 + set_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2836 2847 lpfc_set_disctmo(vport); 2837 2848 } 2838 2849 goto out; ··· 2849 2864 */ 2850 2865 spin_lock_irq(&ndlp->lock); 2851 2866 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD))) { 2852 - ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 2853 - if (!(ndlp->nlp_flag & NLP_IN_DEV_LOSS)) 2867 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2868 + if (!test_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag)) 2854 2869 release_node = true; 2855 2870 } 2856 2871 spin_unlock_irq(&ndlp->lock); ··· 2923 2938 2924 2939 phba->fc_stat.elsXmitADISC++; 2925 2940 elsiocb->cmd_cmpl = lpfc_cmpl_els_adisc; 2926 - spin_lock_irq(&ndlp->lock); 2927 - ndlp->nlp_flag |= NLP_ADISC_SND; 2928 - spin_unlock_irq(&ndlp->lock); 2941 + set_bit(NLP_ADISC_SND, &ndlp->nlp_flag); 2929 2942 elsiocb->ndlp = lpfc_nlp_get(ndlp); 2930 2943 if (!elsiocb->ndlp) { 2931 2944 lpfc_els_free_iocb(phba, elsiocb); ··· 2944 2961 return 0; 2945 2962 2946 2963 err: 2947 - spin_lock_irq(&ndlp->lock); 2948 - ndlp->nlp_flag &= ~NLP_ADISC_SND; 2949 - spin_unlock_irq(&ndlp->lock); 2964 + clear_bit(NLP_ADISC_SND, &ndlp->nlp_flag); 2950 2965 return 1; 2951 2966 } 2952 2967 ··· 2966 2985 struct lpfc_nodelist *ndlp = cmdiocb->ndlp; 2967 2986 struct lpfc_vport *vport = ndlp->vport; 2968 2987 IOCB_t *irsp; 2969 - unsigned long flags; 2970 2988 uint32_t skip_recovery = 0; 2971 2989 int wake_up_waiter = 0; 2972 2990 u32 ulp_status; ··· 2987 3007 iotag = irsp->ulpIoTag; 2988 3008 } 2989 3009 3010 + clear_bit(NLP_LOGO_SND, &ndlp->nlp_flag); 2990 3011 spin_lock_irq(&ndlp->lock); 2991 - ndlp->nlp_flag &= ~NLP_LOGO_SND; 2992 3012 if (ndlp->save_flags & NLP_WAIT_FOR_LOGO) { 2993 3013 wake_up_waiter = 1; 2994 3014 ndlp->save_flags &= ~NLP_WAIT_FOR_LOGO; ··· 3003 3023 /* LOGO completes to NPort <nlp_DID> */ 3004 3024 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 3005 3025 "0105 LOGO completes to NPort x%x " 3006 - "IoTag x%x refcnt %d nflags x%x xflags x%x " 3026 + "IoTag x%x refcnt %d nflags x%lx xflags x%x " 3007 3027 "Data: x%x x%x x%x x%x\n", 3008 3028 ndlp->nlp_DID, iotag, 3009 3029 kref_read(&ndlp->kref), ndlp->nlp_flag, ··· 3041 3061 /* The driver sets this flag for an NPIV instance that doesn't want to 3042 3062 * log into the remote port. 3043 3063 */ 3044 - if (ndlp->nlp_flag & NLP_TARGET_REMOVE) { 3045 - spin_lock_irq(&ndlp->lock); 3046 - if (phba->sli_rev == LPFC_SLI_REV4) 3047 - ndlp->nlp_flag |= NLP_RELEASE_RPI; 3048 - ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 3049 - spin_unlock_irq(&ndlp->lock); 3064 + if (test_bit(NLP_TARGET_REMOVE, &ndlp->nlp_flag)) { 3065 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 3050 3066 lpfc_disc_state_machine(vport, ndlp, cmdiocb, 3051 3067 NLP_EVT_DEVICE_RM); 3052 3068 goto out_rsrc_free; ··· 3065 3089 if (ndlp->nlp_type & (NLP_FCP_TARGET | NLP_NVME_TARGET) && 3066 3090 skip_recovery == 0) { 3067 3091 lpfc_cancel_retry_delay_tmo(vport, ndlp); 3068 - spin_lock_irqsave(&ndlp->lock, flags); 3069 - ndlp->nlp_flag |= NLP_NPR_2B_DISC; 3070 - spin_unlock_irqrestore(&ndlp->lock, flags); 3092 + set_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 3071 3093 3072 3094 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 3073 3095 "3187 LOGO completes to NPort x%x: Start " ··· 3087 3113 * register with the transport. 3088 3114 */ 3089 3115 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD))) { 3090 - spin_lock_irq(&ndlp->lock); 3091 - ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 3092 - spin_unlock_irq(&ndlp->lock); 3116 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 3093 3117 lpfc_disc_state_machine(vport, ndlp, cmdiocb, 3094 3118 NLP_EVT_DEVICE_RM); 3095 3119 } ··· 3128 3156 uint16_t cmdsize; 3129 3157 int rc; 3130 3158 3131 - spin_lock_irq(&ndlp->lock); 3132 - if (ndlp->nlp_flag & NLP_LOGO_SND) { 3133 - spin_unlock_irq(&ndlp->lock); 3159 + if (test_bit(NLP_LOGO_SND, &ndlp->nlp_flag)) 3134 3160 return 0; 3135 - } 3136 - spin_unlock_irq(&ndlp->lock); 3137 3161 3138 3162 cmdsize = (2 * sizeof(uint32_t)) + sizeof(struct lpfc_name); 3139 3163 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, ··· 3148 3180 3149 3181 phba->fc_stat.elsXmitLOGO++; 3150 3182 elsiocb->cmd_cmpl = lpfc_cmpl_els_logo; 3151 - spin_lock_irq(&ndlp->lock); 3152 - ndlp->nlp_flag |= NLP_LOGO_SND; 3153 - ndlp->nlp_flag &= ~NLP_ISSUE_LOGO; 3154 - spin_unlock_irq(&ndlp->lock); 3183 + set_bit(NLP_LOGO_SND, &ndlp->nlp_flag); 3184 + clear_bit(NLP_ISSUE_LOGO, &ndlp->nlp_flag); 3155 3185 elsiocb->ndlp = lpfc_nlp_get(ndlp); 3156 3186 if (!elsiocb->ndlp) { 3157 3187 lpfc_els_free_iocb(phba, elsiocb); ··· 3174 3208 return 0; 3175 3209 3176 3210 err: 3177 - spin_lock_irq(&ndlp->lock); 3178 - ndlp->nlp_flag &= ~NLP_LOGO_SND; 3179 - spin_unlock_irq(&ndlp->lock); 3211 + clear_bit(NLP_LOGO_SND, &ndlp->nlp_flag); 3180 3212 return 1; 3181 3213 } 3182 3214 ··· 3250 3286 static int 3251 3287 lpfc_reg_fab_ctrl_node(struct lpfc_vport *vport, struct lpfc_nodelist *fc_ndlp) 3252 3288 { 3253 - int rc = 0; 3289 + int rc; 3254 3290 struct lpfc_hba *phba = vport->phba; 3255 3291 struct lpfc_nodelist *ns_ndlp; 3256 3292 LPFC_MBOXQ_t *mbox; 3257 3293 3258 - if (fc_ndlp->nlp_flag & NLP_RPI_REGISTERED) 3259 - return rc; 3294 + if (test_bit(NLP_RPI_REGISTERED, &fc_ndlp->nlp_flag)) 3295 + return 0; 3260 3296 3261 3297 ns_ndlp = lpfc_findnode_did(vport, NameServer_DID); 3262 3298 if (!ns_ndlp) ··· 3273 3309 if (!mbox) { 3274 3310 lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, 3275 3311 "0936 %s: no memory for reg_login " 3276 - "Data: x%x x%x x%x x%x\n", __func__, 3312 + "Data: x%x x%x x%lx x%x\n", __func__, 3277 3313 fc_ndlp->nlp_DID, fc_ndlp->nlp_state, 3278 3314 fc_ndlp->nlp_flag, fc_ndlp->nlp_rpi); 3279 3315 return -ENOMEM; ··· 3285 3321 goto out; 3286 3322 } 3287 3323 3288 - fc_ndlp->nlp_flag |= NLP_REG_LOGIN_SEND; 3324 + set_bit(NLP_REG_LOGIN_SEND, &fc_ndlp->nlp_flag); 3289 3325 mbox->mbox_cmpl = lpfc_mbx_cmpl_fc_reg_login; 3290 3326 mbox->ctx_ndlp = lpfc_nlp_get(fc_ndlp); 3291 3327 if (!mbox->ctx_ndlp) { ··· 3309 3345 lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED); 3310 3346 lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, 3311 3347 "0938 %s: failed to format reg_login " 3312 - "Data: x%x x%x x%x x%x\n", __func__, 3348 + "Data: x%x x%x x%lx x%x\n", __func__, 3313 3349 fc_ndlp->nlp_DID, fc_ndlp->nlp_state, 3314 3350 fc_ndlp->nlp_flag, fc_ndlp->nlp_rpi); 3315 3351 return rc; ··· 4348 4384 { 4349 4385 struct lpfc_work_evt *evtp; 4350 4386 4351 - if (!(nlp->nlp_flag & NLP_DELAY_TMO)) 4387 + if (!test_and_clear_bit(NLP_DELAY_TMO, &nlp->nlp_flag)) 4352 4388 return; 4353 - spin_lock_irq(&nlp->lock); 4354 - nlp->nlp_flag &= ~NLP_DELAY_TMO; 4355 - spin_unlock_irq(&nlp->lock); 4356 4389 del_timer_sync(&nlp->nlp_delayfunc); 4357 4390 nlp->nlp_last_elscmd = 0; 4358 4391 if (!list_empty(&nlp->els_retry_evt.evt_listp)) { ··· 4358 4397 evtp = &nlp->els_retry_evt; 4359 4398 lpfc_nlp_put((struct lpfc_nodelist *)evtp->evt_arg1); 4360 4399 } 4361 - if (nlp->nlp_flag & NLP_NPR_2B_DISC) { 4362 - spin_lock_irq(&nlp->lock); 4363 - nlp->nlp_flag &= ~NLP_NPR_2B_DISC; 4364 - spin_unlock_irq(&nlp->lock); 4400 + if (test_and_clear_bit(NLP_NPR_2B_DISC, &nlp->nlp_flag)) { 4365 4401 if (vport->num_disc_nodes) { 4366 4402 if (vport->port_state < LPFC_VPORT_READY) { 4367 4403 /* Check if there are more ADISCs to be sent */ ··· 4438 4480 spin_lock_irq(&ndlp->lock); 4439 4481 cmd = ndlp->nlp_last_elscmd; 4440 4482 ndlp->nlp_last_elscmd = 0; 4441 - 4442 - if (!(ndlp->nlp_flag & NLP_DELAY_TMO)) { 4443 - spin_unlock_irq(&ndlp->lock); 4444 - return; 4445 - } 4446 - 4447 - ndlp->nlp_flag &= ~NLP_DELAY_TMO; 4448 4483 spin_unlock_irq(&ndlp->lock); 4484 + 4485 + if (!test_and_clear_bit(NLP_DELAY_TMO, &ndlp->nlp_flag)) 4486 + return; 4487 + 4449 4488 /* 4450 4489 * If a discovery event readded nlp_delayfunc after timer 4451 4490 * firing and before processing the timer, cancel the ··· 4965 5010 /* delay is specified in milliseconds */ 4966 5011 mod_timer(&ndlp->nlp_delayfunc, 4967 5012 jiffies + msecs_to_jiffies(delay)); 4968 - spin_lock_irq(&ndlp->lock); 4969 - ndlp->nlp_flag |= NLP_DELAY_TMO; 4970 - spin_unlock_irq(&ndlp->lock); 5013 + set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag); 4971 5014 4972 5015 ndlp->nlp_prev_state = ndlp->nlp_state; 4973 5016 if ((cmd == ELS_CMD_PRLI) || ··· 5025 5072 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 5026 5073 "0108 No retry ELS command x%x to remote " 5027 5074 "NPORT x%x Retried:%d Error:x%x/%x " 5028 - "IoTag x%x nflags x%x\n", 5075 + "IoTag x%x nflags x%lx\n", 5029 5076 cmd, did, cmdiocb->retry, ulp_status, 5030 5077 ulp_word4, cmdiocb->iotag, 5031 5078 (ndlp ? ndlp->nlp_flag : 0)); ··· 5192 5239 /* ACC to LOGO completes to NPort <nlp_DID> */ 5193 5240 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 5194 5241 "0109 ACC to LOGO completes to NPort x%x refcnt %d " 5195 - "last els x%x Data: x%x x%x x%x\n", 5242 + "last els x%x Data: x%lx x%x x%x\n", 5196 5243 ndlp->nlp_DID, kref_read(&ndlp->kref), 5197 5244 ndlp->nlp_last_elscmd, ndlp->nlp_flag, ndlp->nlp_state, 5198 5245 ndlp->nlp_rpi); ··· 5207 5254 goto out; 5208 5255 5209 5256 if (ndlp->nlp_state == NLP_STE_NPR_NODE) { 5210 - if (ndlp->nlp_flag & NLP_RPI_REGISTERED) 5257 + if (test_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag)) 5211 5258 lpfc_unreg_rpi(vport, ndlp); 5212 5259 5213 5260 /* If came from PRLO, then PRLO_ACC is done. 5214 5261 * Start rediscovery now. 5215 5262 */ 5216 5263 if (ndlp->nlp_last_elscmd == ELS_CMD_PRLO) { 5217 - spin_lock_irq(&ndlp->lock); 5218 - ndlp->nlp_flag |= NLP_NPR_2B_DISC; 5219 - spin_unlock_irq(&ndlp->lock); 5264 + set_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 5220 5265 ndlp->nlp_prev_state = ndlp->nlp_state; 5221 5266 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); 5222 5267 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); ··· 5251 5300 5252 5301 if (ndlp) { 5253 5302 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, 5254 - "0006 rpi x%x DID:%x flg:%x %d x%px " 5303 + "0006 rpi x%x DID:%x flg:%lx %d x%px " 5255 5304 "mbx_cmd x%x mbx_flag x%x x%px\n", 5256 5305 ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag, 5257 5306 kref_read(&ndlp->kref), ndlp, mbx_cmd, ··· 5262 5311 * first on an UNREG_LOGIN and then release the final 5263 5312 * references. 5264 5313 */ 5265 - spin_lock_irq(&ndlp->lock); 5266 - ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; 5314 + clear_bit(NLP_REG_LOGIN_SEND, &ndlp->nlp_flag); 5267 5315 if (mbx_cmd == MBX_UNREG_LOGIN) 5268 - ndlp->nlp_flag &= ~NLP_UNREG_INP; 5269 - spin_unlock_irq(&ndlp->lock); 5316 + clear_bit(NLP_UNREG_INP, &ndlp->nlp_flag); 5270 5317 lpfc_nlp_put(ndlp); 5271 5318 lpfc_drop_node(ndlp->vport, ndlp); 5272 5319 } ··· 5330 5381 /* ELS response tag <ulpIoTag> completes */ 5331 5382 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 5332 5383 "0110 ELS response tag x%x completes " 5333 - "Data: x%x x%x x%x x%x x%x x%x x%x x%x %p %p\n", 5384 + "Data: x%x x%x x%x x%x x%lx x%x x%x x%x %p %p\n", 5334 5385 iotag, ulp_status, ulp_word4, tmo, 5335 5386 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, 5336 5387 ndlp->nlp_rpi, kref_read(&ndlp->kref), mbox, ndlp); 5337 5388 if (mbox) { 5338 - if (ulp_status == 0 5339 - && (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) { 5389 + if (ulp_status == 0 && 5390 + test_bit(NLP_ACC_REGLOGIN, &ndlp->nlp_flag)) { 5340 5391 if (!lpfc_unreg_rpi(vport, ndlp) && 5341 5392 !test_bit(FC_PT2PT, &vport->fc_flag)) { 5342 - if (ndlp->nlp_state == NLP_STE_PLOGI_ISSUE || 5393 + if (ndlp->nlp_state == NLP_STE_PLOGI_ISSUE || 5343 5394 ndlp->nlp_state == 5344 5395 NLP_STE_REG_LOGIN_ISSUE) { 5345 5396 lpfc_printf_vlog(vport, KERN_INFO, 5346 5397 LOG_DISCOVERY, 5347 5398 "0314 PLOGI recov " 5348 5399 "DID x%x " 5349 - "Data: x%x x%x x%x\n", 5400 + "Data: x%x x%x x%lx\n", 5350 5401 ndlp->nlp_DID, 5351 5402 ndlp->nlp_state, 5352 5403 ndlp->nlp_rpi, ··· 5363 5414 goto out_free_mbox; 5364 5415 5365 5416 mbox->vport = vport; 5366 - if (ndlp->nlp_flag & NLP_RM_DFLT_RPI) { 5417 + if (test_bit(NLP_RM_DFLT_RPI, &ndlp->nlp_flag)) { 5367 5418 mbox->mbox_flag |= LPFC_MBX_IMED_UNREG; 5368 5419 mbox->mbox_cmpl = lpfc_mbx_cmpl_dflt_rpi; 5369 - } 5370 - else { 5420 + } else { 5371 5421 mbox->mbox_cmpl = lpfc_mbx_cmpl_reg_login; 5372 5422 ndlp->nlp_prev_state = ndlp->nlp_state; 5373 5423 lpfc_nlp_set_state(vport, ndlp, 5374 5424 NLP_STE_REG_LOGIN_ISSUE); 5375 5425 } 5376 5426 5377 - ndlp->nlp_flag |= NLP_REG_LOGIN_SEND; 5427 + set_bit(NLP_REG_LOGIN_SEND, &ndlp->nlp_flag); 5378 5428 if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) 5379 5429 != MBX_NOT_FINISHED) 5380 5430 goto out; ··· 5382 5434 * set for this failed mailbox command. 5383 5435 */ 5384 5436 lpfc_nlp_put(ndlp); 5385 - ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; 5437 + clear_bit(NLP_REG_LOGIN_SEND, &ndlp->nlp_flag); 5386 5438 5387 5439 /* ELS rsp: Cannot issue reg_login for <NPortid> */ 5388 5440 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 5389 5441 "0138 ELS rsp: Cannot issue reg_login for x%x " 5390 - "Data: x%x x%x x%x\n", 5442 + "Data: x%lx x%x x%x\n", 5391 5443 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, 5392 5444 ndlp->nlp_rpi); 5393 5445 } ··· 5396 5448 } 5397 5449 out: 5398 5450 if (ndlp && shost) { 5399 - spin_lock_irq(&ndlp->lock); 5400 5451 if (mbox) 5401 - ndlp->nlp_flag &= ~NLP_ACC_REGLOGIN; 5402 - ndlp->nlp_flag &= ~NLP_RM_DFLT_RPI; 5403 - spin_unlock_irq(&ndlp->lock); 5452 + clear_bit(NLP_ACC_REGLOGIN, &ndlp->nlp_flag); 5453 + clear_bit(NLP_RM_DFLT_RPI, &ndlp->nlp_flag); 5404 5454 } 5405 5455 5406 5456 /* An SLI4 NPIV instance wants to drop the node at this point under 5407 - * these conditions and release the RPI. 5457 + * these conditions because it doesn't need the login. 5408 5458 */ 5409 5459 if (phba->sli_rev == LPFC_SLI_REV4 && 5410 5460 vport && vport->port_type == LPFC_NPIV_PORT && 5411 5461 !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) { 5412 - if (ndlp->nlp_flag & NLP_RELEASE_RPI) { 5413 - if (ndlp->nlp_state != NLP_STE_PLOGI_ISSUE && 5414 - ndlp->nlp_state != NLP_STE_REG_LOGIN_ISSUE) { 5415 - lpfc_sli4_free_rpi(phba, ndlp->nlp_rpi); 5416 - spin_lock_irq(&ndlp->lock); 5417 - ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR; 5418 - ndlp->nlp_flag &= ~NLP_RELEASE_RPI; 5419 - spin_unlock_irq(&ndlp->lock); 5420 - } 5421 - lpfc_drop_node(vport, ndlp); 5422 - } else if (ndlp->nlp_state != NLP_STE_PLOGI_ISSUE && 5423 - ndlp->nlp_state != NLP_STE_REG_LOGIN_ISSUE && 5424 - ndlp->nlp_state != NLP_STE_PRLI_ISSUE) { 5462 + if (ndlp->nlp_state != NLP_STE_PLOGI_ISSUE && 5463 + ndlp->nlp_state != NLP_STE_REG_LOGIN_ISSUE && 5464 + ndlp->nlp_state != NLP_STE_PRLI_ISSUE) { 5425 5465 /* Drop ndlp if there is no planned or outstanding 5426 5466 * issued PRLI. 5427 5467 * ··· 5476 5540 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, 5477 5541 ndlp, ndlp->nlp_DID, ELS_CMD_ACC); 5478 5542 if (!elsiocb) { 5479 - spin_lock_irq(&ndlp->lock); 5480 - ndlp->nlp_flag &= ~NLP_LOGO_ACC; 5481 - spin_unlock_irq(&ndlp->lock); 5543 + clear_bit(NLP_LOGO_ACC, &ndlp->nlp_flag); 5482 5544 return 1; 5483 5545 } 5484 5546 ··· 5504 5570 pcmd += sizeof(uint32_t); 5505 5571 5506 5572 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, 5507 - "Issue ACC: did:x%x flg:x%x", 5573 + "Issue ACC: did:x%x flg:x%lx", 5508 5574 ndlp->nlp_DID, ndlp->nlp_flag, 0); 5509 5575 break; 5510 5576 case ELS_CMD_FLOGI: ··· 5583 5649 } 5584 5650 5585 5651 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, 5586 - "Issue ACC FLOGI/PLOGI: did:x%x flg:x%x", 5652 + "Issue ACC FLOGI/PLOGI: did:x%x flg:x%lx", 5587 5653 ndlp->nlp_DID, ndlp->nlp_flag, 0); 5588 5654 break; 5589 5655 case ELS_CMD_PRLO: ··· 5621 5687 els_pkt_ptr->un.prlo.acceptRspCode = PRLO_REQ_EXECUTED; 5622 5688 5623 5689 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, 5624 - "Issue ACC PRLO: did:x%x flg:x%x", 5690 + "Issue ACC PRLO: did:x%x flg:x%lx", 5625 5691 ndlp->nlp_DID, ndlp->nlp_flag, 0); 5626 5692 break; 5627 5693 case ELS_CMD_RDF: ··· 5666 5732 default: 5667 5733 return 1; 5668 5734 } 5669 - if (ndlp->nlp_flag & NLP_LOGO_ACC) { 5670 - spin_lock_irq(&ndlp->lock); 5671 - if (!(ndlp->nlp_flag & NLP_RPI_REGISTERED || 5672 - ndlp->nlp_flag & NLP_REG_LOGIN_SEND)) 5673 - ndlp->nlp_flag &= ~NLP_LOGO_ACC; 5674 - spin_unlock_irq(&ndlp->lock); 5735 + if (test_bit(NLP_LOGO_ACC, &ndlp->nlp_flag)) { 5736 + if (!test_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag) && 5737 + !test_bit(NLP_REG_LOGIN_SEND, &ndlp->nlp_flag)) 5738 + clear_bit(NLP_LOGO_ACC, &ndlp->nlp_flag); 5675 5739 elsiocb->cmd_cmpl = lpfc_cmpl_els_logo_acc; 5676 5740 } else { 5677 5741 elsiocb->cmd_cmpl = lpfc_cmpl_els_rsp; ··· 5692 5760 /* Xmit ELS ACC response tag <ulpIoTag> */ 5693 5761 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 5694 5762 "0128 Xmit ELS ACC response Status: x%x, IoTag: x%x, " 5695 - "XRI: x%x, DID: x%x, nlp_flag: x%x nlp_state: x%x " 5763 + "XRI: x%x, DID: x%x, nlp_flag: x%lx nlp_state: x%x " 5696 5764 "RPI: x%x, fc_flag x%lx refcnt %d\n", 5697 5765 rc, elsiocb->iotag, elsiocb->sli4_xritag, 5698 5766 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, ··· 5767 5835 /* Xmit ELS RJT <err> response tag <ulpIoTag> */ 5768 5836 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 5769 5837 "0129 Xmit ELS RJT x%x response tag x%x " 5770 - "xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, " 5838 + "xri x%x, did x%x, nlp_flag x%lx, nlp_state x%x, " 5771 5839 "rpi x%x\n", 5772 5840 rejectError, elsiocb->iotag, 5773 5841 get_job_ulpcontext(phba, elsiocb), ndlp->nlp_DID, 5774 5842 ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); 5775 5843 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, 5776 - "Issue LS_RJT: did:x%x flg:x%x err:x%x", 5844 + "Issue LS_RJT: did:x%x flg:x%lx err:x%x", 5777 5845 ndlp->nlp_DID, ndlp->nlp_flag, rejectError); 5778 5846 5779 5847 phba->fc_stat.elsXmitLSRJT++; ··· 5782 5850 if (!elsiocb->ndlp) { 5783 5851 lpfc_els_free_iocb(phba, elsiocb); 5784 5852 return 1; 5785 - } 5786 - 5787 - /* The NPIV instance is rejecting this unsolicited ELS. Make sure the 5788 - * node's assigned RPI gets released provided this node is not already 5789 - * registered with the transport. 5790 - */ 5791 - if (phba->sli_rev == LPFC_SLI_REV4 && 5792 - vport->port_type == LPFC_NPIV_PORT && 5793 - !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) { 5794 - spin_lock_irq(&ndlp->lock); 5795 - ndlp->nlp_flag |= NLP_RELEASE_RPI; 5796 - spin_unlock_irq(&ndlp->lock); 5797 5853 } 5798 5854 5799 5855 rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0); ··· 5864 5944 lpfc_format_edc_lft_desc(phba, tlv); 5865 5945 5866 5946 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, 5867 - "Issue EDC ACC: did:x%x flg:x%x refcnt %d", 5947 + "Issue EDC ACC: did:x%x flg:x%lx refcnt %d", 5868 5948 ndlp->nlp_DID, ndlp->nlp_flag, 5869 5949 kref_read(&ndlp->kref)); 5870 5950 elsiocb->cmd_cmpl = lpfc_cmpl_els_rsp; ··· 5886 5966 /* Xmit ELS ACC response tag <ulpIoTag> */ 5887 5967 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 5888 5968 "0152 Xmit EDC ACC response Status: x%x, IoTag: x%x, " 5889 - "XRI: x%x, DID: x%x, nlp_flag: x%x nlp_state: x%x " 5969 + "XRI: x%x, DID: x%x, nlp_flag: x%lx nlp_state: x%x " 5890 5970 "RPI: x%x, fc_flag x%lx\n", 5891 5971 rc, elsiocb->iotag, elsiocb->sli4_xritag, 5892 5972 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, ··· 5955 6035 /* Xmit ADISC ACC response tag <ulpIoTag> */ 5956 6036 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 5957 6037 "0130 Xmit ADISC ACC response iotag x%x xri: " 5958 - "x%x, did x%x, nlp_flag x%x, nlp_state x%x rpi x%x\n", 6038 + "x%x, did x%x, nlp_flag x%lx, nlp_state x%x rpi x%x\n", 5959 6039 elsiocb->iotag, ulp_context, 5960 6040 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, 5961 6041 ndlp->nlp_rpi); ··· 5971 6051 ap->DID = be32_to_cpu(vport->fc_myDID); 5972 6052 5973 6053 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, 5974 - "Issue ACC ADISC: did:x%x flg:x%x refcnt %d", 6054 + "Issue ACC ADISC: did:x%x flg:x%lx refcnt %d", 5975 6055 ndlp->nlp_DID, ndlp->nlp_flag, kref_read(&ndlp->kref)); 5976 6056 5977 6057 phba->fc_stat.elsXmitACC++; ··· 6077 6157 /* Xmit PRLI ACC response tag <ulpIoTag> */ 6078 6158 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 6079 6159 "0131 Xmit PRLI ACC response tag x%x xri x%x, " 6080 - "did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n", 6160 + "did x%x, nlp_flag x%lx, nlp_state x%x, rpi x%x\n", 6081 6161 elsiocb->iotag, ulp_context, 6082 6162 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, 6083 6163 ndlp->nlp_rpi); ··· 6148 6228 6149 6229 lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_DISC, 6150 6230 "6015 NVME issue PRLI ACC word1 x%08x " 6151 - "word4 x%08x word5 x%08x flag x%x, " 6231 + "word4 x%08x word5 x%08x flag x%lx, " 6152 6232 "fcp_info x%x nlp_type x%x\n", 6153 6233 npr_nvme->word1, npr_nvme->word4, 6154 6234 npr_nvme->word5, ndlp->nlp_flag, ··· 6163 6243 ndlp->nlp_DID); 6164 6244 6165 6245 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, 6166 - "Issue ACC PRLI: did:x%x flg:x%x", 6246 + "Issue ACC PRLI: did:x%x flg:x%lx", 6167 6247 ndlp->nlp_DID, ndlp->nlp_flag, kref_read(&ndlp->kref)); 6168 6248 6169 6249 phba->fc_stat.elsXmitACC++; ··· 6277 6357 } 6278 6358 6279 6359 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, 6280 - "Issue ACC RNID: did:x%x flg:x%x refcnt %d", 6360 + "Issue ACC RNID: did:x%x flg:x%lx refcnt %d", 6281 6361 ndlp->nlp_DID, ndlp->nlp_flag, kref_read(&ndlp->kref)); 6282 6362 6283 6363 phba->fc_stat.elsXmitACC++; ··· 6334 6414 get_job_ulpcontext(phba, iocb)); 6335 6415 6336 6416 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, 6337 - "Clear RRQ: did:x%x flg:x%x exchg:x%.08x", 6417 + "Clear RRQ: did:x%x flg:x%lx exchg:x%.08x", 6338 6418 ndlp->nlp_DID, ndlp->nlp_flag, rrq->rrq_exchg); 6339 6419 if (vport->fc_myDID == be32_to_cpu(bf_get(rrq_did, rrq))) 6340 6420 xri = bf_get(rrq_oxid, rrq); ··· 6411 6491 memcpy(pcmd, data, cmdsize - sizeof(uint32_t)); 6412 6492 6413 6493 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, 6414 - "Issue ACC ECHO: did:x%x flg:x%x refcnt %d", 6494 + "Issue ACC ECHO: did:x%x flg:x%lx refcnt %d", 6415 6495 ndlp->nlp_DID, ndlp->nlp_flag, kref_read(&ndlp->kref)); 6416 6496 6417 6497 phba->fc_stat.elsXmitACC++; ··· 6461 6541 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { 6462 6542 6463 6543 if (ndlp->nlp_state != NLP_STE_NPR_NODE || 6464 - !(ndlp->nlp_flag & NLP_NPR_ADISC)) 6544 + !test_bit(NLP_NPR_ADISC, &ndlp->nlp_flag)) 6465 6545 continue; 6466 6546 6467 - spin_lock_irq(&ndlp->lock); 6468 - ndlp->nlp_flag &= ~NLP_NPR_ADISC; 6469 - spin_unlock_irq(&ndlp->lock); 6547 + clear_bit(NLP_NPR_ADISC, &ndlp->nlp_flag); 6470 6548 6471 - if (!(ndlp->nlp_flag & NLP_NPR_2B_DISC)) { 6549 + if (!test_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag)) { 6472 6550 /* This node was marked for ADISC but was not picked 6473 6551 * for discovery. This is possible if the node was 6474 6552 * missing in gidft response. ··· 6524 6606 /* go thru NPR nodes and issue any remaining ELS PLOGIs */ 6525 6607 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { 6526 6608 if (ndlp->nlp_state == NLP_STE_NPR_NODE && 6527 - (ndlp->nlp_flag & NLP_NPR_2B_DISC) != 0 && 6528 - (ndlp->nlp_flag & NLP_DELAY_TMO) == 0 && 6529 - (ndlp->nlp_flag & NLP_NPR_ADISC) == 0) { 6609 + test_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag) && 6610 + !test_bit(NLP_DELAY_TMO, &ndlp->nlp_flag) && 6611 + !test_bit(NLP_NPR_ADISC, &ndlp->nlp_flag)) { 6530 6612 ndlp->nlp_prev_state = ndlp->nlp_state; 6531 6613 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); 6532 6614 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); ··· 7022 7104 7023 7105 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 7024 7106 "2171 Xmit RDP response tag x%x xri x%x, " 7025 - "did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x", 7107 + "did x%x, nlp_flag x%lx, nlp_state x%x, rpi x%x", 7026 7108 elsiocb->iotag, ulp_context, 7027 7109 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, 7028 7110 ndlp->nlp_rpi); ··· 7996 8078 */ 7997 8079 if (vport->port_state <= LPFC_NS_QRY) { 7998 8080 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 7999 - "RCV RSCN ignore: did:x%x/ste:x%x flg:x%x", 8081 + "RCV RSCN ignore: did:x%x/ste:x%x flg:x%lx", 8000 8082 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag); 8001 8083 8002 8084 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); ··· 8026 8108 vport->fc_flag, payload_len, 8027 8109 *lp, vport->fc_rscn_id_cnt); 8028 8110 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 8029 - "RCV RSCN vport: did:x%x/ste:x%x flg:x%x", 8111 + "RCV RSCN vport: did:x%x/ste:x%x flg:x%lx", 8030 8112 ndlp->nlp_DID, vport->port_state, 8031 8113 ndlp->nlp_flag); 8032 8114 ··· 8063 8145 if (test_bit(FC_RSCN_MODE, &vport->fc_flag) || 8064 8146 test_bit(FC_NDISC_ACTIVE, &vport->fc_flag)) { 8065 8147 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 8066 - "RCV RSCN defer: did:x%x/ste:x%x flg:x%x", 8148 + "RCV RSCN defer: did:x%x/ste:x%x flg:x%lx", 8067 8149 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag); 8068 8150 8069 8151 set_bit(FC_RSCN_DEFERRED, &vport->fc_flag); ··· 8119 8201 return 0; 8120 8202 } 8121 8203 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 8122 - "RCV RSCN: did:x%x/ste:x%x flg:x%x", 8204 + "RCV RSCN: did:x%x/ste:x%x flg:x%lx", 8123 8205 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag); 8124 8206 8125 8207 set_bit(FC_RSCN_MODE, &vport->fc_flag); ··· 8625 8707 /* Xmit ELS RLS ACC response tag <ulpIoTag> */ 8626 8708 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_ELS, 8627 8709 "2874 Xmit ELS RLS ACC response tag x%x xri x%x, " 8628 - "did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n", 8710 + "did x%x, nlp_flag x%lx, nlp_state x%x, rpi x%x\n", 8629 8711 elsiocb->iotag, ulp_context, 8630 8712 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, 8631 8713 ndlp->nlp_rpi); ··· 8787 8869 /* Xmit ELS RLS ACC response tag <ulpIoTag> */ 8788 8870 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_ELS, 8789 8871 "2875 Xmit ELS RTV ACC response tag x%x xri x%x, " 8790 - "did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x, " 8872 + "did x%x, nlp_flag x%lx, nlp_state x%x, rpi x%x, " 8791 8873 "Data: x%x x%x x%x\n", 8792 8874 elsiocb->iotag, ulp_context, 8793 8875 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, ··· 8984 9066 /* Xmit ELS RPL ACC response tag <ulpIoTag> */ 8985 9067 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 8986 9068 "0120 Xmit ELS RPL ACC response tag x%x " 8987 - "xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, " 9069 + "xri x%x, did x%x, nlp_flag x%lx, nlp_state x%x, " 8988 9070 "rpi x%x\n", 8989 9071 elsiocb->iotag, ulp_context, 8990 9072 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, ··· 9560 9642 mbx_tmo_err = test_bit(MBX_TMO_ERR, &phba->bit_flags); 9561 9643 /* First we need to issue aborts to outstanding cmds on txcmpl */ 9562 9644 list_for_each_entry_safe(piocb, tmp_iocb, &pring->txcmplq, list) { 9563 - if (piocb->cmd_flag & LPFC_IO_LIBDFC && !mbx_tmo_err) 9564 - continue; 9645 + lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 9646 + "2243 iotag = 0x%x cmd_flag = 0x%x " 9647 + "ulp_command = 0x%x this_vport %x " 9648 + "sli_flag = 0x%x\n", 9649 + piocb->iotag, piocb->cmd_flag, 9650 + get_job_cmnd(phba, piocb), 9651 + (piocb->vport == vport), 9652 + phba->sli.sli_flag); 9565 9653 9566 9654 if (piocb->vport != vport) 9567 9655 continue; 9568 9656 9569 - if (piocb->cmd_flag & LPFC_DRIVER_ABORTED && !mbx_tmo_err) 9570 - continue; 9657 + if ((phba->sli.sli_flag & LPFC_SLI_ACTIVE) && !mbx_tmo_err) { 9658 + if (piocb->cmd_flag & LPFC_IO_LIBDFC) 9659 + continue; 9660 + if (piocb->cmd_flag & LPFC_DRIVER_ABORTED) 9661 + continue; 9662 + } 9571 9663 9572 9664 /* On the ELS ring we can have ELS_REQUESTs, ELS_RSPs, 9573 9665 * or GEN_REQUESTs waiting for a CQE response. ··· 10339 10411 * Do not process any unsolicited ELS commands 10340 10412 * if the ndlp is in DEV_LOSS 10341 10413 */ 10342 - spin_lock_irq(&ndlp->lock); 10343 - if (ndlp->nlp_flag & NLP_IN_DEV_LOSS) { 10344 - spin_unlock_irq(&ndlp->lock); 10414 + if (test_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag)) { 10345 10415 if (newnode) 10346 10416 lpfc_nlp_put(ndlp); 10347 10417 goto dropit; 10348 10418 } 10349 - spin_unlock_irq(&ndlp->lock); 10350 10419 10351 10420 elsiocb->ndlp = lpfc_nlp_get(ndlp); 10352 10421 if (!elsiocb->ndlp) ··· 10372 10447 switch (cmd) { 10373 10448 case ELS_CMD_PLOGI: 10374 10449 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10375 - "RCV PLOGI: did:x%x/ste:x%x flg:x%x", 10450 + "RCV PLOGI: did:x%x/ste:x%x flg:x%lx", 10376 10451 did, vport->port_state, ndlp->nlp_flag); 10377 10452 10378 10453 phba->fc_stat.elsRcvPLOGI++; ··· 10411 10486 } 10412 10487 } 10413 10488 10414 - spin_lock_irq(&ndlp->lock); 10415 - ndlp->nlp_flag &= ~NLP_TARGET_REMOVE; 10416 - spin_unlock_irq(&ndlp->lock); 10489 + clear_bit(NLP_TARGET_REMOVE, &ndlp->nlp_flag); 10417 10490 10418 10491 lpfc_disc_state_machine(vport, ndlp, elsiocb, 10419 10492 NLP_EVT_RCV_PLOGI); ··· 10419 10496 break; 10420 10497 case ELS_CMD_FLOGI: 10421 10498 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10422 - "RCV FLOGI: did:x%x/ste:x%x flg:x%x", 10499 + "RCV FLOGI: did:x%x/ste:x%x flg:x%lx", 10423 10500 did, vport->port_state, ndlp->nlp_flag); 10424 10501 10425 10502 phba->fc_stat.elsRcvFLOGI++; ··· 10446 10523 break; 10447 10524 case ELS_CMD_LOGO: 10448 10525 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10449 - "RCV LOGO: did:x%x/ste:x%x flg:x%x", 10526 + "RCV LOGO: did:x%x/ste:x%x flg:x%lx", 10450 10527 did, vport->port_state, ndlp->nlp_flag); 10451 10528 10452 10529 phba->fc_stat.elsRcvLOGO++; ··· 10463 10540 break; 10464 10541 case ELS_CMD_PRLO: 10465 10542 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10466 - "RCV PRLO: did:x%x/ste:x%x flg:x%x", 10543 + "RCV PRLO: did:x%x/ste:x%x flg:x%lx", 10467 10544 did, vport->port_state, ndlp->nlp_flag); 10468 10545 10469 10546 phba->fc_stat.elsRcvPRLO++; ··· 10492 10569 break; 10493 10570 case ELS_CMD_ADISC: 10494 10571 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10495 - "RCV ADISC: did:x%x/ste:x%x flg:x%x", 10572 + "RCV ADISC: did:x%x/ste:x%x flg:x%lx", 10496 10573 did, vport->port_state, ndlp->nlp_flag); 10497 10574 10498 10575 lpfc_send_els_event(vport, ndlp, payload); ··· 10507 10584 break; 10508 10585 case ELS_CMD_PDISC: 10509 10586 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10510 - "RCV PDISC: did:x%x/ste:x%x flg:x%x", 10587 + "RCV PDISC: did:x%x/ste:x%x flg:x%lx", 10511 10588 did, vport->port_state, ndlp->nlp_flag); 10512 10589 10513 10590 phba->fc_stat.elsRcvPDISC++; ··· 10521 10598 break; 10522 10599 case ELS_CMD_FARPR: 10523 10600 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10524 - "RCV FARPR: did:x%x/ste:x%x flg:x%x", 10601 + "RCV FARPR: did:x%x/ste:x%x flg:x%lx", 10525 10602 did, vport->port_state, ndlp->nlp_flag); 10526 10603 10527 10604 phba->fc_stat.elsRcvFARPR++; ··· 10529 10606 break; 10530 10607 case ELS_CMD_FARP: 10531 10608 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10532 - "RCV FARP: did:x%x/ste:x%x flg:x%x", 10609 + "RCV FARP: did:x%x/ste:x%x flg:x%lx", 10533 10610 did, vport->port_state, ndlp->nlp_flag); 10534 10611 10535 10612 phba->fc_stat.elsRcvFARP++; ··· 10537 10614 break; 10538 10615 case ELS_CMD_FAN: 10539 10616 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10540 - "RCV FAN: did:x%x/ste:x%x flg:x%x", 10617 + "RCV FAN: did:x%x/ste:x%x flg:x%lx", 10541 10618 did, vport->port_state, ndlp->nlp_flag); 10542 10619 10543 10620 phba->fc_stat.elsRcvFAN++; ··· 10546 10623 case ELS_CMD_PRLI: 10547 10624 case ELS_CMD_NVMEPRLI: 10548 10625 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10549 - "RCV PRLI: did:x%x/ste:x%x flg:x%x", 10626 + "RCV PRLI: did:x%x/ste:x%x flg:x%lx", 10550 10627 did, vport->port_state, ndlp->nlp_flag); 10551 10628 10552 10629 phba->fc_stat.elsRcvPRLI++; ··· 10560 10637 break; 10561 10638 case ELS_CMD_LIRR: 10562 10639 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10563 - "RCV LIRR: did:x%x/ste:x%x flg:x%x", 10640 + "RCV LIRR: did:x%x/ste:x%x flg:x%lx", 10564 10641 did, vport->port_state, ndlp->nlp_flag); 10565 10642 10566 10643 phba->fc_stat.elsRcvLIRR++; ··· 10571 10648 break; 10572 10649 case ELS_CMD_RLS: 10573 10650 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10574 - "RCV RLS: did:x%x/ste:x%x flg:x%x", 10651 + "RCV RLS: did:x%x/ste:x%x flg:x%lx", 10575 10652 did, vport->port_state, ndlp->nlp_flag); 10576 10653 10577 10654 phba->fc_stat.elsRcvRLS++; ··· 10582 10659 break; 10583 10660 case ELS_CMD_RPL: 10584 10661 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10585 - "RCV RPL: did:x%x/ste:x%x flg:x%x", 10662 + "RCV RPL: did:x%x/ste:x%x flg:x%lx", 10586 10663 did, vport->port_state, ndlp->nlp_flag); 10587 10664 10588 10665 phba->fc_stat.elsRcvRPL++; ··· 10593 10670 break; 10594 10671 case ELS_CMD_RNID: 10595 10672 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10596 - "RCV RNID: did:x%x/ste:x%x flg:x%x", 10673 + "RCV RNID: did:x%x/ste:x%x flg:x%lx", 10597 10674 did, vport->port_state, ndlp->nlp_flag); 10598 10675 10599 10676 phba->fc_stat.elsRcvRNID++; ··· 10604 10681 break; 10605 10682 case ELS_CMD_RTV: 10606 10683 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10607 - "RCV RTV: did:x%x/ste:x%x flg:x%x", 10684 + "RCV RTV: did:x%x/ste:x%x flg:x%lx", 10608 10685 did, vport->port_state, ndlp->nlp_flag); 10609 10686 phba->fc_stat.elsRcvRTV++; 10610 10687 lpfc_els_rcv_rtv(vport, elsiocb, ndlp); ··· 10614 10691 break; 10615 10692 case ELS_CMD_RRQ: 10616 10693 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10617 - "RCV RRQ: did:x%x/ste:x%x flg:x%x", 10694 + "RCV RRQ: did:x%x/ste:x%x flg:x%lx", 10618 10695 did, vport->port_state, ndlp->nlp_flag); 10619 10696 10620 10697 phba->fc_stat.elsRcvRRQ++; ··· 10625 10702 break; 10626 10703 case ELS_CMD_ECHO: 10627 10704 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10628 - "RCV ECHO: did:x%x/ste:x%x flg:x%x", 10705 + "RCV ECHO: did:x%x/ste:x%x flg:x%lx", 10629 10706 did, vport->port_state, ndlp->nlp_flag); 10630 10707 10631 10708 phba->fc_stat.elsRcvECHO++; ··· 10641 10718 break; 10642 10719 case ELS_CMD_FPIN: 10643 10720 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 10644 - "RCV FPIN: did:x%x/ste:x%x flg:x%x", 10721 + "RCV FPIN: did:x%x/ste:x%x " 10722 + "flg:x%lx", 10645 10723 did, vport->port_state, ndlp->nlp_flag); 10646 10724 10647 10725 lpfc_els_rcv_fpin(vport, (struct fc_els_fpin *)payload, ··· 11150 11226 return; 11151 11227 11152 11228 mod_timer(&ndlp->nlp_delayfunc, jiffies + msecs_to_jiffies(1000)); 11153 - spin_lock_irq(&ndlp->lock); 11154 - ndlp->nlp_flag |= NLP_DELAY_TMO; 11155 - spin_unlock_irq(&ndlp->lock); 11229 + set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag); 11156 11230 ndlp->nlp_last_elscmd = ELS_CMD_FLOGI; 11157 11231 phba->pport->port_state = LPFC_FLOGI; 11158 11232 return; ··· 11281 11359 list_for_each_entry_safe(np, next_np, 11282 11360 &vport->fc_nodes, nlp_listp) { 11283 11361 if ((np->nlp_state != NLP_STE_NPR_NODE) || 11284 - !(np->nlp_flag & NLP_NPR_ADISC)) 11362 + !test_bit(NLP_NPR_ADISC, &np->nlp_flag)) 11285 11363 continue; 11286 - spin_lock_irq(&ndlp->lock); 11287 - np->nlp_flag &= ~NLP_NPR_ADISC; 11288 - spin_unlock_irq(&ndlp->lock); 11364 + clear_bit(NLP_NPR_ADISC, &np->nlp_flag); 11289 11365 lpfc_unreg_rpi(vport, np); 11290 11366 } 11291 11367 lpfc_cleanup_pending_mbox(vport); ··· 11486 11566 /* NPIV LOGO completes to NPort <nlp_DID> */ 11487 11567 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 11488 11568 "2928 NPIV LOGO completes to NPort x%x " 11489 - "Data: x%x x%x x%x x%x x%x x%x x%x\n", 11569 + "Data: x%x x%x x%x x%x x%x x%lx x%x\n", 11490 11570 ndlp->nlp_DID, ulp_status, ulp_word4, 11491 11571 tmo, vport->num_disc_nodes, 11492 11572 kref_read(&ndlp->kref), ndlp->nlp_flag, ··· 11502 11582 /* Wake up lpfc_vport_delete if waiting...*/ 11503 11583 if (ndlp->logo_waitq) 11504 11584 wake_up(ndlp->logo_waitq); 11585 + clear_bit(NLP_ISSUE_LOGO, &ndlp->nlp_flag); 11586 + clear_bit(NLP_LOGO_SND, &ndlp->nlp_flag); 11505 11587 spin_lock_irq(&ndlp->lock); 11506 - ndlp->nlp_flag &= ~(NLP_ISSUE_LOGO | NLP_LOGO_SND); 11507 11588 ndlp->save_flags &= ~NLP_WAIT_FOR_LOGO; 11508 11589 spin_unlock_irq(&ndlp->lock); 11509 11590 } ··· 11554 11633 memcpy(pcmd, &vport->fc_portname, sizeof(struct lpfc_name)); 11555 11634 11556 11635 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, 11557 - "Issue LOGO npiv did:x%x flg:x%x", 11636 + "Issue LOGO npiv did:x%x flg:x%lx", 11558 11637 ndlp->nlp_DID, ndlp->nlp_flag, 0); 11559 11638 11560 11639 elsiocb->cmd_cmpl = lpfc_cmpl_els_npiv_logo; 11561 - spin_lock_irq(&ndlp->lock); 11562 - ndlp->nlp_flag |= NLP_LOGO_SND; 11563 - spin_unlock_irq(&ndlp->lock); 11640 + set_bit(NLP_LOGO_SND, &ndlp->nlp_flag); 11564 11641 elsiocb->ndlp = lpfc_nlp_get(ndlp); 11565 11642 if (!elsiocb->ndlp) { 11566 11643 lpfc_els_free_iocb(phba, elsiocb); ··· 11574 11655 return 0; 11575 11656 11576 11657 err: 11577 - spin_lock_irq(&ndlp->lock); 11578 - ndlp->nlp_flag &= ~NLP_LOGO_SND; 11579 - spin_unlock_irq(&ndlp->lock); 11658 + clear_bit(NLP_LOGO_SND, &ndlp->nlp_flag); 11580 11659 return 1; 11581 11660 } 11582 11661 ··· 12055 12138 lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, 12056 12139 "3094 Start rport recovery on shost id 0x%x " 12057 12140 "fc_id 0x%06x vpi 0x%x rpi 0x%x state 0x%x " 12058 - "flags 0x%x\n", 12141 + "flag 0x%lx\n", 12059 12142 shost->host_no, ndlp->nlp_DID, 12060 12143 vport->vpi, ndlp->nlp_rpi, ndlp->nlp_state, 12061 12144 ndlp->nlp_flag); ··· 12065 12148 */ 12066 12149 spin_lock_irqsave(&ndlp->lock, flags); 12067 12150 ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; 12068 - ndlp->nlp_flag |= NLP_ISSUE_LOGO; 12069 12151 spin_unlock_irqrestore(&ndlp->lock, flags); 12152 + set_bit(NLP_ISSUE_LOGO, &ndlp->nlp_flag); 12070 12153 lpfc_unreg_rpi(vport, ndlp); 12071 12154 } 12072 12155
+131 -180
drivers/scsi/lpfc/lpfc_hbadisc.c
··· 100 100 return -EINVAL; 101 101 } 102 102 103 + if (rport->flags & FC_RPORT_DEVLOSS_CALLBK_DONE) { 104 + pr_info("**** %s: devloss_callbk_done rport x%px SID x%x\n", 105 + __func__, rport, rport->scsi_target_id); 106 + return -EINVAL; 107 + } 108 + 103 109 rdata = rport->dd_data; 104 110 if (!rdata) { 105 111 pr_err("**** %s: NULL dd_data on rport x%px SID x%x\n", ··· 143 137 ndlp = rdata->pnode; 144 138 vport = ndlp->vport; 145 139 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, 146 - "rport terminate: sid:x%x did:x%x flg:x%x", 140 + "rport terminate: sid:x%x did:x%x flg:x%lx", 147 141 ndlp->nlp_sid, ndlp->nlp_DID, ndlp->nlp_flag); 148 142 149 143 if (ndlp->nlp_sid != NLP_NO_SID) ··· 161 155 struct lpfc_hba *phba; 162 156 struct lpfc_work_evt *evtp; 163 157 unsigned long iflags; 158 + bool nvme_reg = false; 164 159 165 160 ndlp = ((struct lpfc_rport_data *)rport->dd_data)->pnode; 166 161 if (!ndlp) ··· 171 164 phba = vport->phba; 172 165 173 166 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, 174 - "rport devlosscb: sid:x%x did:x%x flg:x%x", 167 + "rport devlosscb: sid:x%x did:x%x flg:x%lx", 175 168 ndlp->nlp_sid, ndlp->nlp_DID, ndlp->nlp_flag); 176 169 177 170 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, 178 - "3181 dev_loss_callbk x%06x, rport x%px flg x%x " 171 + "3181 dev_loss_callbk x%06x, rport x%px flg x%lx " 179 172 "load_flag x%lx refcnt %u state %d xpt x%x\n", 180 173 ndlp->nlp_DID, ndlp->rport, ndlp->nlp_flag, 181 174 vport->load_flag, kref_read(&ndlp->kref), ··· 184 177 /* Don't schedule a worker thread event if the vport is going down. */ 185 178 if (test_bit(FC_UNLOADING, &vport->load_flag) || 186 179 !test_bit(HBA_SETUP, &phba->hba_flag)) { 180 + 187 181 spin_lock_irqsave(&ndlp->lock, iflags); 188 182 ndlp->rport = NULL; 189 183 184 + if (ndlp->fc4_xpt_flags & NVME_XPT_REGD) 185 + nvme_reg = true; 186 + 190 187 /* The scsi_transport is done with the rport so lpfc cannot 191 - * call to unregister. Remove the scsi transport reference 192 - * and clean up the SCSI transport node details. 188 + * call to unregister. 193 189 */ 194 - if (ndlp->fc4_xpt_flags & (NLP_XPT_REGD | SCSI_XPT_REGD)) { 190 + if (ndlp->fc4_xpt_flags & SCSI_XPT_REGD) { 195 191 ndlp->fc4_xpt_flags &= ~SCSI_XPT_REGD; 196 192 197 - /* NVME transport-registered rports need the 198 - * NLP_XPT_REGD flag to complete an unregister. 193 + /* If NLP_XPT_REGD was cleared in lpfc_nlp_unreg_node, 194 + * unregister calls were made to the scsi and nvme 195 + * transports and refcnt was already decremented. Clear 196 + * the NLP_XPT_REGD flag only if the NVME Rport is 197 + * confirmed unregistered. 199 198 */ 200 - if (!(ndlp->fc4_xpt_flags & NVME_XPT_REGD)) 199 + if (!nvme_reg && ndlp->fc4_xpt_flags & NLP_XPT_REGD) { 201 200 ndlp->fc4_xpt_flags &= ~NLP_XPT_REGD; 201 + spin_unlock_irqrestore(&ndlp->lock, iflags); 202 + lpfc_nlp_put(ndlp); /* may free ndlp */ 203 + } else { 204 + spin_unlock_irqrestore(&ndlp->lock, iflags); 205 + } 206 + } else { 202 207 spin_unlock_irqrestore(&ndlp->lock, iflags); 203 - lpfc_nlp_put(ndlp); 204 - spin_lock_irqsave(&ndlp->lock, iflags); 205 208 } 206 209 207 210 /* Only 1 thread can drop the initial node reference. If 208 211 * another thread has set NLP_DROPPED, this thread is done. 209 212 */ 210 - if (!(ndlp->fc4_xpt_flags & NVME_XPT_REGD) && 211 - !(ndlp->nlp_flag & NLP_DROPPED)) { 212 - ndlp->nlp_flag |= NLP_DROPPED; 213 - spin_unlock_irqrestore(&ndlp->lock, iflags); 214 - lpfc_nlp_put(ndlp); 213 + if (nvme_reg || test_bit(NLP_DROPPED, &ndlp->nlp_flag)) 215 214 return; 216 - } 217 215 218 - spin_unlock_irqrestore(&ndlp->lock, iflags); 216 + set_bit(NLP_DROPPED, &ndlp->nlp_flag); 217 + lpfc_nlp_put(ndlp); 219 218 return; 220 219 } 221 220 ··· 248 235 return; 249 236 } 250 237 251 - spin_lock_irqsave(&ndlp->lock, iflags); 252 - ndlp->nlp_flag |= NLP_IN_DEV_LOSS; 238 + set_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag); 253 239 240 + spin_lock_irqsave(&ndlp->lock, iflags); 254 241 /* If there is a PLOGI in progress, and we are in a 255 242 * NLP_NPR_2B_DISC state, don't turn off the flag. 256 243 */ 257 244 if (ndlp->nlp_state != NLP_STE_PLOGI_ISSUE) 258 - ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 245 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 259 246 260 247 /* 261 248 * The backend does not expect any more calls associated with this ··· 284 271 } else { 285 272 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, 286 273 "3188 worker thread is stopped %s x%06x, " 287 - " rport x%px flg x%x load_flag x%lx refcnt " 274 + " rport x%px flg x%lx load_flag x%lx refcnt " 288 275 "%d\n", __func__, ndlp->nlp_DID, 289 276 ndlp->rport, ndlp->nlp_flag, 290 277 vport->load_flag, kref_read(&ndlp->kref)); 291 278 if (!(ndlp->fc4_xpt_flags & NVME_XPT_REGD)) { 292 - spin_lock_irqsave(&ndlp->lock, iflags); 293 279 /* Node is in dev loss. No further transaction. */ 294 - ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS; 295 - spin_unlock_irqrestore(&ndlp->lock, iflags); 280 + clear_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag); 296 281 lpfc_disc_state_machine(vport, ndlp, NULL, 297 282 NLP_EVT_DEVICE_RM); 298 283 } ··· 423 412 lpfc_nlp_get(ndlp); 424 413 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY | LOG_NODE, 425 414 "8438 Devloss timeout reversed on DID x%x " 426 - "refcnt %d ndlp %p flag x%x " 415 + "refcnt %d ndlp %p flag x%lx " 427 416 "port_state = x%x\n", 428 417 ndlp->nlp_DID, kref_read(&ndlp->kref), ndlp, 429 418 ndlp->nlp_flag, vport->port_state); ··· 466 455 ndlp->nlp_DID, ndlp->nlp_type, ndlp->nlp_sid); 467 456 468 457 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, 469 - "3182 %s x%06x, nflag x%x xflags x%x refcnt %d\n", 458 + "3182 %s x%06x, nflag x%lx xflags x%x refcnt %d\n", 470 459 __func__, ndlp->nlp_DID, ndlp->nlp_flag, 471 460 ndlp->fc4_xpt_flags, kref_read(&ndlp->kref)); 472 461 ··· 480 469 *(name+4), *(name+5), *(name+6), *(name+7), 481 470 ndlp->nlp_DID); 482 471 483 - spin_lock_irqsave(&ndlp->lock, iflags); 484 - ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS; 485 - spin_unlock_irqrestore(&ndlp->lock, iflags); 472 + clear_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag); 486 473 return fcf_inuse; 487 474 } 488 475 ··· 508 499 } 509 500 break; 510 501 case Fabric_Cntl_DID: 511 - if (ndlp->nlp_flag & NLP_REG_LOGIN_SEND) 502 + if (test_bit(NLP_REG_LOGIN_SEND, &ndlp->nlp_flag)) 512 503 recovering = true; 513 504 break; 514 505 case FDMI_DID: ··· 536 527 * the following lpfc_nlp_put is necessary after fabric node is 537 528 * recovered. 538 529 */ 539 - spin_lock_irqsave(&ndlp->lock, iflags); 540 - ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS; 541 - spin_unlock_irqrestore(&ndlp->lock, iflags); 530 + clear_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag); 542 531 if (recovering) { 543 532 lpfc_printf_vlog(vport, KERN_INFO, 544 533 LOG_DISCOVERY | LOG_NODE, 545 534 "8436 Devloss timeout marked on " 546 535 "DID x%x refcnt %d ndlp %p " 547 - "flag x%x port_state = x%x\n", 536 + "flag x%lx port_state = x%x\n", 548 537 ndlp->nlp_DID, kref_read(&ndlp->kref), 549 538 ndlp, ndlp->nlp_flag, 550 539 vport->port_state); ··· 559 552 LOG_DISCOVERY | LOG_NODE, 560 553 "8437 Devloss timeout ignored on " 561 554 "DID x%x refcnt %d ndlp %p " 562 - "flag x%x port_state = x%x\n", 555 + "flag x%lx port_state = x%x\n", 563 556 ndlp->nlp_DID, kref_read(&ndlp->kref), 564 557 ndlp, ndlp->nlp_flag, 565 558 vport->port_state); ··· 579 572 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 580 573 "0203 Devloss timeout on " 581 574 "WWPN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x " 582 - "NPort x%06x Data: x%x x%x x%x refcnt %d\n", 575 + "NPort x%06x Data: x%lx x%x x%x refcnt %d\n", 583 576 *name, *(name+1), *(name+2), *(name+3), 584 577 *(name+4), *(name+5), *(name+6), *(name+7), 585 578 ndlp->nlp_DID, ndlp->nlp_flag, ··· 589 582 lpfc_printf_vlog(vport, KERN_INFO, LOG_TRACE_EVENT, 590 583 "0204 Devloss timeout on " 591 584 "WWPN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x " 592 - "NPort x%06x Data: x%x x%x x%x\n", 585 + "NPort x%06x Data: x%lx x%x x%x\n", 593 586 *name, *(name+1), *(name+2), *(name+3), 594 587 *(name+4), *(name+5), *(name+6), *(name+7), 595 588 ndlp->nlp_DID, ndlp->nlp_flag, 596 589 ndlp->nlp_state, ndlp->nlp_rpi); 597 590 } 598 - spin_lock_irqsave(&ndlp->lock, iflags); 599 - ndlp->nlp_flag &= ~NLP_IN_DEV_LOSS; 600 - spin_unlock_irqrestore(&ndlp->lock, iflags); 591 + clear_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag); 601 592 602 593 /* If we are devloss, but we are in the process of rediscovering the 603 594 * ndlp, don't issue a NLP_EVT_DEVICE_RM event. ··· 1360 1355 if (ndlp->nlp_DID != Fabric_DID) 1361 1356 lpfc_unreg_rpi(vport, ndlp); 1362 1357 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); 1363 - } else if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) { 1358 + } else if (!test_bit(NLP_NPR_ADISC, &ndlp->nlp_flag)) { 1364 1359 /* Fail outstanding IO now since device is 1365 1360 * marked for PLOGI. 1366 1361 */ ··· 3869 3864 pmb->ctx_ndlp = NULL; 3870 3865 3871 3866 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI | LOG_NODE | LOG_DISCOVERY, 3872 - "0002 rpi:%x DID:%x flg:%x %d x%px\n", 3867 + "0002 rpi:%x DID:%x flg:%lx %d x%px\n", 3873 3868 ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag, 3874 3869 kref_read(&ndlp->kref), 3875 3870 ndlp); 3876 - if (ndlp->nlp_flag & NLP_REG_LOGIN_SEND) 3877 - ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; 3871 + clear_bit(NLP_REG_LOGIN_SEND, &ndlp->nlp_flag); 3878 3872 3879 - if (ndlp->nlp_flag & NLP_IGNR_REG_CMPL || 3873 + if (test_bit(NLP_IGNR_REG_CMPL, &ndlp->nlp_flag) || 3880 3874 ndlp->nlp_state != NLP_STE_REG_LOGIN_ISSUE) { 3881 3875 /* We rcvd a rscn after issuing this 3882 3876 * mbox reg login, we may have cycled ··· 3885 3881 * there is another reg login in 3886 3882 * process. 3887 3883 */ 3888 - spin_lock_irq(&ndlp->lock); 3889 - ndlp->nlp_flag &= ~NLP_IGNR_REG_CMPL; 3890 - spin_unlock_irq(&ndlp->lock); 3884 + clear_bit(NLP_IGNR_REG_CMPL, &ndlp->nlp_flag); 3891 3885 3892 3886 /* 3893 3887 * We cannot leave the RPI registered because 3894 3888 * if we go thru discovery again for this ndlp 3895 3889 * a subsequent REG_RPI will fail. 3896 3890 */ 3897 - ndlp->nlp_flag |= NLP_RPI_REGISTERED; 3891 + set_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag); 3898 3892 lpfc_unreg_rpi(vport, ndlp); 3899 3893 } 3900 3894 ··· 4205 4203 4206 4204 if (phba->sli_rev < LPFC_SLI_REV4) 4207 4205 ndlp->nlp_rpi = mb->un.varWords[0]; 4208 - ndlp->nlp_flag |= NLP_RPI_REGISTERED; 4206 + set_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag); 4209 4207 ndlp->nlp_type |= NLP_FABRIC; 4210 4208 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); 4211 4209 ··· 4336 4334 * reference. 4337 4335 */ 4338 4336 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD))) { 4339 - spin_lock_irq(&ndlp->lock); 4340 - ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 4341 - spin_unlock_irq(&ndlp->lock); 4337 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 4342 4338 lpfc_nlp_put(ndlp); 4343 4339 } 4344 4340 ··· 4357 4357 4358 4358 if (phba->sli_rev < LPFC_SLI_REV4) 4359 4359 ndlp->nlp_rpi = mb->un.varWords[0]; 4360 - ndlp->nlp_flag |= NLP_RPI_REGISTERED; 4360 + set_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag); 4361 4361 ndlp->nlp_type |= NLP_FABRIC; 4362 4362 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); 4363 4363 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, 4364 - "0003 rpi:%x DID:%x flg:%x %d x%px\n", 4364 + "0003 rpi:%x DID:%x flg:%lx %d x%px\n", 4365 4365 ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag, 4366 4366 kref_read(&ndlp->kref), 4367 4367 ndlp); ··· 4453 4453 __func__, ndlp->nlp_DID, ndlp->nlp_rpi, 4454 4454 ndlp->nlp_state); 4455 4455 4456 - ndlp->nlp_flag |= NLP_RPI_REGISTERED; 4457 - ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; 4456 + set_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag); 4457 + clear_bit(NLP_REG_LOGIN_SEND, &ndlp->nlp_flag); 4458 4458 ndlp->nlp_type |= NLP_FABRIC; 4459 4459 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); 4460 4460 ··· 4488 4488 4489 4489 4490 4490 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, 4491 - "rport add: did:x%x flg:x%x type x%x", 4491 + "rport add: did:x%x flg:x%lx type x%x", 4492 4492 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_type); 4493 4493 4494 4494 /* Don't add the remote port if unloading. */ ··· 4556 4556 return; 4557 4557 4558 4558 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, 4559 - "rport delete: did:x%x flg:x%x type x%x", 4559 + "rport delete: did:x%x flg:x%lx type x%x", 4560 4560 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_type); 4561 4561 4562 4562 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, ··· 4672 4672 lpfc_printf_vlog(vport, KERN_INFO, 4673 4673 LOG_ELS | LOG_NODE | LOG_DISCOVERY, 4674 4674 "0999 %s Not regd: ndlp x%px rport x%px DID " 4675 - "x%x FLG x%x XPT x%x\n", 4675 + "x%x FLG x%lx XPT x%x\n", 4676 4676 __func__, ndlp, ndlp->rport, ndlp->nlp_DID, 4677 4677 ndlp->nlp_flag, ndlp->fc4_xpt_flags); 4678 4678 return; ··· 4688 4688 } else if (!ndlp->rport) { 4689 4689 lpfc_printf_vlog(vport, KERN_INFO, 4690 4690 LOG_ELS | LOG_NODE | LOG_DISCOVERY, 4691 - "1999 %s NDLP in devloss x%px DID x%x FLG x%x" 4691 + "1999 %s NDLP in devloss x%px DID x%x FLG x%lx" 4692 4692 " XPT x%x refcnt %u\n", 4693 4693 __func__, ndlp, ndlp->nlp_DID, ndlp->nlp_flag, 4694 4694 ndlp->fc4_xpt_flags, ··· 4733 4733 ndlp->nlp_type |= NLP_FC_NODE; 4734 4734 fallthrough; 4735 4735 case NLP_STE_MAPPED_NODE: 4736 - ndlp->nlp_flag &= ~NLP_NODEV_REMOVE; 4736 + clear_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 4737 4737 lpfc_nlp_reg_node(vport, ndlp); 4738 4738 break; 4739 4739 ··· 4744 4744 * backend, attempt it now 4745 4745 */ 4746 4746 case NLP_STE_NPR_NODE: 4747 - ndlp->nlp_flag &= ~NLP_RCV_PLOGI; 4747 + clear_bit(NLP_RCV_PLOGI, &ndlp->nlp_flag); 4748 4748 fallthrough; 4749 4749 default: 4750 4750 lpfc_nlp_unreg_node(vport, ndlp); ··· 4765 4765 } 4766 4766 4767 4767 if (new_state == NLP_STE_UNMAPPED_NODE) { 4768 - ndlp->nlp_flag &= ~NLP_NODEV_REMOVE; 4768 + clear_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 4769 4769 ndlp->nlp_type |= NLP_FC_NODE; 4770 4770 } 4771 4771 if (new_state == NLP_STE_MAPPED_NODE) 4772 - ndlp->nlp_flag &= ~NLP_NODEV_REMOVE; 4772 + clear_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 4773 4773 if (new_state == NLP_STE_NPR_NODE) 4774 - ndlp->nlp_flag &= ~NLP_RCV_PLOGI; 4774 + clear_bit(NLP_RCV_PLOGI, &ndlp->nlp_flag); 4775 4775 4776 4776 /* Reg/Unreg for FCP and NVME Transport interface */ 4777 4777 if ((old_state == NLP_STE_MAPPED_NODE || ··· 4779 4779 /* For nodes marked for ADISC, Handle unreg in ADISC cmpl 4780 4780 * if linkup. In linkdown do unreg_node 4781 4781 */ 4782 - if (!(ndlp->nlp_flag & NLP_NPR_ADISC) || 4782 + if (!test_bit(NLP_NPR_ADISC, &ndlp->nlp_flag) || 4783 4783 !lpfc_is_link_up(vport->phba)) 4784 4784 lpfc_nlp_unreg_node(vport, ndlp); 4785 4785 } ··· 4799 4799 (!ndlp->rport || 4800 4800 ndlp->rport->scsi_target_id == -1 || 4801 4801 ndlp->rport->scsi_target_id >= LPFC_MAX_TARGET)) { 4802 - spin_lock_irq(&ndlp->lock); 4803 - ndlp->nlp_flag |= NLP_TGT_NO_SCSIID; 4804 - spin_unlock_irq(&ndlp->lock); 4802 + set_bit(NLP_TGT_NO_SCSIID, &ndlp->nlp_flag); 4805 4803 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); 4806 4804 } 4807 4805 } ··· 4831 4833 int state) 4832 4834 { 4833 4835 int old_state = ndlp->nlp_state; 4834 - int node_dropped = ndlp->nlp_flag & NLP_DROPPED; 4836 + bool node_dropped = test_bit(NLP_DROPPED, &ndlp->nlp_flag); 4835 4837 char name1[16], name2[16]; 4836 4838 unsigned long iflags; 4837 4839 ··· 4847 4849 4848 4850 if (node_dropped && old_state == NLP_STE_UNUSED_NODE && 4849 4851 state != NLP_STE_UNUSED_NODE) { 4850 - ndlp->nlp_flag &= ~NLP_DROPPED; 4852 + clear_bit(NLP_DROPPED, &ndlp->nlp_flag); 4851 4853 lpfc_nlp_get(ndlp); 4852 4854 } 4853 4855 ··· 4855 4857 state != NLP_STE_NPR_NODE) 4856 4858 lpfc_cancel_retry_delay_tmo(vport, ndlp); 4857 4859 if (old_state == NLP_STE_UNMAPPED_NODE) { 4858 - ndlp->nlp_flag &= ~NLP_TGT_NO_SCSIID; 4860 + clear_bit(NLP_TGT_NO_SCSIID, &ndlp->nlp_flag); 4859 4861 ndlp->nlp_type &= ~NLP_FC_NODE; 4860 4862 } 4861 4863 ··· 4952 4954 * reference from lpfc_nlp_init. If set, don't drop it again and 4953 4955 * introduce an imbalance. 4954 4956 */ 4955 - spin_lock_irq(&ndlp->lock); 4956 - if (!(ndlp->nlp_flag & NLP_DROPPED)) { 4957 - ndlp->nlp_flag |= NLP_DROPPED; 4958 - spin_unlock_irq(&ndlp->lock); 4957 + if (!test_and_set_bit(NLP_DROPPED, &ndlp->nlp_flag)) 4959 4958 lpfc_nlp_put(ndlp); 4960 - return; 4961 - } 4962 - spin_unlock_irq(&ndlp->lock); 4963 4959 } 4964 4960 4965 4961 /* ··· 5068 5076 } else if (pring->ringno == LPFC_FCP_RING) { 5069 5077 /* Skip match check if waiting to relogin to FCP target */ 5070 5078 if ((ndlp->nlp_type & NLP_FCP_TARGET) && 5071 - (ndlp->nlp_flag & NLP_DELAY_TMO)) { 5079 + test_bit(NLP_DELAY_TMO, &ndlp->nlp_flag)) 5072 5080 return 0; 5073 - } 5081 + 5074 5082 if (ulp_context == ndlp->nlp_rpi) 5075 5083 return 1; 5076 5084 } ··· 5140 5148 * Everything that matches on txcmplq will be returned 5141 5149 * by firmware with a no rpi error. 5142 5150 */ 5143 - if (ndlp->nlp_flag & NLP_RPI_REGISTERED) { 5151 + if (test_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag)) { 5144 5152 if (phba->sli_rev != LPFC_SLI_REV4) 5145 5153 lpfc_sli3_dequeue_nport_iocbs(phba, ndlp, &completions); 5146 5154 else ··· 5174 5182 lpfc_issue_els_logo(vport, ndlp, 0); 5175 5183 5176 5184 /* Check to see if there are any deferred events to process */ 5177 - if ((ndlp->nlp_flag & NLP_UNREG_INP) && 5178 - (ndlp->nlp_defer_did != NLP_EVT_NOTHING_PENDING)) { 5185 + if (test_bit(NLP_UNREG_INP, &ndlp->nlp_flag) && 5186 + ndlp->nlp_defer_did != NLP_EVT_NOTHING_PENDING) { 5179 5187 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 5180 5188 "1434 UNREG cmpl deferred logo x%x " 5181 5189 "on NPort x%x Data: x%x x%px\n", 5182 5190 ndlp->nlp_rpi, ndlp->nlp_DID, 5183 5191 ndlp->nlp_defer_did, ndlp); 5184 5192 5185 - ndlp->nlp_flag &= ~NLP_UNREG_INP; 5193 + clear_bit(NLP_UNREG_INP, &ndlp->nlp_flag); 5186 5194 ndlp->nlp_defer_did = NLP_EVT_NOTHING_PENDING; 5187 5195 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); 5188 5196 } else { 5189 - /* NLP_RELEASE_RPI is only set for SLI4 ports. */ 5190 - if (ndlp->nlp_flag & NLP_RELEASE_RPI) { 5191 - lpfc_sli4_free_rpi(vport->phba, ndlp->nlp_rpi); 5192 - spin_lock_irq(&ndlp->lock); 5193 - ndlp->nlp_flag &= ~NLP_RELEASE_RPI; 5194 - ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR; 5195 - spin_unlock_irq(&ndlp->lock); 5196 - } 5197 - spin_lock_irq(&ndlp->lock); 5198 - ndlp->nlp_flag &= ~NLP_UNREG_INP; 5199 - spin_unlock_irq(&ndlp->lock); 5197 + clear_bit(NLP_UNREG_INP, &ndlp->nlp_flag); 5200 5198 } 5201 5199 5202 5200 /* The node has an outstanding reference for the unreg. Now ··· 5206 5224 lpfc_set_unreg_login_mbx_cmpl(struct lpfc_hba *phba, struct lpfc_vport *vport, 5207 5225 struct lpfc_nodelist *ndlp, LPFC_MBOXQ_t *mbox) 5208 5226 { 5209 - unsigned long iflags; 5210 - 5211 5227 /* Driver always gets a reference on the mailbox job 5212 5228 * in support of async jobs. 5213 5229 */ ··· 5213 5233 if (!mbox->ctx_ndlp) 5214 5234 return; 5215 5235 5216 - if (ndlp->nlp_flag & NLP_ISSUE_LOGO) { 5236 + if (test_bit(NLP_ISSUE_LOGO, &ndlp->nlp_flag)) { 5217 5237 mbox->mbox_cmpl = lpfc_nlp_logo_unreg; 5218 - 5219 5238 } else if (phba->sli_rev == LPFC_SLI_REV4 && 5220 5239 !test_bit(FC_UNLOADING, &vport->load_flag) && 5221 5240 (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) >= ··· 5222 5243 (kref_read(&ndlp->kref) > 0)) { 5223 5244 mbox->mbox_cmpl = lpfc_sli4_unreg_rpi_cmpl_clr; 5224 5245 } else { 5225 - if (test_bit(FC_UNLOADING, &vport->load_flag)) { 5226 - if (phba->sli_rev == LPFC_SLI_REV4) { 5227 - spin_lock_irqsave(&ndlp->lock, iflags); 5228 - ndlp->nlp_flag |= NLP_RELEASE_RPI; 5229 - spin_unlock_irqrestore(&ndlp->lock, iflags); 5230 - } 5231 - } 5232 5246 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 5233 5247 } 5234 5248 } ··· 5243 5271 int rc, acc_plogi = 1; 5244 5272 uint16_t rpi; 5245 5273 5246 - if (ndlp->nlp_flag & NLP_RPI_REGISTERED || 5247 - ndlp->nlp_flag & NLP_REG_LOGIN_SEND) { 5248 - if (ndlp->nlp_flag & NLP_REG_LOGIN_SEND) 5274 + if (test_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag) || 5275 + test_bit(NLP_REG_LOGIN_SEND, &ndlp->nlp_flag)) { 5276 + if (test_bit(NLP_REG_LOGIN_SEND, &ndlp->nlp_flag)) 5249 5277 lpfc_printf_vlog(vport, KERN_INFO, 5250 5278 LOG_NODE | LOG_DISCOVERY, 5251 5279 "3366 RPI x%x needs to be " 5252 - "unregistered nlp_flag x%x " 5280 + "unregistered nlp_flag x%lx " 5253 5281 "did x%x\n", 5254 5282 ndlp->nlp_rpi, ndlp->nlp_flag, 5255 5283 ndlp->nlp_DID); ··· 5257 5285 /* If there is already an UNREG in progress for this ndlp, 5258 5286 * no need to queue up another one. 5259 5287 */ 5260 - if (ndlp->nlp_flag & NLP_UNREG_INP) { 5288 + if (test_bit(NLP_UNREG_INP, &ndlp->nlp_flag)) { 5261 5289 lpfc_printf_vlog(vport, KERN_INFO, 5262 5290 LOG_NODE | LOG_DISCOVERY, 5263 5291 "1436 unreg_rpi SKIP UNREG x%x on " 5264 - "NPort x%x deferred x%x flg x%x " 5292 + "NPort x%x deferred x%x flg x%lx " 5265 5293 "Data: x%px\n", 5266 5294 ndlp->nlp_rpi, ndlp->nlp_DID, 5267 5295 ndlp->nlp_defer_did, ··· 5284 5312 return 1; 5285 5313 } 5286 5314 5315 + /* Accept PLOGIs after unreg_rpi_cmpl. */ 5287 5316 if (mbox->mbox_cmpl == lpfc_sli4_unreg_rpi_cmpl_clr) 5288 - /* 5289 - * accept PLOGIs after unreg_rpi_cmpl 5290 - */ 5291 5317 acc_plogi = 0; 5292 - if (((ndlp->nlp_DID & Fabric_DID_MASK) != 5293 - Fabric_DID_MASK) && 5294 - (!test_bit(FC_OFFLINE_MODE, &vport->fc_flag))) 5295 - ndlp->nlp_flag |= NLP_UNREG_INP; 5318 + 5319 + if (!test_bit(FC_OFFLINE_MODE, &vport->fc_flag)) 5320 + set_bit(NLP_UNREG_INP, &ndlp->nlp_flag); 5296 5321 5297 5322 lpfc_printf_vlog(vport, KERN_INFO, 5298 5323 LOG_NODE | LOG_DISCOVERY, 5299 5324 "1433 unreg_rpi UNREG x%x on " 5300 - "NPort x%x deferred flg x%x " 5325 + "NPort x%x deferred flg x%lx " 5301 5326 "Data:x%px\n", 5302 5327 ndlp->nlp_rpi, ndlp->nlp_DID, 5303 5328 ndlp->nlp_flag, ndlp); 5304 5329 5305 5330 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); 5306 5331 if (rc == MBX_NOT_FINISHED) { 5307 - ndlp->nlp_flag &= ~NLP_UNREG_INP; 5332 + clear_bit(NLP_UNREG_INP, &ndlp->nlp_flag); 5308 5333 mempool_free(mbox, phba->mbox_mem_pool); 5309 5334 acc_plogi = 1; 5310 5335 lpfc_nlp_put(ndlp); ··· 5311 5342 LOG_NODE | LOG_DISCOVERY, 5312 5343 "1444 Failed to allocate mempool " 5313 5344 "unreg_rpi UNREG x%x, " 5314 - "DID x%x, flag x%x, " 5345 + "DID x%x, flag x%lx, " 5315 5346 "ndlp x%px\n", 5316 5347 ndlp->nlp_rpi, ndlp->nlp_DID, 5317 5348 ndlp->nlp_flag, ndlp); ··· 5321 5352 * not unloading. 5322 5353 */ 5323 5354 if (!test_bit(FC_UNLOADING, &vport->load_flag)) { 5324 - ndlp->nlp_flag &= ~NLP_UNREG_INP; 5355 + clear_bit(NLP_UNREG_INP, &ndlp->nlp_flag); 5325 5356 lpfc_issue_els_logo(vport, ndlp, 0); 5326 5357 ndlp->nlp_prev_state = ndlp->nlp_state; 5327 5358 lpfc_nlp_set_state(vport, ndlp, ··· 5334 5365 out: 5335 5366 if (phba->sli_rev != LPFC_SLI_REV4) 5336 5367 ndlp->nlp_rpi = 0; 5337 - ndlp->nlp_flag &= ~NLP_RPI_REGISTERED; 5338 - ndlp->nlp_flag &= ~NLP_NPR_ADISC; 5368 + clear_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag); 5369 + clear_bit(NLP_NPR_ADISC, &ndlp->nlp_flag); 5339 5370 if (acc_plogi) 5340 - ndlp->nlp_flag &= ~NLP_LOGO_ACC; 5371 + clear_bit(NLP_LOGO_ACC, &ndlp->nlp_flag); 5341 5372 return 1; 5342 5373 } 5343 - ndlp->nlp_flag &= ~NLP_LOGO_ACC; 5374 + clear_bit(NLP_LOGO_ACC, &ndlp->nlp_flag); 5344 5375 return 0; 5345 5376 } 5346 5377 ··· 5368 5399 for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { 5369 5400 spin_lock_irqsave(&vports[i]->fc_nodes_list_lock, iflags); 5370 5401 list_for_each_entry(ndlp, &vports[i]->fc_nodes, nlp_listp) { 5371 - if (ndlp->nlp_flag & NLP_RPI_REGISTERED) { 5402 + if (test_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag)) { 5372 5403 /* The mempool_alloc might sleep */ 5373 5404 spin_unlock_irqrestore(&vports[i]->fc_nodes_list_lock, 5374 5405 iflags); ··· 5456 5487 /* Cleanup node for NPort <nlp_DID> */ 5457 5488 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, 5458 5489 "0900 Cleanup node for NPort x%x " 5459 - "Data: x%x x%x x%x\n", 5490 + "Data: x%lx x%x x%x\n", 5460 5491 ndlp->nlp_DID, ndlp->nlp_flag, 5461 5492 ndlp->nlp_state, ndlp->nlp_rpi); 5462 5493 lpfc_dequeue_node(vport, ndlp); ··· 5501 5532 5502 5533 lpfc_els_abort(phba, ndlp); 5503 5534 5504 - spin_lock_irq(&ndlp->lock); 5505 - ndlp->nlp_flag &= ~NLP_DELAY_TMO; 5506 - spin_unlock_irq(&ndlp->lock); 5535 + clear_bit(NLP_DELAY_TMO, &ndlp->nlp_flag); 5507 5536 5508 5537 ndlp->nlp_last_elscmd = 0; 5509 5538 del_timer_sync(&ndlp->nlp_delayfunc); ··· 5510 5543 list_del_init(&ndlp->dev_loss_evt.evt_listp); 5511 5544 list_del_init(&ndlp->recovery_evt.evt_listp); 5512 5545 lpfc_cleanup_vports_rrqs(vport, ndlp); 5513 - 5514 - if (phba->sli_rev == LPFC_SLI_REV4) 5515 - ndlp->nlp_flag |= NLP_RELEASE_RPI; 5516 - 5517 5546 return 0; 5518 5547 } 5519 5548 ··· 5583 5620 ); 5584 5621 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE, 5585 5622 "0929 FIND node DID " 5586 - "Data: x%px x%x x%x x%x x%x x%px\n", 5623 + "Data: x%px x%x x%lx x%x x%x x%px\n", 5587 5624 ndlp, ndlp->nlp_DID, 5588 5625 ndlp->nlp_flag, data1, ndlp->nlp_rpi, 5589 5626 ndlp->active_rrqs_xri_bitmap); ··· 5630 5667 iflags); 5631 5668 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE, 5632 5669 "2025 FIND node DID MAPPED " 5633 - "Data: x%px x%x x%x x%x x%px\n", 5670 + "Data: x%px x%x x%lx x%x x%px\n", 5634 5671 ndlp, ndlp->nlp_DID, 5635 5672 ndlp->nlp_flag, data1, 5636 5673 ndlp->active_rrqs_xri_bitmap); ··· 5664 5701 5665 5702 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 5666 5703 "6453 Setup New Node 2B_DISC x%x " 5667 - "Data:x%x x%x x%lx\n", 5704 + "Data:x%lx x%x x%lx\n", 5668 5705 ndlp->nlp_DID, ndlp->nlp_flag, 5669 5706 ndlp->nlp_state, vport->fc_flag); 5670 5707 5671 - spin_lock_irq(&ndlp->lock); 5672 - ndlp->nlp_flag |= NLP_NPR_2B_DISC; 5673 - spin_unlock_irq(&ndlp->lock); 5708 + set_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 5674 5709 return ndlp; 5675 5710 } 5676 5711 ··· 5687 5726 5688 5727 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 5689 5728 "6455 Setup RSCN Node 2B_DISC x%x " 5690 - "Data:x%x x%x x%lx\n", 5729 + "Data:x%lx x%x x%lx\n", 5691 5730 ndlp->nlp_DID, ndlp->nlp_flag, 5692 5731 ndlp->nlp_state, vport->fc_flag); 5693 5732 ··· 5705 5744 NLP_EVT_DEVICE_RECOVERY); 5706 5745 } 5707 5746 5708 - spin_lock_irq(&ndlp->lock); 5709 - ndlp->nlp_flag |= NLP_NPR_2B_DISC; 5710 - spin_unlock_irq(&ndlp->lock); 5747 + set_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 5711 5748 } else { 5712 5749 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 5713 5750 "6456 Skip Setup RSCN Node x%x " 5714 - "Data:x%x x%x x%lx\n", 5751 + "Data:x%lx x%x x%lx\n", 5715 5752 ndlp->nlp_DID, ndlp->nlp_flag, 5716 5753 ndlp->nlp_state, vport->fc_flag); 5717 5754 ndlp = NULL; ··· 5717 5758 } else { 5718 5759 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 5719 5760 "6457 Setup Active Node 2B_DISC x%x " 5720 - "Data:x%x x%x x%lx\n", 5761 + "Data:x%lx x%x x%lx\n", 5721 5762 ndlp->nlp_DID, ndlp->nlp_flag, 5722 5763 ndlp->nlp_state, vport->fc_flag); 5723 5764 ··· 5728 5769 if (ndlp->nlp_state == NLP_STE_ADISC_ISSUE || 5729 5770 ndlp->nlp_state == NLP_STE_PLOGI_ISSUE || 5730 5771 (!vport->phba->nvmet_support && 5731 - ndlp->nlp_flag & NLP_RCV_PLOGI)) 5772 + test_bit(NLP_RCV_PLOGI, &ndlp->nlp_flag))) 5732 5773 return NULL; 5733 5774 5734 5775 if (vport->phba->nvmet_support) ··· 5738 5779 * allows for rediscovery 5739 5780 */ 5740 5781 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); 5741 - 5742 - spin_lock_irq(&ndlp->lock); 5743 - ndlp->nlp_flag |= NLP_NPR_2B_DISC; 5744 - spin_unlock_irq(&ndlp->lock); 5782 + set_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 5745 5783 } 5746 5784 return ndlp; 5747 5785 } ··· 6109 6153 /* Clean up the ndlp on Fabric connections */ 6110 6154 lpfc_drop_node(vport, ndlp); 6111 6155 6112 - } else if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) { 6156 + } else if (!test_bit(NLP_NPR_ADISC, &ndlp->nlp_flag)) { 6113 6157 /* Fail outstanding IO now since device 6114 6158 * is marked for PLOGI. 6115 6159 */ ··· 6322 6366 6323 6367 if (phba->sli_rev < LPFC_SLI_REV4) 6324 6368 ndlp->nlp_rpi = mb->un.varWords[0]; 6325 - ndlp->nlp_flag |= NLP_RPI_REGISTERED; 6369 + set_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag); 6326 6370 ndlp->nlp_type |= NLP_FABRIC; 6327 6371 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); 6328 6372 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, 6329 - "0004 rpi:%x DID:%x flg:%x %d x%px\n", 6373 + "0004 rpi:%x DID:%x flg:%lx %d x%px\n", 6330 6374 ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag, 6331 6375 kref_read(&ndlp->kref), 6332 6376 ndlp); ··· 6376 6420 if (filter(ndlp, param)) { 6377 6421 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE_VERBOSE, 6378 6422 "3185 FIND node filter %ps DID " 6379 - "ndlp x%px did x%x flg x%x st x%x " 6423 + "ndlp x%px did x%x flg x%lx st x%x " 6380 6424 "xri x%x type x%x rpi x%x\n", 6381 6425 filter, ndlp, ndlp->nlp_DID, 6382 6426 ndlp->nlp_flag, ndlp->nlp_state, ··· 6511 6555 INIT_LIST_HEAD(&ndlp->nlp_listp); 6512 6556 if (vport->phba->sli_rev == LPFC_SLI_REV4) { 6513 6557 ndlp->nlp_rpi = rpi; 6514 - lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_DISCOVERY, 6515 - "0007 Init New ndlp x%px, rpi:x%x DID:%x " 6516 - "flg:x%x refcnt:%d\n", 6558 + lpfc_printf_vlog(vport, KERN_INFO, 6559 + LOG_ELS | LOG_NODE | LOG_DISCOVERY, 6560 + "0007 Init New ndlp x%px, rpi:x%x DID:x%x " 6561 + "flg:x%lx refcnt:%d\n", 6517 6562 ndlp, ndlp->nlp_rpi, ndlp->nlp_DID, 6518 6563 ndlp->nlp_flag, kref_read(&ndlp->kref)); 6519 6564 ··· 6546 6589 struct lpfc_vport *vport = ndlp->vport; 6547 6590 6548 6591 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, 6549 - "node release: did:x%x flg:x%x type:x%x", 6592 + "node release: did:x%x flg:x%lx type:x%x", 6550 6593 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_type); 6551 6594 6552 6595 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, ··· 6558 6601 lpfc_cancel_retry_delay_tmo(vport, ndlp); 6559 6602 lpfc_cleanup_node(vport, ndlp); 6560 6603 6561 - /* Not all ELS transactions have registered the RPI with the port. 6562 - * In these cases the rpi usage is temporary and the node is 6563 - * released when the WQE is completed. Catch this case to free the 6564 - * RPI to the pool. Because this node is in the release path, a lock 6565 - * is unnecessary. All references are gone and the node has been 6566 - * dequeued. 6604 + /* All nodes are initialized with an RPI that needs to be released 6605 + * now. All references are gone and the node has been dequeued. 6567 6606 */ 6568 - if (ndlp->nlp_flag & NLP_RELEASE_RPI) { 6569 - if (ndlp->nlp_rpi != LPFC_RPI_ALLOC_ERROR && 6570 - !(ndlp->nlp_flag & (NLP_RPI_REGISTERED | NLP_UNREG_INP))) { 6571 - lpfc_sli4_free_rpi(vport->phba, ndlp->nlp_rpi); 6572 - ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR; 6573 - } 6607 + if (vport->phba->sli_rev == LPFC_SLI_REV4) { 6608 + lpfc_sli4_free_rpi(vport->phba, ndlp->nlp_rpi); 6609 + ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR; 6574 6610 } 6575 6611 6576 6612 /* The node is not freed back to memory, it is released to a pool so ··· 6592 6642 6593 6643 if (ndlp) { 6594 6644 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, 6595 - "node get: did:x%x flg:x%x refcnt:x%x", 6645 + "node get: did:x%x flg:x%lx refcnt:x%x", 6596 6646 ndlp->nlp_DID, ndlp->nlp_flag, 6597 6647 kref_read(&ndlp->kref)); 6598 6648 ··· 6624 6674 { 6625 6675 if (ndlp) { 6626 6676 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, 6627 - "node put: did:x%x flg:x%x refcnt:x%x", 6677 + "node put: did:x%x flg:x%lx refcnt:x%x", 6628 6678 ndlp->nlp_DID, ndlp->nlp_flag, 6629 6679 kref_read(&ndlp->kref)); 6630 6680 } else { ··· 6677 6727 spin_unlock_irqrestore(&vports[i]->fc_nodes_list_lock, 6678 6728 iflags); 6679 6729 goto out; 6680 - } else if (ndlp->nlp_flag & NLP_RPI_REGISTERED) { 6730 + } else if (test_bit(NLP_RPI_REGISTERED, 6731 + &ndlp->nlp_flag)) { 6681 6732 ret = 1; 6682 6733 lpfc_printf_log(phba, KERN_INFO, 6683 6734 LOG_NODE | LOG_DISCOVERY, 6684 - "2624 RPI %x DID %x flag %x " 6735 + "2624 RPI %x DID %x flag %lx " 6685 6736 "still logged in\n", 6686 6737 ndlp->nlp_rpi, ndlp->nlp_DID, 6687 6738 ndlp->nlp_flag);
+23 -38
drivers/scsi/lpfc/lpfc_init.c
··· 1943 1943 1944 1944 lpfc_offline_prep(phba, mbx_action); 1945 1945 lpfc_sli_flush_io_rings(phba); 1946 + lpfc_nvmels_flush_cmd(phba); 1946 1947 lpfc_offline(phba); 1947 1948 /* release interrupt for possible resource change */ 1948 1949 lpfc_sli4_disable_intr(phba); ··· 3093 3092 lpfc_printf_vlog(ndlp->vport, KERN_ERR, 3094 3093 LOG_DISCOVERY, 3095 3094 "0282 did:x%x ndlp:x%px " 3096 - "refcnt:%d xflags x%x nflag x%x\n", 3095 + "refcnt:%d xflags x%x " 3096 + "nflag x%lx\n", 3097 3097 ndlp->nlp_DID, (void *)ndlp, 3098 3098 kref_read(&ndlp->kref), 3099 3099 ndlp->fc4_xpt_flags, ··· 3381 3379 } 3382 3380 3383 3381 /** 3384 - * lpfc_sli4_node_prep - Assign RPIs for active nodes. 3382 + * lpfc_sli4_node_rpi_restore - Recover assigned RPIs for active nodes. 3385 3383 * @phba: pointer to lpfc hba data structure. 3386 3384 * 3387 3385 * Allocate RPIs for all active remote nodes. This is needed whenever ··· 3389 3387 * is to fixup the temporary rpi assignments. 3390 3388 **/ 3391 3389 void 3392 - lpfc_sli4_node_prep(struct lpfc_hba *phba) 3390 + lpfc_sli4_node_rpi_restore(struct lpfc_hba *phba) 3393 3391 { 3394 3392 struct lpfc_nodelist *ndlp, *next_ndlp; 3395 3393 struct lpfc_vport **vports; ··· 3399 3397 return; 3400 3398 3401 3399 vports = lpfc_create_vport_work_array(phba); 3402 - if (vports == NULL) 3400 + if (!vports) 3403 3401 return; 3404 3402 3405 - for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { 3403 + for (i = 0; i <= phba->max_vports && vports[i]; i++) { 3406 3404 if (test_bit(FC_UNLOADING, &vports[i]->load_flag)) 3407 3405 continue; 3408 3406 ··· 3411 3409 nlp_listp) { 3412 3410 rpi = lpfc_sli4_alloc_rpi(phba); 3413 3411 if (rpi == LPFC_RPI_ALLOC_ERROR) { 3414 - /* TODO print log? */ 3412 + lpfc_printf_vlog(ndlp->vport, KERN_INFO, 3413 + LOG_NODE | LOG_DISCOVERY, 3414 + "0099 RPI alloc error for " 3415 + "ndlp x%px DID:x%06x " 3416 + "flg:x%lx\n", 3417 + ndlp, ndlp->nlp_DID, 3418 + ndlp->nlp_flag); 3415 3419 continue; 3416 3420 } 3417 3421 ndlp->nlp_rpi = rpi; 3418 3422 lpfc_printf_vlog(ndlp->vport, KERN_INFO, 3419 3423 LOG_NODE | LOG_DISCOVERY, 3420 3424 "0009 Assign RPI x%x to ndlp x%px " 3421 - "DID:x%06x flg:x%x\n", 3425 + "DID:x%06x flg:x%lx\n", 3422 3426 ndlp->nlp_rpi, ndlp, ndlp->nlp_DID, 3423 3427 ndlp->nlp_flag); 3424 3428 } ··· 3828 3820 &vports[i]->fc_nodes, 3829 3821 nlp_listp) { 3830 3822 3831 - spin_lock_irq(&ndlp->lock); 3832 - ndlp->nlp_flag &= ~NLP_NPR_ADISC; 3833 - spin_unlock_irq(&ndlp->lock); 3834 - 3823 + clear_bit(NLP_NPR_ADISC, &ndlp->nlp_flag); 3835 3824 if (offline || hba_pci_err) { 3836 - spin_lock_irq(&ndlp->lock); 3837 - ndlp->nlp_flag &= ~(NLP_UNREG_INP | 3838 - NLP_RPI_REGISTERED); 3839 - spin_unlock_irq(&ndlp->lock); 3840 - if (phba->sli_rev == LPFC_SLI_REV4) 3841 - lpfc_sli_rpi_release(vports[i], 3842 - ndlp); 3843 - } else { 3844 - lpfc_unreg_rpi(vports[i], ndlp); 3845 - } 3846 - /* 3847 - * Whenever an SLI4 port goes offline, free the 3848 - * RPI. Get a new RPI when the adapter port 3849 - * comes back online. 3850 - */ 3851 - if (phba->sli_rev == LPFC_SLI_REV4) { 3852 - lpfc_printf_vlog(vports[i], KERN_INFO, 3853 - LOG_NODE | LOG_DISCOVERY, 3854 - "0011 Free RPI x%x on " 3855 - "ndlp: x%px did x%x\n", 3856 - ndlp->nlp_rpi, ndlp, 3857 - ndlp->nlp_DID); 3858 - lpfc_sli4_free_rpi(phba, ndlp->nlp_rpi); 3859 - ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR; 3825 + clear_bit(NLP_UNREG_INP, 3826 + &ndlp->nlp_flag); 3827 + clear_bit(NLP_RPI_REGISTERED, 3828 + &ndlp->nlp_flag); 3860 3829 } 3861 3830 3862 3831 if (ndlp->nlp_type & NLP_FABRIC) { ··· 6910 6925 */ 6911 6926 mod_timer(&ndlp->nlp_delayfunc, 6912 6927 jiffies + msecs_to_jiffies(1000)); 6913 - spin_lock_irq(&ndlp->lock); 6914 - ndlp->nlp_flag |= NLP_DELAY_TMO; 6915 - spin_unlock_irq(&ndlp->lock); 6928 + set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag); 6916 6929 ndlp->nlp_last_elscmd = ELS_CMD_FDISC; 6917 6930 vport->port_state = LPFC_FDISC; 6918 6931 } else { ··· 13500 13517 13501 13518 /* Disable FW logging to host memory */ 13502 13519 lpfc_ras_stop_fwlog(phba); 13520 + 13521 + lpfc_sli4_queue_unset(phba); 13503 13522 13504 13523 /* Reset SLI4 HBA FCoE function */ 13505 13524 lpfc_pci_function_reset(phba);
+134 -195
drivers/scsi/lpfc/lpfc_nportdisc.c
··· 65 65 struct lpfc_name *nn, struct lpfc_name *pn) 66 66 { 67 67 /* First, we MUST have a RPI registered */ 68 - if (!(ndlp->nlp_flag & NLP_RPI_REGISTERED)) 68 + if (!test_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag)) 69 69 return 0; 70 70 71 71 /* Compare the ADISC rsp WWNN / WWPN matches our internal node ··· 239 239 /* Abort outstanding I/O on NPort <nlp_DID> */ 240 240 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_DISCOVERY, 241 241 "2819 Abort outstanding I/O on NPort x%x " 242 - "Data: x%x x%x x%x\n", 242 + "Data: x%lx x%x x%x\n", 243 243 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, 244 244 ndlp->nlp_rpi); 245 245 /* Clean up all fabric IOs first.*/ ··· 340 340 341 341 /* Now process the REG_RPI cmpl */ 342 342 lpfc_mbx_cmpl_reg_login(phba, login_mbox); 343 - ndlp->nlp_flag &= ~NLP_ACC_REGLOGIN; 343 + clear_bit(NLP_ACC_REGLOGIN, &ndlp->nlp_flag); 344 344 kfree(save_iocb); 345 345 } 346 346 ··· 404 404 405 405 /* PLOGI chkparm OK */ 406 406 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 407 - "0114 PLOGI chkparm OK Data: x%x x%x x%x " 407 + "0114 PLOGI chkparm OK Data: x%x x%x x%lx " 408 408 "x%x x%x x%lx\n", 409 409 ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag, 410 410 ndlp->nlp_rpi, vport->port_state, ··· 429 429 /* if already logged in, do implicit logout */ 430 430 switch (ndlp->nlp_state) { 431 431 case NLP_STE_NPR_NODE: 432 - if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) 432 + if (!test_bit(NLP_NPR_ADISC, &ndlp->nlp_flag)) 433 433 break; 434 434 fallthrough; 435 435 case NLP_STE_REG_LOGIN_ISSUE: ··· 449 449 ndlp->nlp_type &= ~(NLP_NVME_TARGET | NLP_NVME_INITIATOR); 450 450 ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; 451 451 ndlp->nlp_nvme_info &= ~NLP_NVME_NSLER; 452 - ndlp->nlp_flag &= ~NLP_FIRSTBURST; 452 + clear_bit(NLP_FIRSTBURST, &ndlp->nlp_flag); 453 453 454 454 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, 455 455 ndlp, NULL); ··· 480 480 ndlp->nlp_type &= ~(NLP_NVME_TARGET | NLP_NVME_INITIATOR); 481 481 ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; 482 482 ndlp->nlp_nvme_info &= ~NLP_NVME_NSLER; 483 - ndlp->nlp_flag &= ~NLP_FIRSTBURST; 483 + clear_bit(NLP_FIRSTBURST, &ndlp->nlp_flag); 484 484 485 485 login_mbox = NULL; 486 486 link_mbox = NULL; ··· 552 552 lpfc_can_disctmo(vport); 553 553 } 554 554 555 - ndlp->nlp_flag &= ~NLP_SUPPRESS_RSP; 555 + clear_bit(NLP_SUPPRESS_RSP, &ndlp->nlp_flag); 556 556 if ((phba->sli.sli_flag & LPFC_SLI_SUPPRESS_RSP) && 557 557 sp->cmn.valid_vendor_ver_level) { 558 558 vid = be32_to_cpu(sp->un.vv.vid); 559 559 flag = be32_to_cpu(sp->un.vv.flags); 560 560 if ((vid == LPFC_VV_EMLX_ID) && (flag & LPFC_VV_SUPPRESS_RSP)) 561 - ndlp->nlp_flag |= NLP_SUPPRESS_RSP; 561 + set_bit(NLP_SUPPRESS_RSP, &ndlp->nlp_flag); 562 562 } 563 563 564 564 login_mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); ··· 627 627 * this ELS request. The only way to do this is 628 628 * to register, then unregister the RPI. 629 629 */ 630 - spin_lock_irq(&ndlp->lock); 631 - ndlp->nlp_flag |= (NLP_RM_DFLT_RPI | NLP_ACC_REGLOGIN | 632 - NLP_RCV_PLOGI); 633 - spin_unlock_irq(&ndlp->lock); 630 + set_bit(NLP_RM_DFLT_RPI, &ndlp->nlp_flag); 631 + set_bit(NLP_ACC_REGLOGIN, &ndlp->nlp_flag); 632 + set_bit(NLP_RCV_PLOGI, &ndlp->nlp_flag); 634 633 } 635 634 636 635 stat.un.b.lsRjtRsnCode = LSRJT_INVALID_CMD; ··· 664 665 665 666 login_mbox->ctx_u.save_iocb = save_iocb; /* For PLOGI ACC */ 666 667 667 - spin_lock_irq(&ndlp->lock); 668 - ndlp->nlp_flag |= (NLP_ACC_REGLOGIN | NLP_RCV_PLOGI); 669 - spin_unlock_irq(&ndlp->lock); 668 + set_bit(NLP_ACC_REGLOGIN, &ndlp->nlp_flag); 669 + set_bit(NLP_RCV_PLOGI, &ndlp->nlp_flag); 670 670 671 671 /* Start the ball rolling by issuing REG_LOGIN here */ 672 672 rc = lpfc_sli_issue_mbox(phba, login_mbox, MBX_NOWAIT); ··· 795 797 */ 796 798 if (ndlp->nlp_type & (NLP_FCP_TARGET | NLP_NVME_TARGET)) { 797 799 if ((ndlp->nlp_state != NLP_STE_MAPPED_NODE) && 798 - !(ndlp->nlp_flag & NLP_NPR_ADISC)) 800 + !test_bit(NLP_NPR_ADISC, &ndlp->nlp_flag)) 799 801 lpfc_nlp_set_state(vport, ndlp, 800 802 NLP_STE_MAPPED_NODE); 801 803 } ··· 812 814 /* 1 sec timeout */ 813 815 mod_timer(&ndlp->nlp_delayfunc, jiffies + msecs_to_jiffies(1000)); 814 816 815 - spin_lock_irq(&ndlp->lock); 816 - ndlp->nlp_flag |= NLP_DELAY_TMO; 817 - spin_unlock_irq(&ndlp->lock); 817 + set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag); 818 818 ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; 819 819 ndlp->nlp_prev_state = ndlp->nlp_state; 820 820 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); ··· 831 835 /* Only call LOGO ACC for first LOGO, this avoids sending unnecessary 832 836 * PLOGIs during LOGO storms from a device. 833 837 */ 834 - spin_lock_irq(&ndlp->lock); 835 - ndlp->nlp_flag |= NLP_LOGO_ACC; 836 - spin_unlock_irq(&ndlp->lock); 838 + set_bit(NLP_LOGO_ACC, &ndlp->nlp_flag); 837 839 if (els_cmd == ELS_CMD_PRLO) 838 840 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL); 839 841 else ··· 884 890 */ 885 891 mod_timer(&ndlp->nlp_delayfunc, 886 892 jiffies + msecs_to_jiffies(1000)); 887 - spin_lock_irq(&ndlp->lock); 888 - ndlp->nlp_flag |= NLP_DELAY_TMO; 889 - spin_unlock_irq(&ndlp->lock); 893 + set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag); 890 894 ndlp->nlp_last_elscmd = ELS_CMD_FDISC; 891 895 vport->port_state = LPFC_FDISC; 892 896 } else { ··· 907 915 ndlp->nlp_state <= NLP_STE_PRLI_ISSUE)) { 908 916 mod_timer(&ndlp->nlp_delayfunc, 909 917 jiffies + msecs_to_jiffies(1000 * 1)); 910 - spin_lock_irq(&ndlp->lock); 911 - ndlp->nlp_flag |= NLP_DELAY_TMO; 912 - spin_unlock_irq(&ndlp->lock); 918 + set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag); 913 919 ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; 914 920 lpfc_printf_vlog(vport, KERN_INFO, 915 921 LOG_NODE | LOG_ELS | LOG_DISCOVERY, 916 922 "3204 Start nlpdelay on DID x%06x " 917 - "nflag x%x lastels x%x ref cnt %u", 923 + "nflag x%lx lastels x%x ref cnt %u", 918 924 ndlp->nlp_DID, ndlp->nlp_flag, 919 925 ndlp->nlp_last_elscmd, 920 926 kref_read(&ndlp->kref)); ··· 925 935 ndlp->nlp_prev_state = ndlp->nlp_state; 926 936 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); 927 937 928 - spin_lock_irq(&ndlp->lock); 929 - ndlp->nlp_flag &= ~NLP_NPR_ADISC; 930 - spin_unlock_irq(&ndlp->lock); 938 + clear_bit(NLP_NPR_ADISC, &ndlp->nlp_flag); 931 939 /* The driver has to wait until the ACC completes before it continues 932 940 * processing the LOGO. The action will resume in 933 941 * lpfc_cmpl_els_logo_acc routine. Since part of processing includes an ··· 966 978 out: 967 979 lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY, 968 980 "6115 Rcv PRLI (%x) check failed: ndlp rpi %d " 969 - "state x%x flags x%x port_type: x%x " 981 + "state x%x flags x%lx port_type: x%x " 970 982 "npr->initfcn: x%x npr->tgtfcn: x%x\n", 971 983 cmd, ndlp->nlp_rpi, ndlp->nlp_state, 972 984 ndlp->nlp_flag, vport->port_type, ··· 1008 1020 if (npr->prliType == PRLI_NVME_TYPE) 1009 1021 ndlp->nlp_type |= NLP_NVME_TARGET; 1010 1022 if (npr->writeXferRdyDis) 1011 - ndlp->nlp_flag |= NLP_FIRSTBURST; 1023 + set_bit(NLP_FIRSTBURST, &ndlp->nlp_flag); 1012 1024 } 1013 1025 if (npr->Retry && ndlp->nlp_type & 1014 1026 (NLP_FCP_INITIATOR | NLP_FCP_TARGET)) ··· 1045 1057 roles |= FC_RPORT_ROLE_FCP_TARGET; 1046 1058 1047 1059 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, 1048 - "rport rolechg: role:x%x did:x%x flg:x%x", 1060 + "rport rolechg: role:x%x did:x%x flg:x%lx", 1049 1061 roles, ndlp->nlp_DID, ndlp->nlp_flag); 1050 1062 1051 1063 if (vport->cfg_enable_fc4_type != LPFC_ENABLE_NVME) ··· 1056 1068 static uint32_t 1057 1069 lpfc_disc_set_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) 1058 1070 { 1059 - if (!(ndlp->nlp_flag & NLP_RPI_REGISTERED)) { 1060 - spin_lock_irq(&ndlp->lock); 1061 - ndlp->nlp_flag &= ~NLP_NPR_ADISC; 1062 - spin_unlock_irq(&ndlp->lock); 1071 + if (!test_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag)) { 1072 + clear_bit(NLP_NPR_ADISC, &ndlp->nlp_flag); 1063 1073 return 0; 1064 1074 } 1065 1075 ··· 1067 1081 (test_bit(FC_RSCN_MODE, &vport->fc_flag) || 1068 1082 ((ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) && 1069 1083 (ndlp->nlp_type & NLP_FCP_TARGET)))) { 1070 - spin_lock_irq(&ndlp->lock); 1071 - ndlp->nlp_flag |= NLP_NPR_ADISC; 1072 - spin_unlock_irq(&ndlp->lock); 1084 + set_bit(NLP_NPR_ADISC, &ndlp->nlp_flag); 1073 1085 return 1; 1074 1086 } 1075 1087 } 1076 1088 1077 - spin_lock_irq(&ndlp->lock); 1078 - ndlp->nlp_flag &= ~NLP_NPR_ADISC; 1079 - spin_unlock_irq(&ndlp->lock); 1089 + clear_bit(NLP_NPR_ADISC, &ndlp->nlp_flag); 1080 1090 lpfc_unreg_rpi(vport, ndlp); 1081 1091 return 0; 1082 1092 } ··· 1097 1115 /* If there is already an UNREG in progress for this ndlp, 1098 1116 * no need to queue up another one. 1099 1117 */ 1100 - if (ndlp->nlp_flag & NLP_UNREG_INP) { 1118 + if (test_bit(NLP_UNREG_INP, &ndlp->nlp_flag)) { 1101 1119 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 1102 1120 "1435 release_rpi SKIP UNREG x%x on " 1103 - "NPort x%x deferred x%x flg x%x " 1121 + "NPort x%x deferred x%x flg x%lx " 1104 1122 "Data: x%px\n", 1105 1123 ndlp->nlp_rpi, ndlp->nlp_DID, 1106 1124 ndlp->nlp_defer_did, ··· 1125 1143 1126 1144 if (((ndlp->nlp_DID & Fabric_DID_MASK) != Fabric_DID_MASK) && 1127 1145 (!test_bit(FC_OFFLINE_MODE, &vport->fc_flag))) 1128 - ndlp->nlp_flag |= NLP_UNREG_INP; 1146 + set_bit(NLP_UNREG_INP, &ndlp->nlp_flag); 1129 1147 1130 1148 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 1131 1149 "1437 release_rpi UNREG x%x " 1132 - "on NPort x%x flg x%x\n", 1150 + "on NPort x%x flg x%lx\n", 1133 1151 ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag); 1134 1152 1135 1153 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT); ··· 1157 1175 } 1158 1176 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 1159 1177 "0271 Illegal State Transition: node x%x " 1160 - "event x%x, state x%x Data: x%x x%x\n", 1178 + "event x%x, state x%x Data: x%x x%lx\n", 1161 1179 ndlp->nlp_DID, evt, ndlp->nlp_state, ndlp->nlp_rpi, 1162 1180 ndlp->nlp_flag); 1163 1181 return ndlp->nlp_state; ··· 1172 1190 * working on the same NPortID, do nothing for this thread 1173 1191 * to stop it. 1174 1192 */ 1175 - if (!(ndlp->nlp_flag & NLP_RCV_PLOGI)) { 1193 + if (!test_bit(NLP_RCV_PLOGI, &ndlp->nlp_flag)) 1176 1194 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 1177 1195 "0272 Illegal State Transition: node x%x " 1178 - "event x%x, state x%x Data: x%x x%x\n", 1196 + "event x%x, state x%x Data: x%x x%lx\n", 1179 1197 ndlp->nlp_DID, evt, ndlp->nlp_state, 1180 1198 ndlp->nlp_rpi, ndlp->nlp_flag); 1181 - } 1182 1199 return ndlp->nlp_state; 1183 1200 } 1184 1201 ··· 1211 1230 { 1212 1231 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; 1213 1232 1214 - spin_lock_irq(&ndlp->lock); 1215 - ndlp->nlp_flag |= NLP_LOGO_ACC; 1216 - spin_unlock_irq(&ndlp->lock); 1233 + set_bit(NLP_LOGO_ACC, &ndlp->nlp_flag); 1217 1234 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); 1218 1235 1219 1236 return ndlp->nlp_state; ··· 1269 1290 NULL); 1270 1291 } else { 1271 1292 if (lpfc_rcv_plogi(vport, ndlp, cmdiocb) && 1272 - (ndlp->nlp_flag & NLP_NPR_2B_DISC) && 1273 - (vport->num_disc_nodes)) { 1274 - spin_lock_irq(&ndlp->lock); 1275 - ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 1276 - spin_unlock_irq(&ndlp->lock); 1293 + test_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag) && 1294 + vport->num_disc_nodes) { 1295 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 1277 1296 /* Check if there are more PLOGIs to be sent */ 1278 1297 lpfc_more_plogi(vport); 1279 1298 if (vport->num_disc_nodes == 0) { ··· 1333 1356 1334 1357 /* Put ndlp in npr state set plogi timer for 1 sec */ 1335 1358 mod_timer(&ndlp->nlp_delayfunc, jiffies + msecs_to_jiffies(1000 * 1)); 1336 - spin_lock_irq(&ndlp->lock); 1337 - ndlp->nlp_flag |= NLP_DELAY_TMO; 1338 - spin_unlock_irq(&ndlp->lock); 1359 + set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag); 1339 1360 ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; 1340 1361 ndlp->nlp_prev_state = NLP_STE_PLOGI_ISSUE; 1341 1362 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); ··· 1364 1389 1365 1390 ulp_status = get_job_ulpstatus(phba, rspiocb); 1366 1391 1367 - if (ndlp->nlp_flag & NLP_ACC_REGLOGIN) { 1392 + if (test_bit(NLP_ACC_REGLOGIN, &ndlp->nlp_flag)) { 1368 1393 /* Recovery from PLOGI collision logic */ 1369 1394 return ndlp->nlp_state; 1370 1395 } ··· 1393 1418 goto out; 1394 1419 /* PLOGI chkparm OK */ 1395 1420 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 1396 - "0121 PLOGI chkparm OK Data: x%x x%x x%x x%x\n", 1421 + "0121 PLOGI chkparm OK Data: x%x x%x x%lx x%x\n", 1397 1422 ndlp->nlp_DID, ndlp->nlp_state, 1398 1423 ndlp->nlp_flag, ndlp->nlp_rpi); 1399 1424 if (vport->cfg_fcp_class == 2 && (sp->cls2.classValid)) ··· 1421 1446 ed_tov = (phba->fc_edtov + 999999) / 1000000; 1422 1447 } 1423 1448 1424 - ndlp->nlp_flag &= ~NLP_SUPPRESS_RSP; 1449 + clear_bit(NLP_SUPPRESS_RSP, &ndlp->nlp_flag); 1425 1450 if ((phba->sli.sli_flag & LPFC_SLI_SUPPRESS_RSP) && 1426 1451 sp->cmn.valid_vendor_ver_level) { 1427 1452 vid = be32_to_cpu(sp->un.vv.vid); 1428 1453 flag = be32_to_cpu(sp->un.vv.flags); 1429 1454 if ((vid == LPFC_VV_EMLX_ID) && 1430 1455 (flag & LPFC_VV_SUPPRESS_RSP)) 1431 - ndlp->nlp_flag |= NLP_SUPPRESS_RSP; 1456 + set_bit(NLP_SUPPRESS_RSP, &ndlp->nlp_flag); 1432 1457 } 1433 1458 1434 1459 /* ··· 1451 1476 LOG_TRACE_EVENT, 1452 1477 "0133 PLOGI: no memory " 1453 1478 "for config_link " 1454 - "Data: x%x x%x x%x x%x\n", 1479 + "Data: x%x x%x x%lx x%x\n", 1455 1480 ndlp->nlp_DID, ndlp->nlp_state, 1456 1481 ndlp->nlp_flag, ndlp->nlp_rpi); 1457 1482 goto out; ··· 1475 1500 if (!mbox) { 1476 1501 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 1477 1502 "0018 PLOGI: no memory for reg_login " 1478 - "Data: x%x x%x x%x x%x\n", 1503 + "Data: x%x x%x x%lx x%x\n", 1479 1504 ndlp->nlp_DID, ndlp->nlp_state, 1480 1505 ndlp->nlp_flag, ndlp->nlp_rpi); 1481 1506 goto out; ··· 1495 1520 mbox->mbox_cmpl = lpfc_mbx_cmpl_fdmi_reg_login; 1496 1521 break; 1497 1522 default: 1498 - ndlp->nlp_flag |= NLP_REG_LOGIN_SEND; 1523 + set_bit(NLP_REG_LOGIN_SEND, &ndlp->nlp_flag); 1499 1524 mbox->mbox_cmpl = lpfc_mbx_cmpl_reg_login; 1500 1525 } 1501 1526 ··· 1510 1535 NLP_STE_REG_LOGIN_ISSUE); 1511 1536 return ndlp->nlp_state; 1512 1537 } 1513 - if (ndlp->nlp_flag & NLP_REG_LOGIN_SEND) 1514 - ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; 1538 + clear_bit(NLP_REG_LOGIN_SEND, &ndlp->nlp_flag); 1515 1539 /* decrement node reference count to the failed mbox 1516 1540 * command 1517 1541 */ ··· 1518 1544 lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED); 1519 1545 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 1520 1546 "0134 PLOGI: cannot issue reg_login " 1521 - "Data: x%x x%x x%x x%x\n", 1547 + "Data: x%x x%x x%lx x%x\n", 1522 1548 ndlp->nlp_DID, ndlp->nlp_state, 1523 1549 ndlp->nlp_flag, ndlp->nlp_rpi); 1524 1550 } else { ··· 1526 1552 1527 1553 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 1528 1554 "0135 PLOGI: cannot format reg_login " 1529 - "Data: x%x x%x x%x x%x\n", 1555 + "Data: x%x x%x x%lx x%x\n", 1530 1556 ndlp->nlp_DID, ndlp->nlp_state, 1531 1557 ndlp->nlp_flag, ndlp->nlp_rpi); 1532 1558 } ··· 1579 1605 lpfc_device_rm_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, 1580 1606 void *arg, uint32_t evt) 1581 1607 { 1582 - if (ndlp->nlp_flag & NLP_NPR_2B_DISC) { 1583 - spin_lock_irq(&ndlp->lock); 1584 - ndlp->nlp_flag |= NLP_NODEV_REMOVE; 1585 - spin_unlock_irq(&ndlp->lock); 1608 + if (test_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag)) { 1609 + set_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 1586 1610 return ndlp->nlp_state; 1587 - } else { 1588 - /* software abort outstanding PLOGI */ 1589 - lpfc_els_abort(vport->phba, ndlp); 1590 - 1591 - lpfc_drop_node(vport, ndlp); 1592 - return NLP_STE_FREED_NODE; 1593 1611 } 1612 + /* software abort outstanding PLOGI */ 1613 + lpfc_els_abort(vport->phba, ndlp); 1614 + 1615 + lpfc_drop_node(vport, ndlp); 1616 + return NLP_STE_FREED_NODE; 1594 1617 } 1595 1618 1596 1619 static uint32_t ··· 1607 1636 1608 1637 ndlp->nlp_prev_state = NLP_STE_PLOGI_ISSUE; 1609 1638 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); 1610 - spin_lock_irq(&ndlp->lock); 1611 - ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); 1612 - spin_unlock_irq(&ndlp->lock); 1639 + clear_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 1640 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 1613 1641 1614 1642 return ndlp->nlp_state; 1615 1643 } ··· 1626 1656 cmdiocb = (struct lpfc_iocbq *) arg; 1627 1657 1628 1658 if (lpfc_rcv_plogi(vport, ndlp, cmdiocb)) { 1629 - if (ndlp->nlp_flag & NLP_NPR_2B_DISC) { 1630 - spin_lock_irq(&ndlp->lock); 1631 - ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; 1632 - spin_unlock_irq(&ndlp->lock); 1659 + if (test_and_clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag)) { 1633 1660 if (vport->num_disc_nodes) 1634 1661 lpfc_more_adisc(vport); 1635 1662 } ··· 1715 1748 /* 1 sec timeout */ 1716 1749 mod_timer(&ndlp->nlp_delayfunc, 1717 1750 jiffies + msecs_to_jiffies(1000)); 1718 - spin_lock_irq(&ndlp->lock); 1719 - ndlp->nlp_flag |= NLP_DELAY_TMO; 1720 - spin_unlock_irq(&ndlp->lock); 1751 + set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag); 1721 1752 ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; 1722 1753 1723 1754 ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; ··· 1754 1789 lpfc_device_rm_adisc_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, 1755 1790 void *arg, uint32_t evt) 1756 1791 { 1757 - if (ndlp->nlp_flag & NLP_NPR_2B_DISC) { 1758 - spin_lock_irq(&ndlp->lock); 1759 - ndlp->nlp_flag |= NLP_NODEV_REMOVE; 1760 - spin_unlock_irq(&ndlp->lock); 1792 + if (test_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag)) { 1793 + set_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 1761 1794 return ndlp->nlp_state; 1762 - } else { 1763 - /* software abort outstanding ADISC */ 1764 - lpfc_els_abort(vport->phba, ndlp); 1765 - 1766 - lpfc_drop_node(vport, ndlp); 1767 - return NLP_STE_FREED_NODE; 1768 1795 } 1796 + /* software abort outstanding ADISC */ 1797 + lpfc_els_abort(vport->phba, ndlp); 1798 + 1799 + lpfc_drop_node(vport, ndlp); 1800 + return NLP_STE_FREED_NODE; 1769 1801 } 1770 1802 1771 1803 static uint32_t ··· 1782 1820 1783 1821 ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; 1784 1822 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); 1785 - spin_lock_irq(&ndlp->lock); 1786 - ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); 1787 - spin_unlock_irq(&ndlp->lock); 1823 + clear_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 1824 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 1788 1825 lpfc_disc_set_adisc(vport, ndlp); 1789 1826 return ndlp->nlp_state; 1790 1827 } ··· 1817 1856 * transition to UNMAPPED provided the RPI has completed 1818 1857 * registration. 1819 1858 */ 1820 - if (ndlp->nlp_flag & NLP_RPI_REGISTERED) { 1859 + if (test_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag)) { 1821 1860 lpfc_rcv_prli(vport, ndlp, cmdiocb); 1822 1861 lpfc_els_rsp_prli_acc(vport, cmdiocb, ndlp); 1823 1862 } else { ··· 1856 1895 if ((mb = phba->sli.mbox_active)) { 1857 1896 if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && 1858 1897 (ndlp == mb->ctx_ndlp)) { 1859 - ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; 1898 + clear_bit(NLP_REG_LOGIN_SEND, &ndlp->nlp_flag); 1860 1899 lpfc_nlp_put(ndlp); 1861 1900 mb->ctx_ndlp = NULL; 1862 1901 mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; ··· 1867 1906 list_for_each_entry_safe(mb, nextmb, &phba->sli.mboxq, list) { 1868 1907 if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && 1869 1908 (ndlp == mb->ctx_ndlp)) { 1870 - ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; 1909 + clear_bit(NLP_REG_LOGIN_SEND, &ndlp->nlp_flag); 1871 1910 lpfc_nlp_put(ndlp); 1872 1911 list_del(&mb->list); 1873 1912 phba->sli.mboxq_cnt--; ··· 1937 1976 /* Put ndlp in npr state set plogi timer for 1 sec */ 1938 1977 mod_timer(&ndlp->nlp_delayfunc, 1939 1978 jiffies + msecs_to_jiffies(1000 * 1)); 1940 - spin_lock_irq(&ndlp->lock); 1941 - ndlp->nlp_flag |= NLP_DELAY_TMO; 1942 - spin_unlock_irq(&ndlp->lock); 1979 + set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag); 1943 1980 ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; 1944 1981 1945 1982 lpfc_issue_els_logo(vport, ndlp, 0); ··· 1948 1989 if (phba->sli_rev < LPFC_SLI_REV4) 1949 1990 ndlp->nlp_rpi = mb->un.varWords[0]; 1950 1991 1951 - ndlp->nlp_flag |= NLP_RPI_REGISTERED; 1992 + set_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag); 1952 1993 1953 1994 /* Only if we are not a fabric nport do we issue PRLI */ 1954 1995 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, ··· 2020 2061 void *arg, 2021 2062 uint32_t evt) 2022 2063 { 2023 - if (ndlp->nlp_flag & NLP_NPR_2B_DISC) { 2024 - spin_lock_irq(&ndlp->lock); 2025 - ndlp->nlp_flag |= NLP_NODEV_REMOVE; 2026 - spin_unlock_irq(&ndlp->lock); 2064 + if (test_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag)) { 2065 + set_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 2027 2066 return ndlp->nlp_state; 2028 - } else { 2029 - lpfc_drop_node(vport, ndlp); 2030 - return NLP_STE_FREED_NODE; 2031 2067 } 2068 + lpfc_drop_node(vport, ndlp); 2069 + return NLP_STE_FREED_NODE; 2032 2070 } 2033 2071 2034 2072 static uint32_t ··· 2040 2084 2041 2085 ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE; 2042 2086 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); 2043 - spin_lock_irq(&ndlp->lock); 2044 2087 2045 2088 /* If we are a target we won't immediately transition into PRLI, 2046 2089 * so if REG_LOGIN already completed we don't need to ignore it. 2047 2090 */ 2048 - if (!(ndlp->nlp_flag & NLP_RPI_REGISTERED) || 2091 + if (!test_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag) || 2049 2092 !vport->phba->nvmet_support) 2050 - ndlp->nlp_flag |= NLP_IGNR_REG_CMPL; 2093 + set_bit(NLP_IGNR_REG_CMPL, &ndlp->nlp_flag); 2051 2094 2052 - ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); 2053 - spin_unlock_irq(&ndlp->lock); 2095 + clear_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 2096 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2054 2097 lpfc_disc_set_adisc(vport, ndlp); 2055 2098 return ndlp->nlp_state; 2056 2099 } ··· 2183 2228 if (npr->targetFunc) { 2184 2229 ndlp->nlp_type |= NLP_FCP_TARGET; 2185 2230 if (npr->writeXferRdyDis) 2186 - ndlp->nlp_flag |= NLP_FIRSTBURST; 2231 + set_bit(NLP_FIRSTBURST, 2232 + &ndlp->nlp_flag); 2187 2233 } 2188 2234 if (npr->Retry) 2189 2235 ndlp->nlp_fcp_info |= NLP_FCP_2_DEVICE; ··· 2228 2272 /* Both sides support FB. The target's first 2229 2273 * burst size is a 512 byte encoded value. 2230 2274 */ 2231 - ndlp->nlp_flag |= NLP_FIRSTBURST; 2275 + set_bit(NLP_FIRSTBURST, &ndlp->nlp_flag); 2232 2276 ndlp->nvme_fb_size = bf_get_be32(prli_fb_sz, 2233 2277 nvpr); 2234 2278 ··· 2243 2287 2244 2288 lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_DISC, 2245 2289 "6029 NVME PRLI Cmpl w1 x%08x " 2246 - "w4 x%08x w5 x%08x flag x%x, " 2290 + "w4 x%08x w5 x%08x flag x%lx, " 2247 2291 "fcp_info x%x nlp_type x%x\n", 2248 2292 be32_to_cpu(nvpr->word1), 2249 2293 be32_to_cpu(nvpr->word4), ··· 2255 2299 (vport->port_type == LPFC_NPIV_PORT) && 2256 2300 vport->cfg_restrict_login) { 2257 2301 out: 2258 - spin_lock_irq(&ndlp->lock); 2259 - ndlp->nlp_flag |= NLP_TARGET_REMOVE; 2260 - spin_unlock_irq(&ndlp->lock); 2302 + set_bit(NLP_TARGET_REMOVE, &ndlp->nlp_flag); 2261 2303 lpfc_issue_els_logo(vport, ndlp, 0); 2262 2304 2263 2305 ndlp->nlp_prev_state = NLP_STE_PRLI_ISSUE; ··· 2307 2353 lpfc_device_rm_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, 2308 2354 void *arg, uint32_t evt) 2309 2355 { 2310 - if (ndlp->nlp_flag & NLP_NPR_2B_DISC) { 2311 - spin_lock_irq(&ndlp->lock); 2312 - ndlp->nlp_flag |= NLP_NODEV_REMOVE; 2313 - spin_unlock_irq(&ndlp->lock); 2356 + if (test_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag)) { 2357 + set_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 2314 2358 return ndlp->nlp_state; 2315 - } else { 2316 - /* software abort outstanding PLOGI */ 2317 - lpfc_els_abort(vport->phba, ndlp); 2318 - 2319 - lpfc_drop_node(vport, ndlp); 2320 - return NLP_STE_FREED_NODE; 2321 2359 } 2360 + /* software abort outstanding PLOGI */ 2361 + lpfc_els_abort(vport->phba, ndlp); 2362 + 2363 + lpfc_drop_node(vport, ndlp); 2364 + return NLP_STE_FREED_NODE; 2322 2365 } 2323 2366 2324 2367 ··· 2352 2401 2353 2402 ndlp->nlp_prev_state = NLP_STE_PRLI_ISSUE; 2354 2403 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); 2355 - spin_lock_irq(&ndlp->lock); 2356 - ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); 2357 - spin_unlock_irq(&ndlp->lock); 2404 + clear_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 2405 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2358 2406 lpfc_disc_set_adisc(vport, ndlp); 2359 2407 return ndlp->nlp_state; 2360 2408 } ··· 2392 2442 { 2393 2443 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *)arg; 2394 2444 2395 - spin_lock_irq(&ndlp->lock); 2396 - ndlp->nlp_flag |= NLP_LOGO_ACC; 2397 - spin_unlock_irq(&ndlp->lock); 2445 + set_bit(NLP_LOGO_ACC, &ndlp->nlp_flag); 2398 2446 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); 2399 2447 return ndlp->nlp_state; 2400 2448 } ··· 2431 2483 { 2432 2484 ndlp->nlp_prev_state = NLP_STE_LOGO_ISSUE; 2433 2485 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); 2434 - spin_lock_irq(&ndlp->lock); 2435 - ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); 2436 - spin_unlock_irq(&ndlp->lock); 2486 + clear_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 2487 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2437 2488 lpfc_disc_set_adisc(vport, ndlp); 2438 2489 return ndlp->nlp_state; 2439 2490 } ··· 2538 2591 { 2539 2592 ndlp->nlp_prev_state = NLP_STE_UNMAPPED_NODE; 2540 2593 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); 2594 + clear_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 2595 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2541 2596 spin_lock_irq(&ndlp->lock); 2542 - ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); 2543 2597 ndlp->nlp_fc4_type &= ~(NLP_FC4_FCP | NLP_FC4_NVME); 2544 2598 spin_unlock_irq(&ndlp->lock); 2545 2599 lpfc_disc_set_adisc(vport, ndlp); ··· 2601 2653 lpfc_sli_abort_iocb(vport, ndlp->nlp_sid, 0, LPFC_CTX_TGT); 2602 2654 2603 2655 /* Send PRLO_ACC */ 2604 - spin_lock_irq(&ndlp->lock); 2605 - ndlp->nlp_flag |= NLP_LOGO_ACC; 2606 - spin_unlock_irq(&ndlp->lock); 2656 + set_bit(NLP_LOGO_ACC, &ndlp->nlp_flag); 2607 2657 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL); 2608 2658 2609 2659 /* Save ELS_CMD_PRLO as the last elscmd and then set to NPR. ··· 2611 2665 ndlp->nlp_prev_state = ndlp->nlp_state; 2612 2666 2613 2667 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE | LOG_ELS | LOG_DISCOVERY, 2614 - "3422 DID x%06x nflag x%x lastels x%x ref cnt %u\n", 2668 + "3422 DID x%06x nflag x%lx lastels x%x ref cnt %u\n", 2615 2669 ndlp->nlp_DID, ndlp->nlp_flag, 2616 2670 ndlp->nlp_last_elscmd, 2617 2671 kref_read(&ndlp->kref)); ··· 2631 2685 2632 2686 ndlp->nlp_prev_state = NLP_STE_MAPPED_NODE; 2633 2687 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); 2688 + clear_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 2689 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2634 2690 spin_lock_irq(&ndlp->lock); 2635 - ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); 2636 2691 ndlp->nlp_fc4_type &= ~(NLP_FC4_FCP | NLP_FC4_NVME); 2637 2692 spin_unlock_irq(&ndlp->lock); 2638 2693 return ndlp->nlp_state; ··· 2646 2699 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; 2647 2700 2648 2701 /* Ignore PLOGI if we have an outstanding LOGO */ 2649 - if (ndlp->nlp_flag & (NLP_LOGO_SND | NLP_LOGO_ACC)) 2702 + if (test_bit(NLP_LOGO_SND, &ndlp->nlp_flag) || 2703 + test_bit(NLP_LOGO_ACC, &ndlp->nlp_flag)) 2650 2704 return ndlp->nlp_state; 2651 2705 if (lpfc_rcv_plogi(vport, ndlp, cmdiocb)) { 2652 2706 lpfc_cancel_retry_delay_tmo(vport, ndlp); 2653 - spin_lock_irq(&ndlp->lock); 2654 - ndlp->nlp_flag &= ~(NLP_NPR_ADISC | NLP_NPR_2B_DISC); 2655 - spin_unlock_irq(&ndlp->lock); 2656 - } else if (!(ndlp->nlp_flag & NLP_NPR_2B_DISC)) { 2707 + clear_bit(NLP_NPR_ADISC, &ndlp->nlp_flag); 2708 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2709 + } else if (!test_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag)) { 2657 2710 /* send PLOGI immediately, move to PLOGI issue state */ 2658 - if (!(ndlp->nlp_flag & NLP_DELAY_TMO)) { 2711 + if (!test_bit(NLP_DELAY_TMO, &ndlp->nlp_flag)) { 2659 2712 ndlp->nlp_prev_state = NLP_STE_NPR_NODE; 2660 2713 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); 2661 2714 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); ··· 2676 2729 stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE; 2677 2730 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); 2678 2731 2679 - if (!(ndlp->nlp_flag & NLP_DELAY_TMO)) { 2732 + if (!test_bit(NLP_DELAY_TMO, &ndlp->nlp_flag)) { 2680 2733 /* 2681 2734 * ADISC nodes will be handled in regular discovery path after 2682 2735 * receiving response from NS. 2683 2736 * 2684 2737 * For other nodes, Send PLOGI to trigger an implicit LOGO. 2685 2738 */ 2686 - if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) { 2739 + if (!test_bit(NLP_NPR_ADISC, &ndlp->nlp_flag)) { 2687 2740 ndlp->nlp_prev_state = NLP_STE_NPR_NODE; 2688 2741 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); 2689 2742 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); ··· 2714 2767 * or discovery in progress for this node. Starting discovery 2715 2768 * here will affect the counting of discovery threads. 2716 2769 */ 2717 - if (!(ndlp->nlp_flag & NLP_DELAY_TMO) && 2718 - !(ndlp->nlp_flag & NLP_NPR_2B_DISC)) { 2770 + if (!test_bit(NLP_DELAY_TMO, &ndlp->nlp_flag) && 2771 + !test_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag)) { 2719 2772 /* 2720 2773 * ADISC nodes will be handled in regular discovery path after 2721 2774 * receiving response from NS. 2722 2775 * 2723 2776 * For other nodes, Send PLOGI to trigger an implicit LOGO. 2724 2777 */ 2725 - if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) { 2778 + if (!test_bit(NLP_NPR_ADISC, &ndlp->nlp_flag)) { 2726 2779 ndlp->nlp_prev_state = NLP_STE_NPR_NODE; 2727 2780 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); 2728 2781 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); ··· 2737 2790 { 2738 2791 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; 2739 2792 2740 - spin_lock_irq(&ndlp->lock); 2741 - ndlp->nlp_flag |= NLP_LOGO_ACC; 2742 - spin_unlock_irq(&ndlp->lock); 2793 + set_bit(NLP_LOGO_ACC, &ndlp->nlp_flag); 2743 2794 2744 2795 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); 2745 2796 2746 - if ((ndlp->nlp_flag & NLP_DELAY_TMO) == 0) { 2797 + if (!test_bit(NLP_DELAY_TMO, &ndlp->nlp_flag)) { 2747 2798 mod_timer(&ndlp->nlp_delayfunc, 2748 2799 jiffies + msecs_to_jiffies(1000 * 1)); 2749 - spin_lock_irq(&ndlp->lock); 2750 - ndlp->nlp_flag |= NLP_DELAY_TMO; 2751 - ndlp->nlp_flag &= ~NLP_NPR_ADISC; 2752 - spin_unlock_irq(&ndlp->lock); 2800 + set_bit(NLP_DELAY_TMO, &ndlp->nlp_flag); 2801 + clear_bit(NLP_NPR_ADISC, &ndlp->nlp_flag); 2753 2802 ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; 2754 2803 } else { 2755 - spin_lock_irq(&ndlp->lock); 2756 - ndlp->nlp_flag &= ~NLP_NPR_ADISC; 2757 - spin_unlock_irq(&ndlp->lock); 2804 + clear_bit(NLP_NPR_ADISC, &ndlp->nlp_flag); 2758 2805 } 2759 2806 return ndlp->nlp_state; 2760 2807 } ··· 2785 2844 2786 2845 ulp_status = get_job_ulpstatus(phba, rspiocb); 2787 2846 2788 - if (ulp_status && (ndlp->nlp_flag & NLP_NODEV_REMOVE)) { 2847 + if (ulp_status && test_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag)) { 2789 2848 lpfc_drop_node(vport, ndlp); 2790 2849 return NLP_STE_FREED_NODE; 2791 2850 } ··· 2818 2877 2819 2878 ulp_status = get_job_ulpstatus(phba, rspiocb); 2820 2879 2821 - if (ulp_status && (ndlp->nlp_flag & NLP_NODEV_REMOVE)) { 2880 + if (ulp_status && test_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag)) { 2822 2881 lpfc_drop_node(vport, ndlp); 2823 2882 return NLP_STE_FREED_NODE; 2824 2883 } ··· 2837 2896 /* SLI4 ports have preallocated logical rpis. */ 2838 2897 if (vport->phba->sli_rev < LPFC_SLI_REV4) 2839 2898 ndlp->nlp_rpi = mb->un.varWords[0]; 2840 - ndlp->nlp_flag |= NLP_RPI_REGISTERED; 2841 - if (ndlp->nlp_flag & NLP_LOGO_ACC) { 2899 + set_bit(NLP_RPI_REGISTERED, &ndlp->nlp_flag); 2900 + if (test_bit(NLP_LOGO_ACC, &ndlp->nlp_flag)) 2842 2901 lpfc_unreg_rpi(vport, ndlp); 2843 - } 2844 2902 } else { 2845 - if (ndlp->nlp_flag & NLP_NODEV_REMOVE) { 2903 + if (test_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag)) { 2846 2904 lpfc_drop_node(vport, ndlp); 2847 2905 return NLP_STE_FREED_NODE; 2848 2906 } ··· 2853 2913 lpfc_device_rm_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, 2854 2914 void *arg, uint32_t evt) 2855 2915 { 2856 - if (ndlp->nlp_flag & NLP_NPR_2B_DISC) { 2857 - spin_lock_irq(&ndlp->lock); 2858 - ndlp->nlp_flag |= NLP_NODEV_REMOVE; 2859 - spin_unlock_irq(&ndlp->lock); 2916 + if (test_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag)) { 2917 + set_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 2860 2918 return ndlp->nlp_state; 2861 2919 } 2862 2920 lpfc_drop_node(vport, ndlp); ··· 2870 2932 return ndlp->nlp_state; 2871 2933 2872 2934 lpfc_cancel_retry_delay_tmo(vport, ndlp); 2935 + clear_bit(NLP_NODEV_REMOVE, &ndlp->nlp_flag); 2936 + clear_bit(NLP_NPR_2B_DISC, &ndlp->nlp_flag); 2873 2937 spin_lock_irq(&ndlp->lock); 2874 - ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); 2875 2938 ndlp->nlp_fc4_type &= ~(NLP_FC4_FCP | NLP_FC4_NVME); 2876 2939 spin_unlock_irq(&ndlp->lock); 2877 2940 return ndlp->nlp_state; ··· 3085 3146 /* DSM in event <evt> on NPort <nlp_DID> in state <cur_state> */ 3086 3147 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 3087 3148 "0211 DSM in event x%x on NPort x%x in " 3088 - "state %d rpi x%x Data: x%x x%x\n", 3149 + "state %d rpi x%x Data: x%lx x%x\n", 3089 3150 evt, ndlp->nlp_DID, cur_state, ndlp->nlp_rpi, 3090 3151 ndlp->nlp_flag, data1); 3091 3152 ··· 3102 3163 ((uint32_t)ndlp->nlp_type)); 3103 3164 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, 3104 3165 "0212 DSM out state %d on NPort x%x " 3105 - "rpi x%x Data: x%x x%x\n", 3166 + "rpi x%x Data: x%lx x%x\n", 3106 3167 rc, ndlp->nlp_DID, ndlp->nlp_rpi, ndlp->nlp_flag, 3107 3168 data1); 3108 3169 3109 3170 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM, 3110 - "DSM out: ste:%d did:x%x flg:x%x", 3171 + "DSM out: ste:%d did:x%x flg:x%lx", 3111 3172 rc, ndlp->nlp_DID, ndlp->nlp_flag); 3112 3173 /* Decrement the ndlp reference count held for this function */ 3113 3174 lpfc_nlp_put(ndlp);
+52 -8
drivers/scsi/lpfc/lpfc_nvme.c
··· 1232 1232 1233 1233 /* Word 5 */ 1234 1234 if ((phba->cfg_nvme_enable_fb) && 1235 - (pnode->nlp_flag & NLP_FIRSTBURST)) { 1235 + test_bit(NLP_FIRSTBURST, &pnode->nlp_flag)) { 1236 1236 req_len = lpfc_ncmd->nvmeCmd->payload_length; 1237 1237 if (req_len < pnode->nvme_fb_size) 1238 1238 wqe->fcp_iwrite.initial_xfer_len = ··· 2231 2231 struct lpfc_hba *phba = vport->phba; 2232 2232 struct lpfc_sli4_hdw_queue *qp; 2233 2233 int abts_scsi, abts_nvme; 2234 + u16 nvmels_cnt; 2234 2235 2235 2236 /* Host transport has to clean up and confirm requiring an indefinite 2236 2237 * wait. Print a message if a 10 second wait expires and renew the ··· 2244 2243 pending = 0; 2245 2244 abts_scsi = 0; 2246 2245 abts_nvme = 0; 2246 + nvmels_cnt = 0; 2247 2247 for (i = 0; i < phba->cfg_hdw_queue; i++) { 2248 2248 qp = &phba->sli4_hba.hdwq[i]; 2249 2249 if (!vport->localport || !qp || !qp->io_wq) ··· 2257 2255 abts_scsi += qp->abts_scsi_io_bufs; 2258 2256 abts_nvme += qp->abts_nvme_io_bufs; 2259 2257 } 2258 + if (phba->sli4_hba.nvmels_wq) { 2259 + pring = phba->sli4_hba.nvmels_wq->pring; 2260 + if (pring) 2261 + nvmels_cnt = pring->txcmplq_cnt; 2262 + } 2260 2263 if (!vport->localport || 2261 2264 test_bit(HBA_PCI_ERR, &vport->phba->bit_flags) || 2262 2265 phba->link_state == LPFC_HBA_ERROR || ··· 2270 2263 2271 2264 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 2272 2265 "6176 Lport x%px Localport x%px wait " 2273 - "timed out. Pending %d [%d:%d]. " 2266 + "timed out. Pending %d [%d:%d:%d]. " 2274 2267 "Renewing.\n", 2275 2268 lport, vport->localport, pending, 2276 - abts_scsi, abts_nvme); 2269 + abts_scsi, abts_nvme, nvmels_cnt); 2277 2270 continue; 2278 2271 } 2279 2272 break; ··· 2651 2644 * reference. Check if another thread has set 2652 2645 * NLP_DROPPED. 2653 2646 */ 2654 - spin_lock_irq(&ndlp->lock); 2655 - if (!(ndlp->nlp_flag & NLP_DROPPED)) { 2656 - ndlp->nlp_flag |= NLP_DROPPED; 2657 - spin_unlock_irq(&ndlp->lock); 2647 + if (!test_and_set_bit(NLP_DROPPED, 2648 + &ndlp->nlp_flag)) { 2658 2649 lpfc_nlp_put(ndlp); 2659 2650 return; 2660 2651 } 2661 - spin_unlock_irq(&ndlp->lock); 2662 2652 } 2663 2653 } 2664 2654 } ··· 2843 2839 2844 2840 memcpy(&pwqeIn->wcqe_cmpl, wcqep, sizeof(*wcqep)); 2845 2841 (pwqeIn->cmd_cmpl)(phba, pwqeIn, pwqeIn); 2842 + #endif 2843 + } 2844 + 2845 + /** 2846 + * lpfc_nvmels_flush_cmd - Clean up outstanding nvmels commands for a port 2847 + * @phba: Pointer to HBA context object. 2848 + * 2849 + **/ 2850 + void 2851 + lpfc_nvmels_flush_cmd(struct lpfc_hba *phba) 2852 + { 2853 + #if (IS_ENABLED(CONFIG_NVME_FC)) 2854 + LIST_HEAD(cancel_list); 2855 + struct lpfc_sli_ring *pring = NULL; 2856 + struct lpfc_iocbq *piocb, *tmp_iocb; 2857 + unsigned long iflags; 2858 + 2859 + if (phba->sli4_hba.nvmels_wq) 2860 + pring = phba->sli4_hba.nvmels_wq->pring; 2861 + 2862 + if (unlikely(!pring)) 2863 + return; 2864 + 2865 + spin_lock_irqsave(&phba->hbalock, iflags); 2866 + spin_lock(&pring->ring_lock); 2867 + list_splice_init(&pring->txq, &cancel_list); 2868 + pring->txq_cnt = 0; 2869 + list_for_each_entry_safe(piocb, tmp_iocb, &pring->txcmplq, list) { 2870 + if (piocb->cmd_flag & LPFC_IO_NVME_LS) { 2871 + list_move_tail(&piocb->list, &cancel_list); 2872 + pring->txcmplq_cnt--; 2873 + piocb->cmd_flag &= ~LPFC_IO_ON_TXCMPLQ; 2874 + } 2875 + } 2876 + spin_unlock(&pring->ring_lock); 2877 + spin_unlock_irqrestore(&phba->hbalock, iflags); 2878 + 2879 + if (!list_empty(&cancel_list)) 2880 + lpfc_sli_cancel_iocbs(phba, &cancel_list, IOSTAT_LOCAL_REJECT, 2881 + IOERR_SLI_DOWN); 2846 2882 #endif 2847 2883 }
+1 -1
drivers/scsi/lpfc/lpfc_nvmet.c
··· 2854 2854 /* In template ar=1 wqes=0 sup=0 irsp=0 irsplen=0 */ 2855 2855 2856 2856 if (rsp->rsplen == LPFC_NVMET_SUCCESS_LEN) { 2857 - if (ndlp->nlp_flag & NLP_SUPPRESS_RSP) 2857 + if (test_bit(NLP_SUPPRESS_RSP, &ndlp->nlp_flag)) 2858 2858 bf_set(wqe_sup, 2859 2859 &wqe->fcp_tsend.wqe_com, 1); 2860 2860 } else {
+4 -4
drivers/scsi/lpfc/lpfc_scsi.c
··· 4629 4629 iocb_cmd->ulpCommand = CMD_FCP_IWRITE64_CR; 4630 4630 iocb_cmd->ulpPU = PARM_READ_CHECK; 4631 4631 if (vport->cfg_first_burst_size && 4632 - (pnode->nlp_flag & NLP_FIRSTBURST)) { 4632 + test_bit(NLP_FIRSTBURST, &pnode->nlp_flag)) { 4633 4633 u32 xrdy_len; 4634 4634 4635 4635 fcpdl = scsi_bufflen(scsi_cmnd); ··· 5829 5829 5830 5830 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP, 5831 5831 "0702 Issue %s to TGT %d LUN %llu " 5832 - "rpi x%x nlp_flag x%x Data: x%x x%x\n", 5832 + "rpi x%x nlp_flag x%lx Data: x%x x%x\n", 5833 5833 lpfc_taskmgmt_name(task_mgmt_cmd), tgt_id, lun_id, 5834 5834 pnode->nlp_rpi, pnode->nlp_flag, iocbq->sli4_xritag, 5835 5835 iocbq->cmd_flag); ··· 6094 6094 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, 6095 6095 "0722 Target Reset rport failure: rdata x%px\n", rdata); 6096 6096 if (pnode) { 6097 + clear_bit(NLP_NPR_ADISC, &pnode->nlp_flag); 6097 6098 spin_lock_irqsave(&pnode->lock, flags); 6098 - pnode->nlp_flag &= ~NLP_NPR_ADISC; 6099 6099 pnode->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; 6100 6100 spin_unlock_irqrestore(&pnode->lock, flags); 6101 6101 } ··· 6124 6124 !pnode->logo_waitq) { 6125 6125 pnode->logo_waitq = &waitq; 6126 6126 pnode->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; 6127 - pnode->nlp_flag |= NLP_ISSUE_LOGO; 6127 + set_bit(NLP_ISSUE_LOGO, &pnode->nlp_flag); 6128 6128 pnode->save_flags |= NLP_WAIT_FOR_LOGO; 6129 6129 spin_unlock_irqrestore(&pnode->lock, flags); 6130 6130 lpfc_unreg_rpi(vport, pnode);
+66 -59
drivers/scsi/lpfc/lpfc_sli.c
··· 1932 1932 union lpfc_wqe128 *wqe; 1933 1933 struct lpfc_iocbq *sync_buf; 1934 1934 unsigned long iflags; 1935 - u32 ret_val; 1935 + u32 ret_val, cgn_sig_freq; 1936 1936 u32 atot, wtot, max; 1937 1937 u8 warn_sync_period = 0; 1938 1938 ··· 1987 1987 } else if (wtot) { 1988 1988 if (phba->cgn_reg_signal == EDC_CG_SIG_WARN_ONLY || 1989 1989 phba->cgn_reg_signal == EDC_CG_SIG_WARN_ALARM) { 1990 + cgn_sig_freq = phba->cgn_sig_freq ? phba->cgn_sig_freq : 1991 + lpfc_fabric_cgn_frequency; 1990 1992 /* We hit an Signal warning condition */ 1991 - max = LPFC_SEC_TO_MSEC / lpfc_fabric_cgn_frequency * 1993 + max = LPFC_SEC_TO_MSEC / cgn_sig_freq * 1992 1994 lpfc_acqe_cgn_frequency; 1993 1995 bf_set(cmf_sync_wsigmax, &wqe->cmf_sync, max); 1994 1996 bf_set(cmf_sync_wsigcnt, &wqe->cmf_sync, wtot); ··· 2844 2842 return; 2845 2843 } 2846 2844 2847 - static void 2848 - __lpfc_sli_rpi_release(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) 2849 - { 2850 - unsigned long iflags; 2851 - 2852 - if (ndlp->nlp_flag & NLP_RELEASE_RPI) { 2853 - lpfc_sli4_free_rpi(vport->phba, ndlp->nlp_rpi); 2854 - spin_lock_irqsave(&ndlp->lock, iflags); 2855 - ndlp->nlp_flag &= ~NLP_RELEASE_RPI; 2856 - ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR; 2857 - spin_unlock_irqrestore(&ndlp->lock, iflags); 2858 - } 2859 - ndlp->nlp_flag &= ~NLP_UNREG_INP; 2860 - } 2861 - 2862 - void 2863 - lpfc_sli_rpi_release(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) 2864 - { 2865 - __lpfc_sli_rpi_release(vport, ndlp); 2866 - } 2867 - 2868 2845 /** 2869 2846 * lpfc_sli_def_mbox_cmpl - Default mailbox completion handler 2870 2847 * @phba: Pointer to HBA context object. ··· 2913 2932 vport, 2914 2933 KERN_INFO, LOG_MBOX | LOG_DISCOVERY, 2915 2934 "1438 UNREG cmpl deferred mbox x%x " 2916 - "on NPort x%x Data: x%x x%x x%px x%lx x%x\n", 2935 + "on NPort x%x Data: x%lx x%x x%px x%lx x%x\n", 2917 2936 ndlp->nlp_rpi, ndlp->nlp_DID, 2918 2937 ndlp->nlp_flag, ndlp->nlp_defer_did, 2919 2938 ndlp, vport->load_flag, kref_read(&ndlp->kref)); 2920 2939 2921 - if ((ndlp->nlp_flag & NLP_UNREG_INP) && 2922 - (ndlp->nlp_defer_did != NLP_EVT_NOTHING_PENDING)) { 2923 - ndlp->nlp_flag &= ~NLP_UNREG_INP; 2940 + if (test_bit(NLP_UNREG_INP, &ndlp->nlp_flag) && 2941 + ndlp->nlp_defer_did != NLP_EVT_NOTHING_PENDING) { 2942 + clear_bit(NLP_UNREG_INP, &ndlp->nlp_flag); 2924 2943 ndlp->nlp_defer_did = NLP_EVT_NOTHING_PENDING; 2925 2944 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); 2926 - } else { 2927 - __lpfc_sli_rpi_release(vport, ndlp); 2928 2945 } 2929 2946 2930 2947 /* The unreg_login mailbox is complete and had a ··· 2970 2991 { 2971 2992 struct lpfc_vport *vport = pmb->vport; 2972 2993 struct lpfc_nodelist *ndlp; 2994 + bool unreg_inp; 2973 2995 2974 2996 ndlp = pmb->ctx_ndlp; 2975 2997 if (pmb->u.mb.mbxCommand == MBX_UNREG_LOGIN) { ··· 2983 3003 vport, KERN_INFO, 2984 3004 LOG_MBOX | LOG_SLI | LOG_NODE, 2985 3005 "0010 UNREG_LOGIN vpi:x%x " 2986 - "rpi:%x DID:%x defer x%x flg x%x " 3006 + "rpi:%x DID:%x defer x%x flg x%lx " 2987 3007 "x%px\n", 2988 3008 vport->vpi, ndlp->nlp_rpi, 2989 3009 ndlp->nlp_DID, ndlp->nlp_defer_did, 2990 3010 ndlp->nlp_flag, 2991 3011 ndlp); 2992 - ndlp->nlp_flag &= ~NLP_LOGO_ACC; 3012 + 3013 + /* Cleanup the nlp_flag now that the UNREG RPI 3014 + * has completed. 3015 + */ 3016 + unreg_inp = test_and_clear_bit(NLP_UNREG_INP, 3017 + &ndlp->nlp_flag); 3018 + clear_bit(NLP_LOGO_ACC, &ndlp->nlp_flag); 2993 3019 2994 3020 /* Check to see if there are any deferred 2995 3021 * events to process 2996 3022 */ 2997 - if ((ndlp->nlp_flag & NLP_UNREG_INP) && 2998 - (ndlp->nlp_defer_did != 2999 - NLP_EVT_NOTHING_PENDING)) { 3023 + if (unreg_inp && 3024 + ndlp->nlp_defer_did != 3025 + NLP_EVT_NOTHING_PENDING) { 3000 3026 lpfc_printf_vlog( 3001 3027 vport, KERN_INFO, 3002 3028 LOG_MBOX | LOG_SLI | LOG_NODE, ··· 3011 3025 "NPort x%x Data: x%x x%px\n", 3012 3026 ndlp->nlp_rpi, ndlp->nlp_DID, 3013 3027 ndlp->nlp_defer_did, ndlp); 3014 - ndlp->nlp_flag &= ~NLP_UNREG_INP; 3015 3028 ndlp->nlp_defer_did = 3016 3029 NLP_EVT_NOTHING_PENDING; 3017 3030 lpfc_issue_els_plogi( 3018 3031 vport, ndlp->nlp_DID, 0); 3019 - } else { 3020 - __lpfc_sli_rpi_release(vport, ndlp); 3021 3032 } 3033 + 3022 3034 lpfc_nlp_put(ndlp); 3023 3035 } 3024 3036 } ··· 5274 5290 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 5275 5291 "0296 Restart HBA Data: x%x x%x\n", 5276 5292 phba->pport->port_state, psli->sli_flag); 5293 + 5294 + lpfc_sli4_queue_unset(phba); 5277 5295 5278 5296 rc = lpfc_sli4_brdreset(phba); 5279 5297 if (rc) { ··· 8734 8748 lpfc_sli_config_mbox_opcode_get( 8735 8749 phba, mboxq), 8736 8750 rc, dd); 8751 + 8737 8752 /* 8738 8753 * Allocate all resources (xri,rpi,vpi,vfi) now. Subsequent 8739 8754 * calls depends on these resources to complete port setup. ··· 8746 8759 "rc = x%x\n", rc); 8747 8760 goto out_free_mbox; 8748 8761 } 8762 + 8763 + lpfc_sli4_node_rpi_restore(phba); 8749 8764 8750 8765 lpfc_set_host_data(phba, mboxq); 8751 8766 ··· 8936 8947 rc = -ENODEV; 8937 8948 goto out_free_iocblist; 8938 8949 } 8939 - lpfc_sli4_node_prep(phba); 8940 8950 8941 8951 if (!test_bit(HBA_FCOE_MODE, &phba->hba_flag)) { 8942 8952 if ((phba->nvmet_support == 0) || (phba->cfg_nvmet_mrq == 1)) { ··· 14340 14352 * an unsolicited PLOGI from the same NPortId from 14341 14353 * starting another mailbox transaction. 14342 14354 */ 14343 - spin_lock_irqsave(&ndlp->lock, iflags); 14344 - ndlp->nlp_flag |= NLP_UNREG_INP; 14345 - spin_unlock_irqrestore(&ndlp->lock, iflags); 14355 + set_bit(NLP_UNREG_INP, &ndlp->nlp_flag); 14346 14356 lpfc_unreg_login(phba, vport->vpi, 14347 14357 pmbox->un.varWords[0], pmb); 14348 14358 pmb->mbox_cmpl = lpfc_mbx_cmpl_dflt_rpi; ··· 17611 17625 if (!eq) 17612 17626 return -ENODEV; 17613 17627 17628 + if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE)) 17629 + goto list_remove; 17630 + 17614 17631 mbox = mempool_alloc(eq->phba->mbox_mem_pool, GFP_KERNEL); 17615 17632 if (!mbox) 17616 17633 return -ENOMEM; ··· 17640 17651 shdr_status, shdr_add_status, rc); 17641 17652 status = -ENXIO; 17642 17653 } 17654 + mempool_free(mbox, eq->phba->mbox_mem_pool); 17643 17655 17656 + list_remove: 17644 17657 /* Remove eq from any list */ 17645 17658 list_del_init(&eq->list); 17646 - mempool_free(mbox, eq->phba->mbox_mem_pool); 17659 + 17647 17660 return status; 17648 17661 } 17649 17662 ··· 17673 17682 /* sanity check on queue memory */ 17674 17683 if (!cq) 17675 17684 return -ENODEV; 17685 + 17686 + if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE)) 17687 + goto list_remove; 17688 + 17676 17689 mbox = mempool_alloc(cq->phba->mbox_mem_pool, GFP_KERNEL); 17677 17690 if (!mbox) 17678 17691 return -ENOMEM; ··· 17702 17707 shdr_status, shdr_add_status, rc); 17703 17708 status = -ENXIO; 17704 17709 } 17710 + mempool_free(mbox, cq->phba->mbox_mem_pool); 17711 + 17712 + list_remove: 17705 17713 /* Remove cq from any list */ 17706 17714 list_del_init(&cq->list); 17707 - mempool_free(mbox, cq->phba->mbox_mem_pool); 17708 17715 return status; 17709 17716 } 17710 17717 ··· 17734 17737 /* sanity check on queue memory */ 17735 17738 if (!mq) 17736 17739 return -ENODEV; 17740 + 17741 + if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE)) 17742 + goto list_remove; 17743 + 17737 17744 mbox = mempool_alloc(mq->phba->mbox_mem_pool, GFP_KERNEL); 17738 17745 if (!mbox) 17739 17746 return -ENOMEM; ··· 17763 17762 shdr_status, shdr_add_status, rc); 17764 17763 status = -ENXIO; 17765 17764 } 17765 + mempool_free(mbox, mq->phba->mbox_mem_pool); 17766 + 17767 + list_remove: 17766 17768 /* Remove mq from any list */ 17767 17769 list_del_init(&mq->list); 17768 - mempool_free(mbox, mq->phba->mbox_mem_pool); 17769 17770 return status; 17770 17771 } 17771 17772 ··· 17795 17792 /* sanity check on queue memory */ 17796 17793 if (!wq) 17797 17794 return -ENODEV; 17795 + 17796 + if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE)) 17797 + goto list_remove; 17798 + 17798 17799 mbox = mempool_alloc(wq->phba->mbox_mem_pool, GFP_KERNEL); 17799 17800 if (!mbox) 17800 17801 return -ENOMEM; ··· 17823 17816 shdr_status, shdr_add_status, rc); 17824 17817 status = -ENXIO; 17825 17818 } 17819 + mempool_free(mbox, wq->phba->mbox_mem_pool); 17820 + 17821 + list_remove: 17826 17822 /* Remove wq from any list */ 17827 17823 list_del_init(&wq->list); 17828 17824 kfree(wq->pring); 17829 17825 wq->pring = NULL; 17830 - mempool_free(mbox, wq->phba->mbox_mem_pool); 17831 17826 return status; 17832 17827 } 17833 17828 ··· 17859 17850 /* sanity check on queue memory */ 17860 17851 if (!hrq || !drq) 17861 17852 return -ENODEV; 17853 + 17854 + if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE)) 17855 + goto list_remove; 17856 + 17862 17857 mbox = mempool_alloc(hrq->phba->mbox_mem_pool, GFP_KERNEL); 17863 17858 if (!mbox) 17864 17859 return -ENOMEM; ··· 17903 17890 shdr_status, shdr_add_status, rc); 17904 17891 status = -ENXIO; 17905 17892 } 17893 + mempool_free(mbox, hrq->phba->mbox_mem_pool); 17894 + 17895 + list_remove: 17906 17896 list_del_init(&hrq->list); 17907 17897 list_del_init(&drq->list); 17908 - mempool_free(mbox, hrq->phba->mbox_mem_pool); 17909 17898 return status; 17910 17899 } 17911 17900 ··· 19089 19074 * to free ndlp when transmit completes 19090 19075 */ 19091 19076 if (ndlp->nlp_state == NLP_STE_UNUSED_NODE && 19092 - !(ndlp->nlp_flag & NLP_DROPPED) && 19077 + !test_bit(NLP_DROPPED, &ndlp->nlp_flag) && 19093 19078 !(ndlp->fc4_xpt_flags & (NVME_XPT_REGD | SCSI_XPT_REGD))) { 19094 - ndlp->nlp_flag |= NLP_DROPPED; 19079 + set_bit(NLP_DROPPED, &ndlp->nlp_flag); 19095 19080 lpfc_nlp_put(ndlp); 19096 19081 } 19097 19082 } ··· 21109 21094 /* Unregister the RPI when mailbox complete */ 21110 21095 mb->mbox_flag |= LPFC_MBX_IMED_UNREG; 21111 21096 restart_loop = 1; 21112 - spin_unlock_irq(&phba->hbalock); 21113 - spin_lock(&ndlp->lock); 21114 - ndlp->nlp_flag &= ~NLP_IGNR_REG_CMPL; 21115 - spin_unlock(&ndlp->lock); 21116 - spin_lock_irq(&phba->hbalock); 21097 + clear_bit(NLP_IGNR_REG_CMPL, &ndlp->nlp_flag); 21117 21098 break; 21118 21099 } 21119 21100 } ··· 21124 21113 ndlp = mb->ctx_ndlp; 21125 21114 mb->ctx_ndlp = NULL; 21126 21115 if (ndlp) { 21127 - spin_lock(&ndlp->lock); 21128 - ndlp->nlp_flag &= ~NLP_IGNR_REG_CMPL; 21129 - spin_unlock(&ndlp->lock); 21116 + clear_bit(NLP_IGNR_REG_CMPL, &ndlp->nlp_flag); 21130 21117 lpfc_nlp_put(ndlp); 21131 21118 } 21132 21119 } ··· 21133 21124 21134 21125 /* Release the ndlp with the cleaned-up active mailbox command */ 21135 21126 if (act_mbx_ndlp) { 21136 - spin_lock(&act_mbx_ndlp->lock); 21137 - act_mbx_ndlp->nlp_flag &= ~NLP_IGNR_REG_CMPL; 21138 - spin_unlock(&act_mbx_ndlp->lock); 21127 + clear_bit(NLP_IGNR_REG_CMPL, &act_mbx_ndlp->nlp_flag); 21139 21128 lpfc_nlp_put(act_mbx_ndlp); 21140 21129 } 21141 21130 }
+1 -1
drivers/scsi/lpfc/lpfc_version.h
··· 20 20 * included with this package. * 21 21 *******************************************************************/ 22 22 23 - #define LPFC_DRIVER_VERSION "14.4.0.5" 23 + #define LPFC_DRIVER_VERSION "14.4.0.6" 24 24 #define LPFC_DRIVER_NAME "lpfc" 25 25 26 26 /* Used for SLI 2/3 */
+3 -3
drivers/scsi/lpfc/lpfc_vport.c
··· 496 496 !ndlp->logo_waitq) { 497 497 ndlp->logo_waitq = &waitq; 498 498 ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; 499 - ndlp->nlp_flag |= NLP_ISSUE_LOGO; 499 + set_bit(NLP_ISSUE_LOGO, &ndlp->nlp_flag); 500 500 ndlp->save_flags |= NLP_WAIT_FOR_LOGO; 501 501 } 502 502 spin_unlock_irq(&ndlp->lock); ··· 515 515 } 516 516 517 517 /* Error - clean up node flags. */ 518 + clear_bit(NLP_ISSUE_LOGO, &ndlp->nlp_flag); 518 519 spin_lock_irq(&ndlp->lock); 519 - ndlp->nlp_flag &= ~NLP_ISSUE_LOGO; 520 520 ndlp->save_flags &= ~NLP_WAIT_FOR_LOGO; 521 521 spin_unlock_irq(&ndlp->lock); 522 522 ··· 708 708 709 709 lpfc_printf_vlog(vport, KERN_INFO, LOG_VPORT | LOG_ELS, 710 710 "1829 DA_ID issue status %d. " 711 - "SFlag x%x NState x%x, NFlag x%x " 711 + "SFlag x%x NState x%x, NFlag x%lx " 712 712 "Rpi x%x\n", 713 713 rc, ndlp->save_flags, ndlp->nlp_state, 714 714 ndlp->nlp_flag, ndlp->nlp_rpi);