diff options
author | Quinn Tran <quinn.tran@cavium.com> | 2018-08-02 16:16:44 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-08-02 16:56:18 -0400 |
commit | 48acad099074984f6b0b6e4da011856ba25d12ba (patch) | |
tree | fc778df767e97dc08b50a2bded6705e2a75caddd | |
parent | 4ae5716b4188d20178fdcaa39561fa50f6e6b513 (diff) |
scsi: qla2xxx: Fix N2N link re-connect
In case of N2N connect, sg_reset for bus/device/host was causing driver and
firmware state to go out of sync. This patch fixes this link instablity
when reconnect is attempted after link flap.
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 227 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 15 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 27 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 5 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.c | 9 |
7 files changed, 181 insertions, 108 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 9442e18aef6f..ee4d1f4fdf95 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -377,6 +377,7 @@ struct srb_iocb { | |||
377 | #define SRB_LOGIN_COND_PLOGI BIT_1 | 377 | #define SRB_LOGIN_COND_PLOGI BIT_1 |
378 | #define SRB_LOGIN_SKIP_PRLI BIT_2 | 378 | #define SRB_LOGIN_SKIP_PRLI BIT_2 |
379 | #define SRB_LOGIN_NVME_PRLI BIT_3 | 379 | #define SRB_LOGIN_NVME_PRLI BIT_3 |
380 | #define SRB_LOGIN_PRLI_ONLY BIT_4 | ||
380 | uint16_t data[2]; | 381 | uint16_t data[2]; |
381 | u32 iop[2]; | 382 | u32 iop[2]; |
382 | } logio; | 383 | } logio; |
@@ -4236,7 +4237,7 @@ typedef struct scsi_qla_host { | |||
4236 | #define FCOE_CTX_RESET_NEEDED 18 /* Initiate FCoE context reset */ | 4237 | #define FCOE_CTX_RESET_NEEDED 18 /* Initiate FCoE context reset */ |
4237 | #define MPI_RESET_NEEDED 19 /* Initiate MPI FW reset */ | 4238 | #define MPI_RESET_NEEDED 19 /* Initiate MPI FW reset */ |
4238 | #define ISP_QUIESCE_NEEDED 20 /* Driver need some quiescence */ | 4239 | #define ISP_QUIESCE_NEEDED 20 /* Driver need some quiescence */ |
4239 | #define FREE_BIT 21 | 4240 | #define N2N_LINK_RESET 21 |
4240 | #define PORT_UPDATE_NEEDED 22 | 4241 | #define PORT_UPDATE_NEEDED 22 |
4241 | #define FX00_RESET_RECOVERY 23 | 4242 | #define FX00_RESET_RECOVERY 23 |
4242 | #define FX00_TARGET_SCAN 24 | 4243 | #define FX00_TARGET_SCAN 24 |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 1de78697dc0d..52e163553e90 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -160,6 +160,22 @@ qla2x00_async_login_sp_done(void *ptr, int res) | |||
160 | sp->free(sp); | 160 | sp->free(sp); |
161 | } | 161 | } |
162 | 162 | ||
163 | static inline bool | ||
164 | fcport_is_smaller(fc_port_t *fcport) | ||
165 | { | ||
166 | if (wwn_to_u64(fcport->port_name) < | ||
167 | wwn_to_u64(fcport->vha->port_name)) | ||
168 | return true; | ||
169 | else | ||
170 | return false; | ||
171 | } | ||
172 | |||
173 | static inline bool | ||
174 | fcport_is_bigger(fc_port_t *fcport) | ||
175 | { | ||
176 | return !fcport_is_smaller(fcport); | ||
177 | } | ||
178 | |||
163 | int | 179 | int |
164 | qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, | 180 | qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, |
165 | uint16_t *data) | 181 | uint16_t *data) |
@@ -189,13 +205,18 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, | |||
189 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | 205 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); |
190 | 206 | ||
191 | sp->done = qla2x00_async_login_sp_done; | 207 | sp->done = qla2x00_async_login_sp_done; |
192 | lio->u.logio.flags |= SRB_LOGIN_COND_PLOGI; | 208 | if (N2N_TOPO(fcport->vha->hw) && fcport_is_bigger(fcport)) { |
209 | lio->u.logio.flags |= SRB_LOGIN_PRLI_ONLY; | ||
210 | } else { | ||
211 | lio->u.logio.flags |= SRB_LOGIN_COND_PLOGI; | ||
193 | 212 | ||
194 | if (fcport->fc4f_nvme) | 213 | if (fcport->fc4f_nvme) |
195 | lio->u.logio.flags |= SRB_LOGIN_SKIP_PRLI; | 214 | lio->u.logio.flags |= SRB_LOGIN_SKIP_PRLI; |
215 | |||
216 | if (data[1] & QLA_LOGIO_LOGIN_RETRIED) | ||
217 | lio->u.logio.flags |= SRB_LOGIN_RETRIED; | ||
218 | } | ||
196 | 219 | ||
197 | if (data[1] & QLA_LOGIO_LOGIN_RETRIED) | ||
198 | lio->u.logio.flags |= SRB_LOGIN_RETRIED; | ||
199 | rval = qla2x00_start_sp(sp); | 220 | rval = qla2x00_start_sp(sp); |
200 | if (rval != QLA_SUCCESS) { | 221 | if (rval != QLA_SUCCESS) { |
201 | fcport->flags |= FCF_LOGIN_NEEDED; | 222 | fcport->flags |= FCF_LOGIN_NEEDED; |
@@ -497,15 +518,18 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, | |||
497 | for (i = 0; i < n; i++) { | 518 | for (i = 0; i < n; i++) { |
498 | e = &vha->gnl.l[i]; | 519 | e = &vha->gnl.l[i]; |
499 | wwn = wwn_to_u64(e->port_name); | 520 | wwn = wwn_to_u64(e->port_name); |
521 | id.b.domain = e->port_id[2]; | ||
522 | id.b.area = e->port_id[1]; | ||
523 | id.b.al_pa = e->port_id[0]; | ||
524 | id.b.rsvd_1 = 0; | ||
500 | 525 | ||
501 | if (memcmp((u8 *)&wwn, fcport->port_name, WWN_SIZE)) | 526 | if (memcmp((u8 *)&wwn, fcport->port_name, WWN_SIZE)) |
502 | continue; | 527 | continue; |
503 | 528 | ||
529 | if (IS_SW_RESV_ADDR(id)) | ||
530 | continue; | ||
531 | |||
504 | found = 1; | 532 | found = 1; |
505 | id.b.domain = e->port_id[2]; | ||
506 | id.b.area = e->port_id[1]; | ||
507 | id.b.al_pa = e->port_id[0]; | ||
508 | id.b.rsvd_1 = 0; | ||
509 | 533 | ||
510 | loop_id = le16_to_cpu(e->nport_handle); | 534 | loop_id = le16_to_cpu(e->nport_handle); |
511 | loop_id = (loop_id & 0x7fff); | 535 | loop_id = (loop_id & 0x7fff); |
@@ -518,14 +542,18 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, | |||
518 | fcport->d_id.b.domain, fcport->d_id.b.area, | 542 | fcport->d_id.b.domain, fcport->d_id.b.area, |
519 | fcport->d_id.b.al_pa, loop_id, fcport->loop_id); | 543 | fcport->d_id.b.al_pa, loop_id, fcport->loop_id); |
520 | 544 | ||
521 | if ((id.b24 != fcport->d_id.b24) || | 545 | switch (fcport->disc_state) { |
522 | ((fcport->loop_id != FC_NO_LOOP_ID) && | 546 | case DSC_DELETE_PEND: |
523 | (fcport->loop_id != loop_id))) { | 547 | case DSC_DELETED: |
524 | ql_dbg(ql_dbg_disc, vha, 0x20e3, | 548 | break; |
525 | "%s %d %8phC post del sess\n", | 549 | default: |
526 | __func__, __LINE__, fcport->port_name); | 550 | if ((id.b24 != fcport->d_id.b24) || |
527 | qlt_schedule_sess_for_deletion(fcport); | 551 | ((fcport->loop_id != FC_NO_LOOP_ID) && |
528 | return; | 552 | (fcport->loop_id != loop_id))) { |
553 | qlt_schedule_sess_for_deletion(fcport); | ||
554 | return; | ||
555 | } | ||
556 | break; | ||
529 | } | 557 | } |
530 | 558 | ||
531 | fcport->loop_id = loop_id; | 559 | fcport->loop_id = loop_id; |
@@ -544,66 +572,122 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, | |||
544 | fcport->login_pause = 1; | 572 | fcport->login_pause = 1; |
545 | } | 573 | } |
546 | 574 | ||
547 | if (fcport->fc4f_nvme) | 575 | if (fcport->fc4f_nvme) |
548 | current_login_state = e->current_login_state >> 4; | 576 | current_login_state = e->current_login_state >> 4; |
549 | else | 577 | else |
550 | current_login_state = e->current_login_state & 0xf; | 578 | current_login_state = e->current_login_state & 0xf; |
551 | 579 | ||
552 | switch (current_login_state) { | 580 | switch (vha->hw->current_topology) { |
553 | case DSC_LS_PRLI_COMP: | 581 | default: |
554 | ql_dbg(ql_dbg_disc, vha, 0x20e4, | 582 | switch (current_login_state) { |
555 | "%s %d %8phC post gpdb\n", | 583 | case DSC_LS_PRLI_COMP: |
556 | __func__, __LINE__, fcport->port_name); | 584 | ql_dbg(ql_dbg_disc + ql_dbg_verbose, |
585 | vha, 0x20e4, "%s %d %8phC post gpdb\n", | ||
586 | __func__, __LINE__, fcport->port_name); | ||
557 | 587 | ||
558 | if ((e->prli_svc_param_word_3[0] & BIT_4) == 0) | 588 | if ((e->prli_svc_param_word_3[0] & BIT_4) == 0) |
559 | fcport->port_type = FCT_INITIATOR; | 589 | fcport->port_type = FCT_INITIATOR; |
560 | else | 590 | else |
561 | fcport->port_type = FCT_TARGET; | 591 | fcport->port_type = FCT_TARGET; |
592 | data[0] = data[1] = 0; | ||
593 | qla2x00_post_async_adisc_work(vha, fcport, | ||
594 | data); | ||
595 | break; | ||
596 | case DSC_LS_PORT_UNAVAIL: | ||
597 | default: | ||
598 | if (fcport->loop_id != FC_NO_LOOP_ID) | ||
599 | qla2x00_clear_loop_id(fcport); | ||
562 | 600 | ||
563 | data[0] = data[1] = 0; | 601 | fcport->loop_id = loop_id; |
564 | qla2x00_post_async_adisc_work(vha, fcport, data); | ||
565 | break; | ||
566 | case DSC_LS_PORT_UNAVAIL: | ||
567 | default: | ||
568 | if (fcport->loop_id == FC_NO_LOOP_ID) { | ||
569 | qla2x00_find_new_loop_id(vha, fcport); | ||
570 | fcport->fw_login_state = DSC_LS_PORT_UNAVAIL; | 602 | fcport->fw_login_state = DSC_LS_PORT_UNAVAIL; |
603 | qla24xx_fcport_handle_login(vha, fcport); | ||
604 | break; | ||
571 | } | 605 | } |
572 | ql_dbg(ql_dbg_disc, vha, 0x20e5, | ||
573 | "%s %d %8phC\n", | ||
574 | __func__, __LINE__, fcport->port_name); | ||
575 | qla24xx_fcport_handle_login(vha, fcport); | ||
576 | break; | 606 | break; |
577 | } | 607 | case ISP_CFG_N: |
608 | switch (current_login_state) { | ||
609 | case DSC_LS_PRLI_COMP: | ||
610 | if ((e->prli_svc_param_word_3[0] & BIT_4) == 0) | ||
611 | fcport->port_type = FCT_INITIATOR; | ||
612 | else | ||
613 | fcport->port_type = FCT_TARGET; | ||
614 | |||
615 | data[0] = data[1] = 0; | ||
616 | qla2x00_post_async_adisc_work(vha, fcport, | ||
617 | data); | ||
618 | break; | ||
619 | case DSC_LS_PLOGI_COMP: | ||
620 | if (fcport_is_bigger(fcport)) { | ||
621 | /* local adapter is smaller */ | ||
622 | if (fcport->loop_id != FC_NO_LOOP_ID) | ||
623 | qla2x00_clear_loop_id(fcport); | ||
624 | |||
625 | fcport->loop_id = loop_id; | ||
626 | qla24xx_fcport_handle_login(vha, | ||
627 | fcport); | ||
628 | break; | ||
629 | } | ||
630 | /* drop through */ | ||
631 | default: | ||
632 | if (fcport_is_smaller(fcport)) { | ||
633 | /* local adapter is bigger */ | ||
634 | if (fcport->loop_id != FC_NO_LOOP_ID) | ||
635 | qla2x00_clear_loop_id(fcport); | ||
636 | |||
637 | fcport->loop_id = loop_id; | ||
638 | qla24xx_fcport_handle_login(vha, | ||
639 | fcport); | ||
640 | } | ||
641 | break; | ||
642 | } | ||
643 | break; | ||
644 | } /* switch (ha->current_topology) */ | ||
578 | } | 645 | } |
579 | 646 | ||
580 | if (!found) { | 647 | if (!found) { |
581 | /* fw has no record of this port */ | 648 | switch (vha->hw->current_topology) { |
582 | for (i = 0; i < n; i++) { | 649 | case ISP_CFG_F: |
583 | e = &vha->gnl.l[i]; | 650 | case ISP_CFG_FL: |
584 | id.b.domain = e->port_id[0]; | 651 | for (i = 0; i < n; i++) { |
585 | id.b.area = e->port_id[1]; | 652 | e = &vha->gnl.l[i]; |
586 | id.b.al_pa = e->port_id[2]; | 653 | id.b.domain = e->port_id[0]; |
587 | id.b.rsvd_1 = 0; | 654 | id.b.area = e->port_id[1]; |
588 | loop_id = le16_to_cpu(e->nport_handle); | 655 | id.b.al_pa = e->port_id[2]; |
589 | 656 | id.b.rsvd_1 = 0; | |
590 | if (fcport->d_id.b24 == id.b24) { | 657 | loop_id = le16_to_cpu(e->nport_handle); |
591 | conflict_fcport = | 658 | |
592 | qla2x00_find_fcport_by_wwpn(vha, | 659 | if (fcport->d_id.b24 == id.b24) { |
593 | e->port_name, 0); | 660 | conflict_fcport = |
594 | ql_dbg(ql_dbg_disc, vha, 0x20e6, | 661 | qla2x00_find_fcport_by_wwpn(vha, |
595 | "%s %d %8phC post del sess\n", | 662 | e->port_name, 0); |
596 | __func__, __LINE__, | 663 | ql_dbg(ql_dbg_disc + ql_dbg_verbose, |
597 | conflict_fcport->port_name); | 664 | vha, 0x20e5, |
598 | qlt_schedule_sess_for_deletion | 665 | "%s %d %8phC post del sess\n", |
599 | (conflict_fcport); | 666 | __func__, __LINE__, |
667 | conflict_fcport->port_name); | ||
668 | qlt_schedule_sess_for_deletion | ||
669 | (conflict_fcport); | ||
670 | } | ||
671 | /* | ||
672 | * FW already picked this loop id for | ||
673 | * another fcport | ||
674 | */ | ||
675 | if (fcport->loop_id == loop_id) | ||
676 | fcport->loop_id = FC_NO_LOOP_ID; | ||
600 | } | 677 | } |
601 | 678 | qla24xx_fcport_handle_login(vha, fcport); | |
602 | /* FW already picked this loop id for another fcport */ | 679 | break; |
603 | if (fcport->loop_id == loop_id) | 680 | case ISP_CFG_N: |
604 | fcport->loop_id = FC_NO_LOOP_ID; | 681 | /* |
682 | * FW handles the initial login for n2n. | ||
683 | * Do link reinit to trigger this auto login. | ||
684 | */ | ||
685 | set_bit(N2N_LINK_RESET, &vha->dpc_flags); | ||
686 | qla2xxx_wake_dpc(vha); | ||
687 | break; | ||
688 | default: | ||
689 | break; | ||
605 | } | 690 | } |
606 | qla24xx_fcport_handle_login(vha, fcport); | ||
607 | } | 691 | } |
608 | } /* gnl_event */ | 692 | } /* gnl_event */ |
609 | 693 | ||
@@ -4590,20 +4674,10 @@ qla2x00_configure_loop(scsi_qla_host_t *vha) | |||
4590 | 4674 | ||
4591 | } else if (ha->current_topology == ISP_CFG_N) { | 4675 | } else if (ha->current_topology == ISP_CFG_N) { |
4592 | clear_bit(RSCN_UPDATE, &flags); | 4676 | clear_bit(RSCN_UPDATE, &flags); |
4593 | if (ha->flags.rida_fmt2) { | 4677 | if (qla_tgt_mode_enabled(vha)) { |
4594 | /* With Rida Format 2, the login is already triggered. | 4678 | /* allow the other side to start the login */ |
4595 | * We know who is on the other side of the wire. | ||
4596 | * No need to login to do login to find out or drop into | ||
4597 | * qla2x00_configure_local_loop(). | ||
4598 | */ | ||
4599 | clear_bit(LOCAL_LOOP_UPDATE, &flags); | 4679 | clear_bit(LOCAL_LOOP_UPDATE, &flags); |
4600 | set_bit(RELOGIN_NEEDED, &vha->dpc_flags); | 4680 | set_bit(RELOGIN_NEEDED, &vha->dpc_flags); |
4601 | } else { | ||
4602 | if (qla_tgt_mode_enabled(vha)) { | ||
4603 | /* allow the other side to start the login */ | ||
4604 | clear_bit(LOCAL_LOOP_UPDATE, &flags); | ||
4605 | set_bit(RELOGIN_NEEDED, &vha->dpc_flags); | ||
4606 | } | ||
4607 | } | 4681 | } |
4608 | } else if (ha->current_topology == ISP_CFG_NL) { | 4682 | } else if (ha->current_topology == ISP_CFG_NL) { |
4609 | clear_bit(RSCN_UPDATE, &flags); | 4683 | clear_bit(RSCN_UPDATE, &flags); |
@@ -7929,8 +8003,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) | |||
7929 | } | 8003 | } |
7930 | 8004 | ||
7931 | /* enable RIDA Format2 */ | 8005 | /* enable RIDA Format2 */ |
7932 | if (qla_tgt_mode_enabled(vha) || qla_dual_mode_enabled(vha)) | 8006 | icb->firmware_options_3 |= BIT_0; |
7933 | icb->firmware_options_3 |= BIT_0; | ||
7934 | 8007 | ||
7935 | if (IS_QLA27XX(ha)) { | 8008 | if (IS_QLA27XX(ha)) { |
7936 | icb->firmware_options_3 |= BIT_8; | 8009 | icb->firmware_options_3 |= BIT_8; |
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index b349e9b94c08..e1ff2e27e59f 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c | |||
@@ -2240,12 +2240,15 @@ qla24xx_login_iocb(srb_t *sp, struct logio_entry_24xx *logio) | |||
2240 | struct srb_iocb *lio = &sp->u.iocb_cmd; | 2240 | struct srb_iocb *lio = &sp->u.iocb_cmd; |
2241 | 2241 | ||
2242 | logio->entry_type = LOGINOUT_PORT_IOCB_TYPE; | 2242 | logio->entry_type = LOGINOUT_PORT_IOCB_TYPE; |
2243 | logio->control_flags = cpu_to_le16(LCF_COMMAND_PLOGI); | 2243 | if (lio->u.logio.flags & SRB_LOGIN_PRLI_ONLY) { |
2244 | 2244 | logio->control_flags = cpu_to_le16(LCF_COMMAND_PRLI); | |
2245 | if (lio->u.logio.flags & SRB_LOGIN_COND_PLOGI) | 2245 | } else { |
2246 | logio->control_flags |= cpu_to_le16(LCF_COND_PLOGI); | 2246 | logio->control_flags = cpu_to_le16(LCF_COMMAND_PLOGI); |
2247 | if (lio->u.logio.flags & SRB_LOGIN_SKIP_PRLI) | 2247 | if (lio->u.logio.flags & SRB_LOGIN_COND_PLOGI) |
2248 | logio->control_flags |= cpu_to_le16(LCF_SKIP_PRLI); | 2248 | logio->control_flags |= cpu_to_le16(LCF_COND_PLOGI); |
2249 | if (lio->u.logio.flags & SRB_LOGIN_SKIP_PRLI) | ||
2250 | logio->control_flags |= cpu_to_le16(LCF_SKIP_PRLI); | ||
2251 | } | ||
2249 | logio->nport_handle = cpu_to_le16(sp->fcport->loop_id); | 2252 | logio->nport_handle = cpu_to_le16(sp->fcport->loop_id); |
2250 | logio->port_id[0] = sp->fcport->d_id.b.al_pa; | 2253 | logio->port_id[0] = sp->fcport->d_id.b.al_pa; |
2251 | logio->port_id[1] = sp->fcport->d_id.b.area; | 2254 | logio->port_id[1] = sp->fcport->d_id.b.area; |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 9fa5a2557f2c..e90fb17d2121 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -908,7 +908,8 @@ skip_rio: | |||
908 | if (!atomic_read(&vha->loop_down_timer)) | 908 | if (!atomic_read(&vha->loop_down_timer)) |
909 | atomic_set(&vha->loop_down_timer, | 909 | atomic_set(&vha->loop_down_timer, |
910 | LOOP_DOWN_TIME); | 910 | LOOP_DOWN_TIME); |
911 | qla2x00_mark_all_devices_lost(vha, 1); | 911 | if (!N2N_TOPO(ha)) |
912 | qla2x00_mark_all_devices_lost(vha, 1); | ||
912 | } | 913 | } |
913 | 914 | ||
914 | if (vha->vp_idx) { | 915 | if (vha->vp_idx) { |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 7e875f575229..4e42ce057a37 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -2177,7 +2177,10 @@ qla2x00_lip_reset(scsi_qla_host_t *vha) | |||
2177 | mcp->out_mb = MBX_2|MBX_1|MBX_0; | 2177 | mcp->out_mb = MBX_2|MBX_1|MBX_0; |
2178 | } else if (IS_FWI2_CAPABLE(vha->hw)) { | 2178 | } else if (IS_FWI2_CAPABLE(vha->hw)) { |
2179 | mcp->mb[0] = MBC_LIP_FULL_LOGIN; | 2179 | mcp->mb[0] = MBC_LIP_FULL_LOGIN; |
2180 | mcp->mb[1] = BIT_6; | 2180 | if (N2N_TOPO(vha->hw)) |
2181 | mcp->mb[1] = BIT_4; /* re-init */ | ||
2182 | else | ||
2183 | mcp->mb[1] = BIT_6; /* LIP */ | ||
2181 | mcp->mb[2] = 0; | 2184 | mcp->mb[2] = 0; |
2182 | mcp->mb[3] = vha->hw->loop_reset_delay; | 2185 | mcp->mb[3] = vha->hw->loop_reset_delay; |
2183 | mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; | 2186 | mcp->out_mb = MBX_3|MBX_2|MBX_1|MBX_0; |
@@ -3911,28 +3914,6 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, | |||
3911 | if (fcport) { | 3914 | if (fcport) { |
3912 | fcport->plogi_nack_done_deadline = jiffies + HZ; | 3915 | fcport->plogi_nack_done_deadline = jiffies + HZ; |
3913 | fcport->scan_state = QLA_FCPORT_FOUND; | 3916 | fcport->scan_state = QLA_FCPORT_FOUND; |
3914 | switch (fcport->disc_state) { | ||
3915 | case DSC_DELETED: | ||
3916 | ql_dbg(ql_dbg_disc, vha, 0x210d, | ||
3917 | "%s %d %8phC login\n", | ||
3918 | __func__, __LINE__, fcport->port_name); | ||
3919 | qla24xx_fcport_handle_login(vha, fcport); | ||
3920 | break; | ||
3921 | case DSC_DELETE_PEND: | ||
3922 | break; | ||
3923 | default: | ||
3924 | qlt_schedule_sess_for_deletion(fcport); | ||
3925 | break; | ||
3926 | } | ||
3927 | } else { | ||
3928 | id.b.al_pa = rptid_entry->u.f2.remote_nport_id[0]; | ||
3929 | id.b.area = rptid_entry->u.f2.remote_nport_id[1]; | ||
3930 | id.b.domain = rptid_entry->u.f2.remote_nport_id[2]; | ||
3931 | qla24xx_post_newsess_work(vha, &id, | ||
3932 | rptid_entry->u.f2.port_name, | ||
3933 | rptid_entry->u.f2.node_name, | ||
3934 | NULL, | ||
3935 | FC4_TYPE_UNKNOWN); | ||
3936 | } | 3917 | } |
3937 | } | 3918 | } |
3938 | } | 3919 | } |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index e881fce7477a..eb804e2feedf 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -6186,6 +6186,11 @@ intr_on_check: | |||
6186 | if (!IS_QLAFX00(ha)) | 6186 | if (!IS_QLAFX00(ha)) |
6187 | qla2x00_do_dpc_all_vps(base_vha); | 6187 | qla2x00_do_dpc_all_vps(base_vha); |
6188 | 6188 | ||
6189 | if (test_and_clear_bit(N2N_LINK_RESET, | ||
6190 | &base_vha->dpc_flags)) { | ||
6191 | qla2x00_lip_reset(base_vha); | ||
6192 | } | ||
6193 | |||
6189 | ha->dpc_active = 0; | 6194 | ha->dpc_active = 0; |
6190 | end_loop: | 6195 | end_loop: |
6191 | set_current_state(TASK_INTERRUPTIBLE); | 6196 | set_current_state(TASK_INTERRUPTIBLE); |
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 3de11153d1d3..9d10989ed027 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c | |||
@@ -805,6 +805,10 @@ qlt_plogi_ack_find_add(struct scsi_qla_host *vha, port_id_t *id, | |||
805 | 805 | ||
806 | list_for_each_entry(pla, &vha->plogi_ack_list, list) { | 806 | list_for_each_entry(pla, &vha->plogi_ack_list, list) { |
807 | if (pla->id.b24 == id->b24) { | 807 | if (pla->id.b24 == id->b24) { |
808 | ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0x210d, | ||
809 | "%s %d %8phC Term INOT due to new INOT", | ||
810 | __func__, __LINE__, | ||
811 | pla->iocb.u.isp24.port_name); | ||
808 | qlt_send_term_imm_notif(vha, &pla->iocb, 1); | 812 | qlt_send_term_imm_notif(vha, &pla->iocb, 1); |
809 | memcpy(&pla->iocb, iocb, sizeof(pla->iocb)); | 813 | memcpy(&pla->iocb, iocb, sizeof(pla->iocb)); |
810 | return pla; | 814 | return pla; |
@@ -1073,6 +1077,7 @@ void qlt_free_session_done(struct work_struct *work) | |||
1073 | struct qlt_plogi_ack_t *con = | 1077 | struct qlt_plogi_ack_t *con = |
1074 | sess->plogi_link[QLT_PLOGI_LINK_CONFLICT]; | 1078 | sess->plogi_link[QLT_PLOGI_LINK_CONFLICT]; |
1075 | struct imm_ntfy_from_isp *iocb; | 1079 | struct imm_ntfy_from_isp *iocb; |
1080 | own = sess->plogi_link[QLT_PLOGI_LINK_SAME_WWN]; | ||
1076 | 1081 | ||
1077 | if (con) { | 1082 | if (con) { |
1078 | iocb = &con->iocb; | 1083 | iocb = &con->iocb; |
@@ -4716,6 +4721,10 @@ static int qlt_handle_login(struct scsi_qla_host *vha, | |||
4716 | 4721 | ||
4717 | pla = qlt_plogi_ack_find_add(vha, &port_id, iocb); | 4722 | pla = qlt_plogi_ack_find_add(vha, &port_id, iocb); |
4718 | if (!pla) { | 4723 | if (!pla) { |
4724 | ql_dbg(ql_dbg_disc + ql_dbg_verbose, vha, 0xffff, | ||
4725 | "%s %d %8phC Term INOT due to mem alloc fail", | ||
4726 | __func__, __LINE__, | ||
4727 | iocb->u.isp24.port_name); | ||
4719 | qlt_send_term_imm_notif(vha, iocb, 1); | 4728 | qlt_send_term_imm_notif(vha, iocb, 1); |
4720 | goto out; | 4729 | goto out; |
4721 | } | 4730 | } |