Skip to content

Commit 1d0af94

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: ufs: core: Make the reserved slot a reserved request
Instead of letting the SCSI core allocate hba->nutrs - 1 commands, let the SCSI core allocate hba->nutrs commands, set the number of reserved tags to 1 and use the reserved tag for device management commands. This patch changes the 'reserved slot' from hba->nutrs - 1 into 0 because the block layer reserves the smallest tags for reserved commands. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/20251031204029.2883185-22-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent d3fd0fd commit 1d0af94

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,7 +2476,7 @@ static inline int ufshcd_hba_capabilities(struct ufs_hba *hba)
24762476
hba->nutrs = (hba->capabilities & MASK_TRANSFER_REQUESTS_SLOTS_SDB) + 1;
24772477
hba->nutmrs =
24782478
((hba->capabilities & MASK_TASK_MANAGEMENT_REQUEST_SLOTS) >> 16) + 1;
2479-
hba->reserved_slot = hba->nutrs - 1;
2479+
hba->reserved_slot = 0;
24802480

24812481
hba->nortt = FIELD_GET(MASK_NUMBER_OUTSTANDING_RTT, hba->capabilities) + 1;
24822482

@@ -8945,7 +8945,6 @@ static int ufshcd_alloc_mcq(struct ufs_hba *hba)
89458945
goto err;
89468946

89478947
hba->host->can_queue = hba->nutrs - UFSHCD_NUM_RESERVED;
8948-
hba->reserved_slot = hba->nutrs - UFSHCD_NUM_RESERVED;
89498948

89508949
return 0;
89518950
err:
@@ -9184,6 +9183,7 @@ static const struct scsi_host_template ufshcd_driver_template = {
91849183
.proc_name = UFSHCD,
91859184
.map_queues = ufshcd_map_queues,
91869185
.queuecommand = ufshcd_queuecommand,
9186+
.nr_reserved_cmds = UFSHCD_NUM_RESERVED,
91879187
.mq_poll = ufshcd_poll,
91889188
.sdev_init = ufshcd_sdev_init,
91899189
.sdev_configure = ufshcd_sdev_configure,

0 commit comments

Comments
 (0)