BACKPORT: FROMLIST: scsi: core: Reserve one tag for the UFS driver
This is a GKI-compatible version of the following patch: "scsi: core: Add support for reserved tags". Bug: 205080886 Link: https://lore.kernel.org/linux-scsi/20211103000529.1549411-2-bvanassche@acm.org. Change-Id: I6273114ae8cc6c2a74c72f7bc090eb0319ec5772 Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
parent
94ca15ec92
commit
ff748ee298
@ -220,9 +220,6 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
shost->cmd_per_lun = min_t(short, shost->cmd_per_lun,
|
|
||||||
shost->can_queue);
|
|
||||||
|
|
||||||
error = scsi_init_sense_cache(shost);
|
error = scsi_init_sense_cache(shost);
|
||||||
if (error)
|
if (error)
|
||||||
goto fail;
|
goto fail;
|
||||||
@ -231,6 +228,10 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
|
|||||||
if (error)
|
if (error)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
shost->can_queue = shost->tag_set.queue_depth;
|
||||||
|
shost->cmd_per_lun = min_t(short, shost->cmd_per_lun,
|
||||||
|
shost->can_queue);
|
||||||
|
|
||||||
if (!shost->shost_gendev.parent)
|
if (!shost->shost_gendev.parent)
|
||||||
shost->shost_gendev.parent = dev ? dev : &platform_bus;
|
shost->shost_gendev.parent = dev ? dev : &platform_bus;
|
||||||
if (!dma_dev)
|
if (!dma_dev)
|
||||||
|
@ -1909,6 +1909,10 @@ int scsi_mq_setup_tags(struct Scsi_Host *shost)
|
|||||||
tag_set->ops = &scsi_mq_ops_no_commit;
|
tag_set->ops = &scsi_mq_ops_no_commit;
|
||||||
tag_set->nr_hw_queues = shost->nr_hw_queues ? : 1;
|
tag_set->nr_hw_queues = shost->nr_hw_queues ? : 1;
|
||||||
tag_set->queue_depth = shost->can_queue;
|
tag_set->queue_depth = shost->can_queue;
|
||||||
|
if (shost->hostt->name && strcmp(shost->hostt->name, "ufshcd") == 0) {
|
||||||
|
tag_set->queue_depth--;
|
||||||
|
tag_set->reserved_tags++;
|
||||||
|
}
|
||||||
tag_set->cmd_size = cmd_size;
|
tag_set->cmd_size = cmd_size;
|
||||||
tag_set->numa_node = NUMA_NO_NODE;
|
tag_set->numa_node = NUMA_NO_NODE;
|
||||||
tag_set->flags = BLK_MQ_F_SHOULD_MERGE;
|
tag_set->flags = BLK_MQ_F_SHOULD_MERGE;
|
||||||
|
Loading…
Reference in New Issue
Block a user