lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 28 Jul 2022 12:38:14 -0700
From:   Bart Van Assche <bvanassche@....org>
To:     Can Guo <quic_cang@...cinc.com>, stanley.chu@...iatek.com,
        adrian.hunter@...el.com, alim.akhtar@...sung.com,
        avri.altman@....com, beanhuo@...ron.com, quic_asutoshd@...cinc.com,
        quic_nguyenb@...cinc.com, quic_ziqichen@...cinc.com,
        linux-scsi@...r.kernel.org, kernel-team@...roid.com
Cc:     "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Daejun Park <daejun7.park@...sung.com>,
        Jinyoung Choi <j-young.choi@...sung.com>,
        Kiwoong Kim <kwmad.kim@...sung.com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] scsi: ufs: Add Multi-Circular Queue support

On 7/19/22 00:01, Can Guo wrote:
>   static int ufshcd_map_queues(struct Scsi_Host *shost)
>   {
> -	int i, ret;
> +	int i, queue_offset = 0, ret;
> +	struct ufs_hba *hba = shost_priv(shost);
>   
>   	for (i = 0; i < shost->nr_maps; i++) {
>   		struct blk_mq_queue_map *map = &shost->tag_set.map[i];
>   
> -		switch (i) {
> -		case HCTX_TYPE_DEFAULT:
> -		case HCTX_TYPE_POLL:
> -			map->nr_queues = 1;
> -			break;
> -		case HCTX_TYPE_READ:
> -			map->nr_queues = 0;
> +		map->nr_queues = hba->nr_queues[i];
> +		if (!map->nr_queues)
>   			continue;
> -		default:
> -			WARN_ON_ONCE(true);
> -		}
> -		map->queue_offset = 0;
> +
> +		map->queue_offset = queue_offset;
> +		if (i == HCTX_TYPE_POLL && !is_mcq_enabled(hba))
> +			map->queue_offset = 0;
> +
>   		ret = blk_mq_map_queues(map);
> -		WARN_ON_ONCE(ret);
> +
> +		if (ret)
> +			return ret;
> +
> +		queue_offset += map->nr_queues;
>   	}

It is not clear to me why the WARN_ON_ONCE(ret) statement has been 
changed into "if (ret) return ret;"?

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ