]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
scsi: qla2xxx: NVME|FCP prefer flag not being honored
authorQuinn Tran <qutran@marvell.com>
Tue, 27 Feb 2024 16:41:21 +0000 (22:11 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:34 +0000 (16:19 +0200)
commit 69aecdd410106dc3a8f543a4f7ec6379b995b8d0 upstream.

Changing of [FCP|NVME] prefer flag in flash has no effect on driver. For
device that supports both FCP + NVMe over the same connection, driver
continues to connect to this device using the previous successful login
mode.

On completion of flash update, adapter will be reset. Driver will
reset the prefer flag based on setting from flash.

Cc: stable@vger.kernel.org
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20240227164127.36465-6-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.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 733a51c46c7bfcc7582ab5b73eb38ffa9b45e4db..585df40e95bb07ae1f61482c3d02916076ac57f5 100644 (file)
@@ -7582,6 +7582,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
        struct scsi_qla_host *vp, *tvp;
        struct req_que *req = ha->req_q_map[0];
        unsigned long flags;
+       fc_port_t *fcport;
 
        if (vha->flags.online) {
                qla2x00_abort_isp_cleanup(vha);
@@ -7647,6 +7648,15 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
                               "ISP Abort - ISP reg disconnect post nvmram config, exiting.\n");
                        return status;
                }
+
+               /* User may have updated [fcp|nvme] prefer in flash */
+               list_for_each_entry(fcport, &vha->vp_fcports, list) {
+                       if (NVME_PRIORITY(ha, fcport))
+                               fcport->do_prli_nvme = 1;
+                       else
+                               fcport->do_prli_nvme = 0;
+               }
+
                if (!qla2x00_restart_isp(vha)) {
                        clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
 
@@ -7717,6 +7727,14 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
                                atomic_inc(&vp->vref_count);
                                spin_unlock_irqrestore(&ha->vport_slock, flags);
 
+                               /* User may have updated [fcp|nvme] prefer in flash */
+                               list_for_each_entry(fcport, &vp->vp_fcports, list) {
+                                       if (NVME_PRIORITY(ha, fcport))
+                                               fcport->do_prli_nvme = 1;
+                                       else
+                                               fcport->do_prli_nvme = 0;
+                               }
+
                                qla2x00_vp_abort_isp(vp);
 
                                spin_lock_irqsave(&ha->vport_slock, flags);