]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.15.154/scsi-qla2xxx-nvme-fcp-prefer-flag-not-being-honored.patch
6.6-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 5.15.154 / scsi-qla2xxx-nvme-fcp-prefer-flag-not-being-honored.patch
1 From 69aecdd410106dc3a8f543a4f7ec6379b995b8d0 Mon Sep 17 00:00:00 2001
2 From: Quinn Tran <qutran@marvell.com>
3 Date: Tue, 27 Feb 2024 22:11:21 +0530
4 Subject: scsi: qla2xxx: NVME|FCP prefer flag not being honored
5
6 From: Quinn Tran <qutran@marvell.com>
7
8 commit 69aecdd410106dc3a8f543a4f7ec6379b995b8d0 upstream.
9
10 Changing of [FCP|NVME] prefer flag in flash has no effect on driver. For
11 device that supports both FCP + NVMe over the same connection, driver
12 continues to connect to this device using the previous successful login
13 mode.
14
15 On completion of flash update, adapter will be reset. Driver will
16 reset the prefer flag based on setting from flash.
17
18 Cc: stable@vger.kernel.org
19 Signed-off-by: Quinn Tran <qutran@marvell.com>
20 Signed-off-by: Nilesh Javali <njavali@marvell.com>
21 Link: https://lore.kernel.org/r/20240227164127.36465-6-njavali@marvell.com
22 Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
23 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25 ---
26 drivers/scsi/qla2xxx/qla_init.c | 18 ++++++++++++++++++
27 1 file changed, 18 insertions(+)
28
29 --- a/drivers/scsi/qla2xxx/qla_init.c
30 +++ b/drivers/scsi/qla2xxx/qla_init.c
31 @@ -7582,6 +7582,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
32 struct scsi_qla_host *vp, *tvp;
33 struct req_que *req = ha->req_q_map[0];
34 unsigned long flags;
35 + fc_port_t *fcport;
36
37 if (vha->flags.online) {
38 qla2x00_abort_isp_cleanup(vha);
39 @@ -7647,6 +7648,15 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
40 "ISP Abort - ISP reg disconnect post nvmram config, exiting.\n");
41 return status;
42 }
43 +
44 + /* User may have updated [fcp|nvme] prefer in flash */
45 + list_for_each_entry(fcport, &vha->vp_fcports, list) {
46 + if (NVME_PRIORITY(ha, fcport))
47 + fcport->do_prli_nvme = 1;
48 + else
49 + fcport->do_prli_nvme = 0;
50 + }
51 +
52 if (!qla2x00_restart_isp(vha)) {
53 clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
54
55 @@ -7717,6 +7727,14 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
56 atomic_inc(&vp->vref_count);
57 spin_unlock_irqrestore(&ha->vport_slock, flags);
58
59 + /* User may have updated [fcp|nvme] prefer in flash */
60 + list_for_each_entry(fcport, &vp->vp_fcports, list) {
61 + if (NVME_PRIORITY(ha, fcport))
62 + fcport->do_prli_nvme = 1;
63 + else
64 + fcport->do_prli_nvme = 0;
65 + }
66 +
67 qla2x00_vp_abort_isp(vp);
68
69 spin_lock_irqsave(&ha->vport_slock, flags);