All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] qla2xxx fc4_type_priority handling
@ 2019-11-07 22:48 Martin Wilck
  2019-11-07 22:48 ` [PATCH v2 1/2] scsi: qla2xxx: initialize fc4_type_priority Martin Wilck
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Martin Wilck @ 2019-11-07 22:48 UTC (permalink / raw)
  To: Martin K. Petersen, Himanshu Madhani, Michael Hernandez, Bart Van Assche
  Cc: James Bottomley, linux-scsi, Martin Wilck

From: Martin Wilck <mwilck@suse.com>

Resending these patches with better commit messages and
"Tested-by:" tags included, as suggested by reviewers.
The patches themselves are unchanged.

Martin Wilck (2):
  scsi: qla2xxx: initialize fc4_type_priority
  scsi: qla2xxx: don't use zero for FC4_PRIORITY_NVME

 drivers/scsi/qla2xxx/qla_def.h    |  6 ++++--
 drivers/scsi/qla2xxx/qla_init.c   | 12 ++++++++++--
 drivers/scsi/qla2xxx/qla_inline.h |  2 +-
 3 files changed, 15 insertions(+), 5 deletions(-)

-- 
2.23.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] scsi: qla2xxx: initialize fc4_type_priority
  2019-11-07 22:48 [PATCH v2 0/2] qla2xxx fc4_type_priority handling Martin Wilck
@ 2019-11-07 22:48 ` Martin Wilck
  2019-11-07 22:48 ` [PATCH v2 2/2] scsi: qla2xxx: don't use zero for FC4_PRIORITY_NVME Martin Wilck
  2019-11-09  2:24 ` [PATCH v2 0/2] qla2xxx fc4_type_priority handling Martin K. Petersen
  2 siblings, 0 replies; 5+ messages in thread
From: Martin Wilck @ 2019-11-07 22:48 UTC (permalink / raw)
  To: Martin K. Petersen, Himanshu Madhani, Michael Hernandez, Bart Van Assche
  Cc: James Bottomley, linux-scsi, Martin Wilck, David Bond, Bart Van Assche

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>
Tested-by: David Bond <dbond@suse.com>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
---
 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,
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] scsi: qla2xxx: don't use zero for FC4_PRIORITY_NVME
  2019-11-07 22:48 [PATCH v2 0/2] qla2xxx fc4_type_priority handling Martin Wilck
  2019-11-07 22:48 ` [PATCH v2 1/2] scsi: qla2xxx: initialize fc4_type_priority Martin Wilck
@ 2019-11-07 22:48 ` Martin Wilck
  2019-11-07 23:10   ` Bart Van Assche
  2019-11-09  2:24 ` [PATCH v2 0/2] qla2xxx fc4_type_priority handling Martin K. Petersen
  2 siblings, 1 reply; 5+ messages in thread
From: Martin Wilck @ 2019-11-07 22:48 UTC (permalink / raw)
  To: Martin K. Petersen, Himanshu Madhani, Michael Hernandez, Bart Van Assche
  Cc: James Bottomley, linux-scsi, Martin Wilck, David Bond

From: Martin Wilck <mwilck@suse.com>

Avoid an uninitialized value (0) for ha->fc4_type_priority being falsely
interpreted as NVMe priority. Not strictly needed any more after the
previous patch, but makes the fc4_type_priority handling more explicit.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Tested-by: David Bond <dbond@suse.com>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
---
 drivers/scsi/qla2xxx/qla_def.h    | 6 ++++--
 drivers/scsi/qla2xxx/qla_inline.h | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 721ee7f..86c5155 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2476,8 +2476,10 @@ typedef struct fc_port {
 	u16 n2n_chip_reset;
 } fc_port_t;
 
-#define FC4_PRIORITY_NVME	0
-#define FC4_PRIORITY_FCP	1
+enum {
+	FC4_PRIORITY_NVME = 1,
+	FC4_PRIORITY_FCP  = 2,
+};
 
 #define QLA_FCPORT_SCAN		1
 #define QLA_FCPORT_FOUND	2
diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h
index d728b17..352aba4 100644
--- a/drivers/scsi/qla2xxx/qla_inline.h
+++ b/drivers/scsi/qla2xxx/qla_inline.h
@@ -317,5 +317,5 @@ qla2xxx_get_fc4_priority(struct scsi_qla_host *vha)
 	    ((uint8_t *)vha->hw->nvram)[NVRAM_DUAL_FCP_NVME_FLAG_OFFSET];
 
 
-	return ((data >> 6) & BIT_0);
+	return (data >> 6) & BIT_0 ? FC4_PRIORITY_FCP : FC4_PRIORITY_NVME;
 }
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/2] scsi: qla2xxx: don't use zero for FC4_PRIORITY_NVME
  2019-11-07 22:48 ` [PATCH v2 2/2] scsi: qla2xxx: don't use zero for FC4_PRIORITY_NVME Martin Wilck
@ 2019-11-07 23:10   ` Bart Van Assche
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2019-11-07 23:10 UTC (permalink / raw)
  To: Martin Wilck, Martin K. Petersen, Himanshu Madhani,
	Michael Hernandez, Bart Van Assche
  Cc: James Bottomley, linux-scsi, David Bond

On 11/7/19 2:48 PM, Martin Wilck wrote:
> Avoid an uninitialized value (0) for ha->fc4_type_priority being falsely
> interpreted as NVMe priority. Not strictly needed any more after the
> previous patch, but makes the fc4_type_priority handling more explicit.

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/2] qla2xxx fc4_type_priority handling
  2019-11-07 22:48 [PATCH v2 0/2] qla2xxx fc4_type_priority handling Martin Wilck
  2019-11-07 22:48 ` [PATCH v2 1/2] scsi: qla2xxx: initialize fc4_type_priority Martin Wilck
  2019-11-07 22:48 ` [PATCH v2 2/2] scsi: qla2xxx: don't use zero for FC4_PRIORITY_NVME Martin Wilck
@ 2019-11-09  2:24 ` Martin K. Petersen
  2 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2019-11-09  2:24 UTC (permalink / raw)
  To: Martin Wilck
  Cc: Martin K. Petersen, Himanshu Madhani, Michael Hernandez,
	Bart Van Assche, James Bottomley, linux-scsi


> Resending these patches with better commit messages and "Tested-by:"
> tags included, as suggested by reviewers.  The patches themselves are
> unchanged.

Applied to 5.5/scsi-queue, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-09  2:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 22:48 [PATCH v2 0/2] qla2xxx fc4_type_priority handling Martin Wilck
2019-11-07 22:48 ` [PATCH v2 1/2] scsi: qla2xxx: initialize fc4_type_priority Martin Wilck
2019-11-07 22:48 ` [PATCH v2 2/2] scsi: qla2xxx: don't use zero for FC4_PRIORITY_NVME Martin Wilck
2019-11-07 23:10   ` Bart Van Assche
2019-11-09  2:24 ` [PATCH v2 0/2] qla2xxx fc4_type_priority handling Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.