lkml.org 
[lkml]   [2022]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/2] scsi: ufs: Add Multi-Circular Queue support
From
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.

\
 
 \ /
  Last update: 2022-07-28 21:39    [W:0.434 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site