]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: qla2xxx: Fix LUN discovery if loop id is not assigned yet by firmware
authorHimanshu Madhani <hmadhani@marvell.com>
Fri, 15 Feb 2019 22:37:12 +0000 (14:37 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:09:59 +0000 (20:09 +0100)
commit ec322937a7f152d68755dc8316523bf6f831b48f upstream.

This patch fixes LUN discovery when loop ID is not yet assigned by the
firmware during driver load/sg_reset operations. Driver will now search for
new loop id before retrying login.

Fixes: 48acad099074 ("scsi: qla2xxx: Fix N2N link re-connect")
Cc: stable@vger.kernel.org #4.19
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/qla2xxx/qla_init.c

index 2271a2cd29d2b7af23ea95998c43c1aabb2cb45d..f84f9bf15027817f89c7d5e4c6695b17a8f90ac2 100644 (file)
@@ -643,11 +643,14 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha,
                                break;
                        case DSC_LS_PORT_UNAVAIL:
                        default:
-                               if (fcport->loop_id != FC_NO_LOOP_ID)
-                                       qla2x00_clear_loop_id(fcport);
-
-                               fcport->loop_id = loop_id;
-                               fcport->fw_login_state = DSC_LS_PORT_UNAVAIL;
+                               if (fcport->loop_id == FC_NO_LOOP_ID) {
+                                       qla2x00_find_new_loop_id(vha, fcport);
+                                       fcport->fw_login_state =
+                                           DSC_LS_PORT_UNAVAIL;
+                               }
+                               ql_dbg(ql_dbg_disc, vha, 0x20e5,
+                                   "%s %d %8phC\n", __func__, __LINE__,
+                                   fcport->port_name);
                                qla24xx_fcport_handle_login(vha, fcport);
                                break;
                        }