diff mbox series

[1/2] scsi: qla2xxx: initialize fc4_type_priority

Message ID 20191107164848.31837-1-martin.wilck@suse.com (mailing list archive)
State Superseded
Headers show
Series [1/2] scsi: qla2xxx: initialize fc4_type_priority | expand

Commit Message

Martin Wilck Nov. 7, 2019, 4:49 p.m. UTC
From: Martin Wilck <mwilck@suse.com>

ha->fc4_type_priority is currently initialized only in
qla81xx_nvram_config(). That makes it default to NVMe for other adapters.
Fix it.

Fixes: 84ed362ac40c ("scsi: qla2xxx: Dual FCP-NVMe target port support")
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Martin Wilck Nov. 7, 2019, 9:04 p.m. UTC | #1
On Thu, 2019-11-07 at 16:49 +0000, Martin Wilck wrote:
> From: Martin Wilck <mwilck@suse.com>
> 
> ha->fc4_type_priority is currently initialized only in
> qla81xx_nvram_config(). That makes it default to NVMe for other
> adapters.
> Fix it.
> 
> Fixes: 84ed362ac40c ("scsi: qla2xxx: Dual FCP-NVMe target port
> support")
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  drivers/scsi/qla2xxx/qla_init.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)

Tested-by: David Bond <dbond@suse.com>
Bart Van Assche Nov. 7, 2019, 9:29 p.m. UTC | #2
On 11/7/19 8:49 AM, Martin Wilck wrote:
> From: Martin Wilck <mwilck@suse.com>
> 
> ha->fc4_type_priority is currently initialized only in
> qla81xx_nvram_config(). That makes it default to NVMe for other adapters.
> Fix it.
> 
> Fixes: 84ed362ac40c ("scsi: qla2xxx: Dual FCP-NVMe target port support")
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>   drivers/scsi/qla2xxx/qla_init.c | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
> index 7cb7545..2a016a8 100644
> --- a/drivers/scsi/qla2xxx/qla_init.c
> +++ b/drivers/scsi/qla2xxx/qla_init.c
> @@ -2214,8 +2214,18 @@ qla2x00_initialize_adapter(scsi_qla_host_t *vha)
>   	ql_dbg(ql_dbg_init, vha, 0x0061,
>   	    "Configure NVRAM parameters...\n");
>   
> +	/* Let priority default to FCP, can be overridden by nvram_config */
> +	ha->fc4_type_priority = FC4_PRIORITY_FCP;
> +
>   	ha->isp_ops->nvram_config(vha);
>   
> +	if (ha->fc4_type_priority != FC4_PRIORITY_FCP &&
> +	    ha->fc4_type_priority != FC4_PRIORITY_NVME)
> +		ha->fc4_type_priority = FC4_PRIORITY_FCP;
> +
> +	ql_log(ql_log_info, vha, 0xffff, "FC4 priority set to %s\n",
> +	       ha->fc4_type_priority == FC4_PRIORITY_FCP ? "FCP" : "NVMe");
> +
>   	if (ha->flags.disable_serdes) {
>   		/* Mask HBA via NVRAM settings? */
>   		ql_log(ql_log_info, vha, 0x0077,
> @@ -8521,8 +8531,6 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
>   
>   	/* Determine NVMe/FCP priority for target ports */
>   	ha->fc4_type_priority = qla2xxx_get_fc4_priority(vha);
> -	ql_log(ql_log_info, vha, 0xffff, "FC4 priority set to %s\n",
> -	    ha->fc4_type_priority & BIT_0 ? "FCP" : "NVMe");
>   
>   	if (rval) {
>   		ql_log(ql_log_warn, vha, 0x0076,

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 7cb7545..2a016a8 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2214,8 +2214,18 @@  qla2x00_initialize_adapter(scsi_qla_host_t *vha)
 	ql_dbg(ql_dbg_init, vha, 0x0061,
 	    "Configure NVRAM parameters...\n");
 
+	/* Let priority default to FCP, can be overridden by nvram_config */
+	ha->fc4_type_priority = FC4_PRIORITY_FCP;
+
 	ha->isp_ops->nvram_config(vha);
 
+	if (ha->fc4_type_priority != FC4_PRIORITY_FCP &&
+	    ha->fc4_type_priority != FC4_PRIORITY_NVME)
+		ha->fc4_type_priority = FC4_PRIORITY_FCP;
+
+	ql_log(ql_log_info, vha, 0xffff, "FC4 priority set to %s\n",
+	       ha->fc4_type_priority == FC4_PRIORITY_FCP ? "FCP" : "NVMe");
+
 	if (ha->flags.disable_serdes) {
 		/* Mask HBA via NVRAM settings? */
 		ql_log(ql_log_info, vha, 0x0077,
@@ -8521,8 +8531,6 @@  qla81xx_nvram_config(scsi_qla_host_t *vha)
 
 	/* Determine NVMe/FCP priority for target ports */
 	ha->fc4_type_priority = qla2xxx_get_fc4_priority(vha);
-	ql_log(ql_log_info, vha, 0xffff, "FC4 priority set to %s\n",
-	    ha->fc4_type_priority & BIT_0 ? "FCP" : "NVMe");
 
 	if (rval) {
 		ql_log(ql_log_warn, vha, 0x0076,