aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2007-10-27 13:37:25 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 19:22:32 -0500
commit0b727fea7a700e223bf52fb1eaf4c3a27c4340db (patch)
treeff4eb6c5ab0ac7c3b2a299f037d1b73224a07c9e /drivers/scsi/lpfc
parent7ee5d43e2ea25336a7638715420c75583bd2ed69 (diff)
[SCSI] lpfc 8.2.3 : Remove flawed MBX_STOP_IOCB logic
Remove flawed MBX_STOP_IOCB logic Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c20
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c33
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c4
-rw-r--r--drivers/scsi/lpfc/lpfc_nportdisc.c6
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c69
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.h4
6 files changed, 27 insertions, 109 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 8085900635d4..b73612d4fc53 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -249,7 +249,7 @@ lpfc_issue_fabric_reglogin(struct lpfc_vport *vport)
249 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 249 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
250 mbox->vport = vport; 250 mbox->vport = vport;
251 251
252 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT | MBX_STOP_IOCB); 252 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
253 if (rc == MBX_NOT_FINISHED) 253 if (rc == MBX_NOT_FINISHED)
254 goto fail_free_mbox; 254 goto fail_free_mbox;
255 255
@@ -265,7 +265,7 @@ lpfc_issue_fabric_reglogin(struct lpfc_vport *vport)
265 mbox->vport = vport; 265 mbox->vport = vport;
266 mbox->context2 = lpfc_nlp_get(ndlp); 266 mbox->context2 = lpfc_nlp_get(ndlp);
267 267
268 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT | MBX_STOP_IOCB); 268 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
269 if (rc == MBX_NOT_FINISHED) 269 if (rc == MBX_NOT_FINISHED)
270 goto fail_issue_reg_login; 270 goto fail_issue_reg_login;
271 271
@@ -429,8 +429,7 @@ lpfc_cmpl_els_flogi_nport(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
429 429
430 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 430 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
431 mbox->vport = vport; 431 mbox->vport = vport;
432 rc = lpfc_sli_issue_mbox(phba, mbox, 432 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
433 MBX_NOWAIT | MBX_STOP_IOCB);
434 if (rc == MBX_NOT_FINISHED) { 433 if (rc == MBX_NOT_FINISHED) {
435 mempool_free(mbox, phba->mbox_mem_pool); 434 mempool_free(mbox, phba->mbox_mem_pool);
436 goto fail; 435 goto fail;
@@ -2150,8 +2149,7 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
2150 lpfc_nlp_set_state(vport, ndlp, 2149 lpfc_nlp_set_state(vport, ndlp,
2151 NLP_STE_REG_LOGIN_ISSUE); 2150 NLP_STE_REG_LOGIN_ISSUE);
2152 } 2151 }
2153 if (lpfc_sli_issue_mbox(phba, mbox, 2152 if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT)
2154 (MBX_NOWAIT | MBX_STOP_IOCB))
2155 != MBX_NOT_FINISHED) { 2153 != MBX_NOT_FINISHED) {
2156 goto out; 2154 goto out;
2157 } 2155 }
@@ -3022,8 +3020,7 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
3022 mbox->mb.un.varInitLnk.lipsr_AL_PA = 0; 3020 mbox->mb.un.varInitLnk.lipsr_AL_PA = 0;
3023 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 3021 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
3024 mbox->vport = vport; 3022 mbox->vport = vport;
3025 rc = lpfc_sli_issue_mbox 3023 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
3026 (phba, mbox, (MBX_NOWAIT | MBX_STOP_IOCB));
3027 lpfc_set_loopback_flag(phba); 3024 lpfc_set_loopback_flag(phba);
3028 if (rc == MBX_NOT_FINISHED) { 3025 if (rc == MBX_NOT_FINISHED) {
3029 mempool_free(mbox, phba->mbox_mem_pool); 3026 mempool_free(mbox, phba->mbox_mem_pool);
@@ -3223,8 +3220,8 @@ lpfc_els_rcv_rps(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
3223 mbox->context2 = lpfc_nlp_get(ndlp); 3220 mbox->context2 = lpfc_nlp_get(ndlp);
3224 mbox->vport = vport; 3221 mbox->vport = vport;
3225 mbox->mbox_cmpl = lpfc_els_rsp_rps_acc; 3222 mbox->mbox_cmpl = lpfc_els_rsp_rps_acc;
3226 if (lpfc_sli_issue_mbox (phba, mbox, 3223 if (lpfc_sli_issue_mbox (phba, mbox, MBX_NOWAIT)
3227 (MBX_NOWAIT | MBX_STOP_IOCB)) != MBX_NOT_FINISHED) 3224 != MBX_NOT_FINISHED)
3228 /* Mbox completion will send ELS Response */ 3225 /* Mbox completion will send ELS Response */
3229 return 0; 3226 return 0;
3230 3227
@@ -4162,8 +4159,7 @@ lpfc_register_new_vport(struct lpfc_hba *phba, struct lpfc_vport *vport,
4162 mbox->vport = vport; 4159 mbox->vport = vport;
4163 mbox->context2 = lpfc_nlp_get(ndlp); 4160 mbox->context2 = lpfc_nlp_get(ndlp);
4164 mbox->mbox_cmpl = lpfc_cmpl_reg_new_vport; 4161 mbox->mbox_cmpl = lpfc_cmpl_reg_new_vport;
4165 if (lpfc_sli_issue_mbox(phba, mbox, 4162 if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT)
4166 MBX_NOWAIT | MBX_STOP_IOCB)
4167 == MBX_NOT_FINISHED) { 4163 == MBX_NOT_FINISHED) {
4168 mempool_free(mbox, phba->mbox_mem_pool); 4164 mempool_free(mbox, phba->mbox_mem_pool);
4169 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; 4165 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI;
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index c81c2b3228d6..6f5bf8189950 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -412,7 +412,7 @@ lpfc_work_done(struct lpfc_hba *phba)
412 status >>= (4*LPFC_ELS_RING); 412 status >>= (4*LPFC_ELS_RING);
413 if ((status & HA_RXMASK) 413 if ((status & HA_RXMASK)
414 || (pring->flag & LPFC_DEFERRED_RING_EVENT)) { 414 || (pring->flag & LPFC_DEFERRED_RING_EVENT)) {
415 if (pring->flag & LPFC_STOP_IOCB_MASK) { 415 if (pring->flag & LPFC_STOP_IOCB_EVENT) {
416 pring->flag |= LPFC_DEFERRED_RING_EVENT; 416 pring->flag |= LPFC_DEFERRED_RING_EVENT;
417 } else { 417 } else {
418 lpfc_sli_handle_slow_ring_event(phba, pring, 418 lpfc_sli_handle_slow_ring_event(phba, pring,
@@ -629,7 +629,7 @@ lpfc_linkdown(struct lpfc_hba *phba)
629 lpfc_unreg_did(phba, 0xffff, 0xffffffff, mb); 629 lpfc_unreg_did(phba, 0xffff, 0xffffffff, mb);
630 mb->vport = vport; 630 mb->vport = vport;
631 mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 631 mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
632 if (lpfc_sli_issue_mbox(phba, mb, (MBX_NOWAIT | MBX_STOP_IOCB)) 632 if (lpfc_sli_issue_mbox(phba, mb, MBX_NOWAIT)
633 == MBX_NOT_FINISHED) { 633 == MBX_NOT_FINISHED) {
634 mempool_free(mb, phba->mbox_mem_pool); 634 mempool_free(mb, phba->mbox_mem_pool);
635 } 635 }
@@ -643,8 +643,7 @@ lpfc_linkdown(struct lpfc_hba *phba)
643 lpfc_config_link(phba, mb); 643 lpfc_config_link(phba, mb);
644 mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 644 mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
645 mb->vport = vport; 645 mb->vport = vport;
646 if (lpfc_sli_issue_mbox(phba, mb, 646 if (lpfc_sli_issue_mbox(phba, mb, MBX_NOWAIT)
647 (MBX_NOWAIT | MBX_STOP_IOCB))
648 == MBX_NOT_FINISHED) { 647 == MBX_NOT_FINISHED) {
649 mempool_free(mb, phba->mbox_mem_pool); 648 mempool_free(mb, phba->mbox_mem_pool);
650 } 649 }
@@ -1022,8 +1021,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
1022 lpfc_read_sparam(phba, sparam_mbox, 0); 1021 lpfc_read_sparam(phba, sparam_mbox, 0);
1023 sparam_mbox->vport = vport; 1022 sparam_mbox->vport = vport;
1024 sparam_mbox->mbox_cmpl = lpfc_mbx_cmpl_read_sparam; 1023 sparam_mbox->mbox_cmpl = lpfc_mbx_cmpl_read_sparam;
1025 rc = lpfc_sli_issue_mbox(phba, sparam_mbox, 1024 rc = lpfc_sli_issue_mbox(phba, sparam_mbox, MBX_NOWAIT);
1026 (MBX_NOWAIT | MBX_STOP_IOCB));
1027 if (rc == MBX_NOT_FINISHED) { 1025 if (rc == MBX_NOT_FINISHED) {
1028 mp = (struct lpfc_dmabuf *) sparam_mbox->context1; 1026 mp = (struct lpfc_dmabuf *) sparam_mbox->context1;
1029 lpfc_mbuf_free(phba, mp->virt, mp->phys); 1027 lpfc_mbuf_free(phba, mp->virt, mp->phys);
@@ -1040,8 +1038,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
1040 lpfc_config_link(phba, cfglink_mbox); 1038 lpfc_config_link(phba, cfglink_mbox);
1041 cfglink_mbox->vport = vport; 1039 cfglink_mbox->vport = vport;
1042 cfglink_mbox->mbox_cmpl = lpfc_mbx_cmpl_local_config_link; 1040 cfglink_mbox->mbox_cmpl = lpfc_mbx_cmpl_local_config_link;
1043 rc = lpfc_sli_issue_mbox(phba, cfglink_mbox, 1041 rc = lpfc_sli_issue_mbox(phba, cfglink_mbox, MBX_NOWAIT);
1044 (MBX_NOWAIT | MBX_STOP_IOCB));
1045 if (rc != MBX_NOT_FINISHED) 1042 if (rc != MBX_NOT_FINISHED)
1046 return; 1043 return;
1047 mempool_free(cfglink_mbox, phba->mbox_mem_pool); 1044 mempool_free(cfglink_mbox, phba->mbox_mem_pool);
@@ -1219,7 +1216,7 @@ lpfc_mbx_unreg_vpi(struct lpfc_vport *vport)
1219 lpfc_unreg_vpi(phba, vport->vpi, mbox); 1216 lpfc_unreg_vpi(phba, vport->vpi, mbox);
1220 mbox->vport = vport; 1217 mbox->vport = vport;
1221 mbox->mbox_cmpl = lpfc_mbx_cmpl_unreg_vpi; 1218 mbox->mbox_cmpl = lpfc_mbx_cmpl_unreg_vpi;
1222 rc = lpfc_sli_issue_mbox(phba, mbox, (MBX_NOWAIT | MBX_STOP_IOCB)); 1219 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
1223 if (rc == MBX_NOT_FINISHED) { 1220 if (rc == MBX_NOT_FINISHED) {
1224 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, 1221 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT,
1225 "1800 Could not issue unreg_vpi\n"); 1222 "1800 Could not issue unreg_vpi\n");
@@ -1868,8 +1865,7 @@ lpfc_unreg_rpi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
1868 lpfc_unreg_login(phba, vport->vpi, ndlp->nlp_rpi, mbox); 1865 lpfc_unreg_login(phba, vport->vpi, ndlp->nlp_rpi, mbox);
1869 mbox->vport = vport; 1866 mbox->vport = vport;
1870 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 1867 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
1871 rc = lpfc_sli_issue_mbox(phba, mbox, 1868 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
1872 (MBX_NOWAIT | MBX_STOP_IOCB));
1873 if (rc == MBX_NOT_FINISHED) 1869 if (rc == MBX_NOT_FINISHED)
1874 mempool_free(mbox, phba->mbox_mem_pool); 1870 mempool_free(mbox, phba->mbox_mem_pool);
1875 } 1871 }
@@ -1892,8 +1888,7 @@ lpfc_unreg_all_rpis(struct lpfc_vport *vport)
1892 lpfc_unreg_login(phba, vport->vpi, 0xffff, mbox); 1888 lpfc_unreg_login(phba, vport->vpi, 0xffff, mbox);
1893 mbox->vport = vport; 1889 mbox->vport = vport;
1894 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 1890 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
1895 rc = lpfc_sli_issue_mbox(phba, mbox, 1891 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
1896 (MBX_NOWAIT | MBX_STOP_IOCB));
1897 if (rc == MBX_NOT_FINISHED) { 1892 if (rc == MBX_NOT_FINISHED) {
1898 mempool_free(mbox, phba->mbox_mem_pool); 1893 mempool_free(mbox, phba->mbox_mem_pool);
1899 } 1894 }
@@ -1912,8 +1907,7 @@ lpfc_unreg_default_rpis(struct lpfc_vport *vport)
1912 lpfc_unreg_did(phba, vport->vpi, 0xffffffff, mbox); 1907 lpfc_unreg_did(phba, vport->vpi, 0xffffffff, mbox);
1913 mbox->vport = vport; 1908 mbox->vport = vport;
1914 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 1909 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
1915 rc = lpfc_sli_issue_mbox(phba, mbox, 1910 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
1916 (MBX_NOWAIT | MBX_STOP_IOCB));
1917 if (rc == MBX_NOT_FINISHED) { 1911 if (rc == MBX_NOT_FINISHED) {
1918 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, 1912 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT,
1919 "1815 Could not issue " 1913 "1815 Could not issue "
@@ -2220,8 +2214,7 @@ lpfc_issue_clear_la(struct lpfc_hba *phba, struct lpfc_vport *vport)
2220 lpfc_clear_la(phba, mbox); 2214 lpfc_clear_la(phba, mbox);
2221 mbox->mbox_cmpl = lpfc_mbx_cmpl_clear_la; 2215 mbox->mbox_cmpl = lpfc_mbx_cmpl_clear_la;
2222 mbox->vport = vport; 2216 mbox->vport = vport;
2223 rc = lpfc_sli_issue_mbox(phba, mbox, (MBX_NOWAIT | 2217 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
2224 MBX_STOP_IOCB));
2225 if (rc == MBX_NOT_FINISHED) { 2218 if (rc == MBX_NOT_FINISHED) {
2226 mempool_free(mbox, phba->mbox_mem_pool); 2219 mempool_free(mbox, phba->mbox_mem_pool);
2227 lpfc_disc_flush_list(vport); 2220 lpfc_disc_flush_list(vport);
@@ -2244,8 +2237,7 @@ lpfc_issue_reg_vpi(struct lpfc_hba *phba, struct lpfc_vport *vport)
2244 lpfc_reg_vpi(phba, vport->vpi, vport->fc_myDID, regvpimbox); 2237 lpfc_reg_vpi(phba, vport->vpi, vport->fc_myDID, regvpimbox);
2245 regvpimbox->mbox_cmpl = lpfc_mbx_cmpl_reg_vpi; 2238 regvpimbox->mbox_cmpl = lpfc_mbx_cmpl_reg_vpi;
2246 regvpimbox->vport = vport; 2239 regvpimbox->vport = vport;
2247 if (lpfc_sli_issue_mbox(phba, regvpimbox, 2240 if (lpfc_sli_issue_mbox(phba, regvpimbox, MBX_NOWAIT)
2248 (MBX_NOWAIT | MBX_STOP_IOCB))
2249 == MBX_NOT_FINISHED) { 2241 == MBX_NOT_FINISHED) {
2250 mempool_free(regvpimbox, phba->mbox_mem_pool); 2242 mempool_free(regvpimbox, phba->mbox_mem_pool);
2251 } 2243 }
@@ -2608,8 +2600,7 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
2608 initlinkmbox->mb.un.varInitLnk.lipsr_AL_PA = 0; 2600 initlinkmbox->mb.un.varInitLnk.lipsr_AL_PA = 0;
2609 initlinkmbox->vport = vport; 2601 initlinkmbox->vport = vport;
2610 initlinkmbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 2602 initlinkmbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
2611 rc = lpfc_sli_issue_mbox(phba, initlinkmbox, 2603 rc = lpfc_sli_issue_mbox(phba, initlinkmbox, MBX_NOWAIT);
2612 (MBX_NOWAIT | MBX_STOP_IOCB));
2613 lpfc_set_loopback_flag(phba); 2604 lpfc_set_loopback_flag(phba);
2614 if (rc == MBX_NOT_FINISHED) 2605 if (rc == MBX_NOT_FINISHED)
2615 mempool_free(initlinkmbox, phba->mbox_mem_pool); 2606 mempool_free(initlinkmbox, phba->mbox_mem_pool);
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 86c2f2b15b68..8c7fdb8487e0 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -355,7 +355,7 @@ lpfc_config_port_post(struct lpfc_hba *phba)
355 355
356 phba->link_state = LPFC_LINK_DOWN; 356 phba->link_state = LPFC_LINK_DOWN;
357 357
358 /* Only process IOCBs on ring 0 till hba_state is READY */ 358 /* Only process IOCBs on ELS ring till hba_state is READY */
359 if (psli->ring[psli->extra_ring].cmdringaddr) 359 if (psli->ring[psli->extra_ring].cmdringaddr)
360 psli->ring[psli->extra_ring].flag |= LPFC_STOP_IOCB_EVENT; 360 psli->ring[psli->extra_ring].flag |= LPFC_STOP_IOCB_EVENT;
361 if (psli->ring[psli->fcp_ring].cmdringaddr) 361 if (psli->ring[psli->fcp_ring].cmdringaddr)
@@ -777,7 +777,7 @@ lpfc_handle_latt(struct lpfc_hba *phba)
777 lpfc_read_la(phba, pmb, mp); 777 lpfc_read_la(phba, pmb, mp);
778 pmb->mbox_cmpl = lpfc_mbx_cmpl_read_la; 778 pmb->mbox_cmpl = lpfc_mbx_cmpl_read_la;
779 pmb->vport = vport; 779 pmb->vport = vport;
780 rc = lpfc_sli_issue_mbox (phba, pmb, (MBX_NOWAIT | MBX_STOP_IOCB)); 780 rc = lpfc_sli_issue_mbox (phba, pmb, MBX_NOWAIT);
781 if (rc == MBX_NOT_FINISHED) 781 if (rc == MBX_NOT_FINISHED)
782 goto lpfc_handle_latt_free_mbuf; 782 goto lpfc_handle_latt_free_mbuf;
783 783
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
index 880af0cd463d..71fd00127351 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -343,8 +343,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
343 lpfc_config_link(phba, mbox); 343 lpfc_config_link(phba, mbox);
344 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 344 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
345 mbox->vport = vport; 345 mbox->vport = vport;
346 rc = lpfc_sli_issue_mbox 346 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
347 (phba, mbox, (MBX_NOWAIT | MBX_STOP_IOCB));
348 if (rc == MBX_NOT_FINISHED) { 347 if (rc == MBX_NOT_FINISHED) {
349 mempool_free(mbox, phba->mbox_mem_pool); 348 mempool_free(mbox, phba->mbox_mem_pool);
350 goto out; 349 goto out;
@@ -828,8 +827,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
828 } 827 }
829 mbox->context2 = lpfc_nlp_get(ndlp); 828 mbox->context2 = lpfc_nlp_get(ndlp);
830 mbox->vport = vport; 829 mbox->vport = vport;
831 if (lpfc_sli_issue_mbox(phba, mbox, 830 if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT)
832 (MBX_NOWAIT | MBX_STOP_IOCB))
833 != MBX_NOT_FINISHED) { 831 != MBX_NOT_FINISHED) {
834 lpfc_nlp_set_state(vport, ndlp, 832 lpfc_nlp_set_state(vport, ndlp,
835 NLP_STE_REG_LOGIN_ISSUE); 833 NLP_STE_REG_LOGIN_ISSUE);
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 41f13a300ba5..744bad627596 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -474,8 +474,7 @@ lpfc_sli_resume_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring)
474 if (pring->txq_cnt && 474 if (pring->txq_cnt &&
475 lpfc_is_link_up(phba) && 475 lpfc_is_link_up(phba) &&
476 (pring->ringno != phba->sli.fcp_ring || 476 (pring->ringno != phba->sli.fcp_ring ||
477 phba->sli.sli_flag & LPFC_PROCESS_LA) && 477 phba->sli.sli_flag & LPFC_PROCESS_LA)) {
478 !(pring->flag & LPFC_STOP_IOCB_MBX)) {
479 478
480 while ((iocb = lpfc_sli_next_iocb_slot(phba, pring)) && 479 while ((iocb = lpfc_sli_next_iocb_slot(phba, pring)) &&
481 (nextiocb = lpfc_sli_ringtx_get(phba, pring))) 480 (nextiocb = lpfc_sli_ringtx_get(phba, pring)))
@@ -490,31 +489,6 @@ lpfc_sli_resume_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring)
490 return; 489 return;
491} 490}
492 491
493/* lpfc_sli_turn_on_ring is only called by lpfc_sli_handle_mb_event below */
494static void
495lpfc_sli_turn_on_ring(struct lpfc_hba *phba, int ringno)
496{
497 struct lpfc_pgp *pgp = (phba->sli_rev == 3) ?
498 &phba->slim2p->mbx.us.s3_pgp.port[ringno] :
499 &phba->slim2p->mbx.us.s2.port[ringno];
500 unsigned long iflags;
501
502 /* If the ring is active, flag it */
503 spin_lock_irqsave(&phba->hbalock, iflags);
504 if (phba->sli.ring[ringno].cmdringaddr) {
505 if (phba->sli.ring[ringno].flag & LPFC_STOP_IOCB_MBX) {
506 phba->sli.ring[ringno].flag &= ~LPFC_STOP_IOCB_MBX;
507 /*
508 * Force update of the local copy of cmdGetInx
509 */
510 phba->sli.ring[ringno].local_getidx
511 = le32_to_cpu(pgp->cmdGetInx);
512 lpfc_sli_resume_iocb(phba, &phba->sli.ring[ringno]);
513 }
514 }
515 spin_unlock_irqrestore(&phba->hbalock, iflags);
516}
517
518struct lpfc_hbq_entry * 492struct lpfc_hbq_entry *
519lpfc_sli_next_hbq_slot(struct lpfc_hba *phba, uint32_t hbqno) 493lpfc_sli_next_hbq_slot(struct lpfc_hba *phba, uint32_t hbqno)
520{ 494{
@@ -2590,21 +2564,6 @@ lpfc_sli_issue_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, uint32_t flag)
2590 return MBX_NOT_FINISHED; 2564 return MBX_NOT_FINISHED;
2591 } 2565 }
2592 2566
2593 /* Handle STOP IOCB processing flag. This is only meaningful
2594 * if we are not polling for mbox completion.
2595 */
2596 if (flag & MBX_STOP_IOCB) {
2597 flag &= ~MBX_STOP_IOCB;
2598 /* Now flag each ring */
2599 for (i = 0; i < psli->num_rings; i++) {
2600 /* If the ring is active, flag it */
2601 if (psli->ring[i].cmdringaddr) {
2602 psli->ring[i].flag |=
2603 LPFC_STOP_IOCB_MBX;
2604 }
2605 }
2606 }
2607
2608 /* Another mailbox command is still being processed, queue this 2567 /* Another mailbox command is still being processed, queue this
2609 * command to be processed later. 2568 * command to be processed later.
2610 */ 2569 */
@@ -2639,23 +2598,6 @@ lpfc_sli_issue_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, uint32_t flag)
2639 return MBX_BUSY; 2598 return MBX_BUSY;
2640 } 2599 }
2641 2600
2642 /* Handle STOP IOCB processing flag. This is only meaningful
2643 * if we are not polling for mbox completion.
2644 */
2645 if (flag & MBX_STOP_IOCB) {
2646 flag &= ~MBX_STOP_IOCB;
2647 if (flag == MBX_NOWAIT) {
2648 /* Now flag each ring */
2649 for (i = 0; i < psli->num_rings; i++) {
2650 /* If the ring is active, flag it */
2651 if (psli->ring[i].cmdringaddr) {
2652 psli->ring[i].flag |=
2653 LPFC_STOP_IOCB_MBX;
2654 }
2655 }
2656 }
2657 }
2658
2659 psli->sli_flag |= LPFC_SLI_MBOX_ACTIVE; 2601 psli->sli_flag |= LPFC_SLI_MBOX_ACTIVE;
2660 2602
2661 /* If we are not polling, we MUST be in SLI2 mode */ 2603 /* If we are not polling, we MUST be in SLI2 mode */
@@ -2898,9 +2840,9 @@ __lpfc_sli_issue_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
2898 2840
2899 /* 2841 /*
2900 * Check to see if we are blocking IOCB processing because of a 2842 * Check to see if we are blocking IOCB processing because of a
2901 * outstanding mbox command. 2843 * outstanding event.
2902 */ 2844 */
2903 if (unlikely(pring->flag & LPFC_STOP_IOCB_MBX)) 2845 if (unlikely(pring->flag & LPFC_STOP_IOCB_EVENT))
2904 goto iocb_busy; 2846 goto iocb_busy;
2905 2847
2906 if (unlikely(phba->link_state == LPFC_LINK_DOWN)) { 2848 if (unlikely(phba->link_state == LPFC_LINK_DOWN)) {
@@ -3847,7 +3789,6 @@ lpfc_intr_handler(int irq, void *dev_id)
3847 uint32_t ha_copy; 3789 uint32_t ha_copy;
3848 uint32_t work_ha_copy; 3790 uint32_t work_ha_copy;
3849 unsigned long status; 3791 unsigned long status;
3850 int i;
3851 uint32_t control; 3792 uint32_t control;
3852 3793
3853 MAILBOX_t *mbox, *pmbox; 3794 MAILBOX_t *mbox, *pmbox;
@@ -4066,10 +4007,6 @@ send_current_mbox:
4066 lpfc_mbox_cmpl_put(phba, pmb); 4007 lpfc_mbox_cmpl_put(phba, pmb);
4067 goto send_next_mbox; 4008 goto send_next_mbox;
4068 } 4009 }
4069 } else {
4070 /* Turn on IOCB processing */
4071 for (i = 0; i < phba->sli.num_rings; i++)
4072 lpfc_sli_turn_on_ring(phba, i);
4073 } 4010 }
4074 4011
4075 } 4012 }
diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h
index 8b1fe2f62d84..44c3fd9c22f4 100644
--- a/drivers/scsi/lpfc/lpfc_sli.h
+++ b/drivers/scsi/lpfc/lpfc_sli.h
@@ -92,8 +92,6 @@ typedef struct lpfcMboxq {
92#define MBX_POLL 1 /* poll mailbox till command done, then 92#define MBX_POLL 1 /* poll mailbox till command done, then
93 return */ 93 return */
94#define MBX_NOWAIT 2 /* issue command then return immediately */ 94#define MBX_NOWAIT 2 /* issue command then return immediately */
95#define MBX_STOP_IOCB 4 /* Stop iocb processing till mbox cmds
96 complete */
97 95
98#define LPFC_MAX_RING_MASK 4 /* max num of rctl/type masks allowed per 96#define LPFC_MAX_RING_MASK 4 /* max num of rctl/type masks allowed per
99 ring */ 97 ring */
@@ -129,9 +127,7 @@ struct lpfc_sli_ring {
129 uint16_t flag; /* ring flags */ 127 uint16_t flag; /* ring flags */
130#define LPFC_DEFERRED_RING_EVENT 0x001 /* Deferred processing a ring event */ 128#define LPFC_DEFERRED_RING_EVENT 0x001 /* Deferred processing a ring event */
131#define LPFC_CALL_RING_AVAILABLE 0x002 /* indicates cmd was full */ 129#define LPFC_CALL_RING_AVAILABLE 0x002 /* indicates cmd was full */
132#define LPFC_STOP_IOCB_MBX 0x010 /* Stop processing IOCB cmds mbox */
133#define LPFC_STOP_IOCB_EVENT 0x020 /* Stop processing IOCB cmds event */ 130#define LPFC_STOP_IOCB_EVENT 0x020 /* Stop processing IOCB cmds event */
134#define LPFC_STOP_IOCB_MASK 0x030 /* Stop processing IOCB cmds mask */
135 uint16_t abtsiotag; /* tracks next iotag to use for ABTS */ 131 uint16_t abtsiotag; /* tracks next iotag to use for ABTS */
136 132
137 uint32_t local_getidx; /* last available cmd index (from cmdGetInx) */ 133 uint32_t local_getidx; /* last available cmd index (from cmdGetInx) */