mbox series

[v2,0/6] qla2xxx patches for kernel v5.12 and v5.13

Message ID 20210318032840.7611-1-bvanassche@acm.org
Headers show
Series qla2xxx patches for kernel v5.12 and v5.13 | expand

Message

Bart Van Assche March 18, 2021, 3:28 a.m. UTC
Hi Martin,

Please consider the first patch in this series for kernel v5.12 and the
remaining patches for kernel v5.13.

Thanks,

Bart.

Changes compared to v1:
- Improved the description of patch 1/6.
- Dropped one patch that is already upstream.

Bart Van Assche (6):
  Revert "qla2xxx: Make sure that aborted commands are freed"
  qla2xxx: Constify struct qla_tgt_func_tmpl
  qla2xxx: Fix endianness annotations
  qla2xxx: Suppress Coverity complaints about dseg_r*
  qla2xxx: Simplify qla8044_minidump_process_control()
  qla2xxx: Always check the return value of qla24xx_get_isp_stats()

 drivers/scsi/qla2xxx/qla_attr.c    |  6 +++++-
 drivers/scsi/qla2xxx/qla_def.h     |  4 ++--
 drivers/scsi/qla2xxx/qla_iocb.c    |  3 ++-
 drivers/scsi/qla2xxx/qla_isr.c     |  2 +-
 drivers/scsi/qla2xxx/qla_mr.c      | 12 ++++++------
 drivers/scsi/qla2xxx/qla_mr.h      |  4 ++--
 drivers/scsi/qla2xxx/qla_nx2.c     |  8 --------
 drivers/scsi/qla2xxx/qla_sup.c     |  9 +++++----
 drivers/scsi/qla2xxx/qla_target.c  | 13 +++++--------
 drivers/scsi/qla2xxx/tcm_qla2xxx.c |  6 +-----
 10 files changed, 29 insertions(+), 38 deletions(-)

Comments

Lee Duncan March 18, 2021, 4:01 p.m. UTC | #1
On 3/17/21 8:28 PM, Bart Van Assche wrote:
> Fix all recently introduced endianness annotation issues.
> 
> Cc: Quinn Tran <qutran@marvell.com>
> Cc: Mike Christie <michael.christie@oracle.com>
> Reviewed-by: Daniel Wagner <dwagner@suse.de>
> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/scsi/qla2xxx/qla_def.h  | 2 +-
>  drivers/scsi/qla2xxx/qla_iocb.c | 3 ++-
>  drivers/scsi/qla2xxx/qla_isr.c  | 2 +-
>  drivers/scsi/qla2xxx/qla_sup.c  | 9 +++++----
>  4 files changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
> index 3bdf55bb0833..52ba75591f9a 100644
> --- a/drivers/scsi/qla2xxx/qla_def.h
> +++ b/drivers/scsi/qla2xxx/qla_def.h
> @@ -1527,7 +1527,7 @@ struct init_sf_cb {
>  	 * BIT_12 = Remote Write Optimization (1 - Enabled, 0 - Disabled)
>  	 * BIT 11-0 = Reserved
>  	 */
> -	uint16_t flags;
> +	__le16	flags;
>  	uint8_t	reserved1[32];
>  	uint16_t discard_OHRB_timeout_value;
>  	uint16_t remote_write_opt_queue_num;
> diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
> index 8b41cbaf8535..eb2376b138c1 100644
> --- a/drivers/scsi/qla2xxx/qla_iocb.c
> +++ b/drivers/scsi/qla2xxx/qla_iocb.c
> @@ -2379,7 +2379,8 @@ qla24xx_prli_iocb(srb_t *sp, struct logio_entry_24xx *logio)
>  				cpu_to_le32(NVME_PRLI_SP_FIRST_BURST);
>  		if (sp->vha->flags.nvme2_enabled) {
>  			/* Set service parameter BIT_7 for NVME CONF support */
> -			logio->io_parameter[0] |= NVME_PRLI_SP_CONF;
> +			logio->io_parameter[0] |=
> +				cpu_to_le32(NVME_PRLI_SP_CONF);
>  			/* Set service parameter BIT_8 for SLER support */
>  			logio->io_parameter[0] |=
>  				cpu_to_le32(NVME_PRLI_SP_SLER);
> diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
> index 27165abda96d..0fa7082f3cc8 100644
> --- a/drivers/scsi/qla2xxx/qla_isr.c
> +++ b/drivers/scsi/qla2xxx/qla_isr.c
> @@ -3440,7 +3440,7 @@ qla24xx_abort_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
>  		return;
>  
>  	abt = &sp->u.iocb_cmd;
> -	abt->u.abt.comp_status = le16_to_cpu(pkt->comp_status);
> +	abt->u.abt.comp_status = pkt->comp_status;
>  	orig_sp = sp->cmd_sp;
>  	/* Need to pass original sp */
>  	if (orig_sp)
> diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
> index f771fabcba59..060c89237777 100644
> --- a/drivers/scsi/qla2xxx/qla_sup.c
> +++ b/drivers/scsi/qla2xxx/qla_sup.c
> @@ -2621,10 +2621,11 @@ qla24xx_read_optrom_data(struct scsi_qla_host *vha, void *buf,
>  }
>  
>  static int
> -qla28xx_extract_sfub_and_verify(struct scsi_qla_host *vha, uint32_t *buf,
> +qla28xx_extract_sfub_and_verify(struct scsi_qla_host *vha, __le32 *buf,
>      uint32_t len, uint32_t buf_size_without_sfub, uint8_t *sfub_buf)
>  {
> -	uint32_t *p, check_sum = 0;
> +	uint32_t check_sum = 0;
> +	__le32 *p;
>  	int i;
>  
>  	p = buf + buf_size_without_sfub;
> @@ -2790,8 +2791,8 @@ qla28xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr,
>  			goto done;
>  		}
>  
> -		rval = qla28xx_extract_sfub_and_verify(vha, dwptr, dwords,
> -			buf_size_without_sfub, (uint8_t *)sfub);
> +		rval = qla28xx_extract_sfub_and_verify(vha, (__le32 *)dwptr,
> +			dwords, buf_size_without_sfub, (uint8_t *)sfub);
>  
>  		if (rval != QLA_SUCCESS)
>  			goto done;
> 

Reviewed-by: Lee Duncan <lduncan@suse.com>
Bart Van Assche March 18, 2021, 7:11 p.m. UTC | #2
On 3/18/21 1:08 AM, Daniel Wagner wrote:
> On Wed, Mar 17, 2021 at 08:28:40PM -0700, Bart Van Assche wrote:
>> @@ -2873,7 +2875,9 @@ qla2x00_reset_host_stats(struct Scsi_Host *shost)
>>  		}
>>  
>>  		/* reset firmware statistics */
>> -		qla24xx_get_isp_stats(base_vha, stats, stats_dma, BIT_0);
>> +		rval = qla24xx_get_isp_stats(base_vha, stats, stats_dma, BIT_0);
>> +		ql_log(ql_log_warn, vha, 0x70d9,
>> +		       "Resetting ISP statistics failed: rval = %d\n", rval);
> 
> Is there not an 'if' missing?
> 
> 	if (rval)
> 		ql_log(...)

Right, I will add an if-statement.

Thanks,

Bart.