scsi: qla2xxx: Fix retry for PRLI RJT with reason of BUSY
authorDarren Trapp <darren.trapp@cavium.com>
Wed, 21 Mar 2018 06:09:37 +0000 (23:09 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 21 Mar 2018 22:38:54 +0000 (18:38 -0400)
Signed-off-by: Darren Trapp <darren.trapp@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_mbx.c

index 7e9d8f08b9d541461d298b1043494c5001e52007..1abc8a9064b3a5e8a80aa56d147e611204927b11 100644 (file)
@@ -60,7 +60,7 @@
  * |                              |                    | 0xb13c-0xb140  |
  * |                              |                    | 0xb149                |
  * | MultiQ                       |       0xc010       |               |
- * | Misc                         |       0xd302       | 0xd031-0xd0ff |
+ * | Misc                         |       0xd303       | 0xd031-0xd0ff |
  * |                              |                    | 0xd101-0xd1fe |
  * |                              |                    | 0xd214-0xd2fe |
  * | Target Mode                 |       0xe081       |                |
index 33823d74c78241197ef2a61098be5eebc8bb80ed..15a96dc205d00e2e99b9a746d38cc6e0fb2771d3 100644 (file)
@@ -880,7 +880,6 @@ qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport)
                return rval;
 
        if (fcport->fw_login_state == DSC_LS_PLOGI_PEND ||
-           fcport->fw_login_state == DSC_LS_PLOGI_COMP ||
            fcport->fw_login_state == DSC_LS_PRLI_PEND)
                return rval;
 
@@ -1238,6 +1237,11 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
                qla2x00_post_async_adisc_work(vha, fcport, data);
                break;
 
+       case DSC_LOGIN_PEND:
+               if (fcport->fw_login_state == DSC_LS_PLOGI_COMP)
+                       qla24xx_post_prli_work(vha, fcport);
+               break;
+
        default:
                break;
        }
@@ -1640,6 +1644,13 @@ qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea)
                qla24xx_post_gpdb_work(vha, ea->fcport, 0);
                break;
        default:
+               if ((ea->iop[0] == LSC_SCODE_ELS_REJECT) &&
+                   (ea->iop[1] == 0x50000)) {   /* reson 5=busy expl:0x0 */
+                       set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
+                       ea->fcport->fw_login_state = DSC_LS_PLOGI_COMP;
+                       break;
+               }
+
                if (ea->fcport->n2n_flag) {
                        ql_dbg(ql_dbg_disc, vha, 0x2118,
                                "%s %d %8phC post fc4 prli\n",
index 735079ba691c63ead9837b1259315044a6859e5e..c9a134ae0d2b127adebd460438af54f1ab732922 100644 (file)
@@ -1025,9 +1025,12 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha)
                 * FW supports nvme and driver load parameter requested nvme.
                 * BIT 26 of fw_attributes indicates NVMe support.
                 */
-               if ((ha->fw_attributes_h & 0x400) && ql2xnvmeenable)
+               if ((ha->fw_attributes_h & 0x400) && ql2xnvmeenable) {
                        vha->flags.nvme_enabled = 1;
-
+                       ql_log(ql_log_info, vha, 0xd302,
+                           "%s: FC-NVMe is Enabled (0x%x)\n",
+                            __func__, ha->fw_attributes_h);
+               }
        }
 
        if (IS_QLA27XX(ha)) {