]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.31/scsi-qla2xxx-fix-lun-discovery-if-loop-id-is-not-assigned-yet-by-firmware.patch
Linux 4.19.31
[thirdparty/kernel/stable-queue.git] / releases / 4.19.31 / scsi-qla2xxx-fix-lun-discovery-if-loop-id-is-not-assigned-yet-by-firmware.patch
CommitLineData
df1bfe5f
GKH
1From ec322937a7f152d68755dc8316523bf6f831b48f Mon Sep 17 00:00:00 2001
2From: Himanshu Madhani <hmadhani@marvell.com>
3Date: Fri, 15 Feb 2019 14:37:12 -0800
4Subject: scsi: qla2xxx: Fix LUN discovery if loop id is not assigned yet by firmware
5
6From: Himanshu Madhani <hmadhani@marvell.com>
7
8commit ec322937a7f152d68755dc8316523bf6f831b48f upstream.
9
10This patch fixes LUN discovery when loop ID is not yet assigned by the
11firmware during driver load/sg_reset operations. Driver will now search for
12new loop id before retrying login.
13
14Fixes: 48acad099074 ("scsi: qla2xxx: Fix N2N link re-connect")
15Cc: stable@vger.kernel.org #4.19
16Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
17Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 drivers/scsi/qla2xxx/qla_init.c | 13 ++++++++-----
22 1 file changed, 8 insertions(+), 5 deletions(-)
23
24--- a/drivers/scsi/qla2xxx/qla_init.c
25+++ b/drivers/scsi/qla2xxx/qla_init.c
26@@ -643,11 +643,14 @@ static void qla24xx_handle_gnl_done_even
27 break;
28 case DSC_LS_PORT_UNAVAIL:
29 default:
30- if (fcport->loop_id != FC_NO_LOOP_ID)
31- qla2x00_clear_loop_id(fcport);
32-
33- fcport->loop_id = loop_id;
34- fcport->fw_login_state = DSC_LS_PORT_UNAVAIL;
35+ if (fcport->loop_id == FC_NO_LOOP_ID) {
36+ qla2x00_find_new_loop_id(vha, fcport);
37+ fcport->fw_login_state =
38+ DSC_LS_PORT_UNAVAIL;
39+ }
40+ ql_dbg(ql_dbg_disc, vha, 0x20e5,
41+ "%s %d %8phC\n", __func__, __LINE__,
42+ fcport->port_name);
43 qla24xx_fcport_handle_login(vha, fcport);
44 break;
45 }