[v2,03/11] qla2xxx: Indicate correct supported speeds for Mezz card
diff mbox series

Message ID 20200806111014.28434-4-njavali@marvell.com
State Accepted
Headers show
Series
  • qla2xxx driver bug fixes
Related show

Commit Message

Nilesh Javali Aug. 6, 2020, 11:10 a.m. UTC
From: Quinn Tran <qutran@marvell.com>

Correct the supported speeds for 16G Mezz card.

Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_gs.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

Comments

Himanshu Madhani Aug. 12, 2020, 7:40 p.m. UTC | #1
> On Aug 6, 2020, at 6:10 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> From: Quinn Tran <qutran@marvell.com>
> 
> Correct the supported speeds for 16G Mezz card.
> 
> Signed-off-by: Quinn Tran <qutran@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> ---
> drivers/scsi/qla2xxx/qla_gs.c | 17 ++++++++++++-----
> 1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
> index d9ce8d31457a..8c30d9dbb48c 100644
> --- a/drivers/scsi/qla2xxx/qla_gs.c
> +++ b/drivers/scsi/qla2xxx/qla_gs.c
> @@ -1505,11 +1505,11 @@ qla2x00_prep_ct_fdmi_req(struct ct_sns_pkt *p, uint16_t cmd,
> static uint
> qla25xx_fdmi_port_speed_capability(struct qla_hw_data *ha)
> {
> +	uint speeds = 0;
> +
> 	if (IS_CNA_CAPABLE(ha))
> 		return FDMI_PORT_SPEED_10GB;
> 	if (IS_QLA28XX(ha) || IS_QLA27XX(ha)) {
> -		uint speeds = 0;
> -
> 		if (ha->max_supported_speed == 2) {
> 			if (ha->min_supported_speed <= 6)
> 				speeds |= FDMI_PORT_SPEED_64GB;
> @@ -1536,9 +1536,16 @@ qla25xx_fdmi_port_speed_capability(struct qla_hw_data *ha)
> 		}
> 		return speeds;
> 	}
> -	if (IS_QLA2031(ha))
> -		return FDMI_PORT_SPEED_16GB|FDMI_PORT_SPEED_8GB|
> -			FDMI_PORT_SPEED_4GB;
> +	if (IS_QLA2031(ha)) {
> +		if ((ha->pdev->subsystem_vendor == 0x103C) &&
> +		    (ha->pdev->subsystem_device == 0x8002)) {
> +			speeds = FDMI_PORT_SPEED_16GB;
> +		} else {
> +			speeds = FDMI_PORT_SPEED_16GB|FDMI_PORT_SPEED_8GB|
> +				FDMI_PORT_SPEED_4GB;
> +		}
> +		return speeds;
> +	}
> 	if (IS_QLA25XX(ha))
> 		return FDMI_PORT_SPEED_8GB|FDMI_PORT_SPEED_4GB|
> 			FDMI_PORT_SPEED_2GB|FDMI_PORT_SPEED_1GB;
> -- 
> 2.19.0.rc0
> 

Looks fine.

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering

Patch
diff mbox series

diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index d9ce8d31457a..8c30d9dbb48c 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -1505,11 +1505,11 @@  qla2x00_prep_ct_fdmi_req(struct ct_sns_pkt *p, uint16_t cmd,
 static uint
 qla25xx_fdmi_port_speed_capability(struct qla_hw_data *ha)
 {
+	uint speeds = 0;
+
 	if (IS_CNA_CAPABLE(ha))
 		return FDMI_PORT_SPEED_10GB;
 	if (IS_QLA28XX(ha) || IS_QLA27XX(ha)) {
-		uint speeds = 0;
-
 		if (ha->max_supported_speed == 2) {
 			if (ha->min_supported_speed <= 6)
 				speeds |= FDMI_PORT_SPEED_64GB;
@@ -1536,9 +1536,16 @@  qla25xx_fdmi_port_speed_capability(struct qla_hw_data *ha)
 		}
 		return speeds;
 	}
-	if (IS_QLA2031(ha))
-		return FDMI_PORT_SPEED_16GB|FDMI_PORT_SPEED_8GB|
-			FDMI_PORT_SPEED_4GB;
+	if (IS_QLA2031(ha)) {
+		if ((ha->pdev->subsystem_vendor == 0x103C) &&
+		    (ha->pdev->subsystem_device == 0x8002)) {
+			speeds = FDMI_PORT_SPEED_16GB;
+		} else {
+			speeds = FDMI_PORT_SPEED_16GB|FDMI_PORT_SPEED_8GB|
+				FDMI_PORT_SPEED_4GB;
+		}
+		return speeds;
+	}
 	if (IS_QLA25XX(ha))
 		return FDMI_PORT_SPEED_8GB|FDMI_PORT_SPEED_4GB|
 			FDMI_PORT_SPEED_2GB|FDMI_PORT_SPEED_1GB;