Skip to content

Commit defde5a

Browse files
Naomi Chumartinkpetersen
authored andcommitted
scsi: ufs: core: Expand MCQ queue slot to DeviceQueueDepth + 1
The UFSHCI 4.0 specification mandates that there should always be at least one empty slot in each queue for distinguishing between full and empty states. Enlarge 'hwq->max_entries' to 'DeviceQueueDepth + 1' to allow UFSHCI 4.0 controllers to fully utilize MCQ queue slots. Fixes: 4682abf ("scsi: ufs: core: mcq: Allocate memory for MCQ mode") Signed-off-by: Naomi Chu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Stanley Chu <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Peter Wang <[email protected]> Reviewed-by: Chun-Hung <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 19597ca commit defde5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/ufs/core/ufs-mcq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ int ufshcd_mcq_init(struct ufs_hba *hba)
436436

437437
for (i = 0; i < hba->nr_hw_queues; i++) {
438438
hwq = &hba->uhq[i];
439-
hwq->max_entries = hba->nutrs;
439+
hwq->max_entries = hba->nutrs + 1;
440440
spin_lock_init(&hwq->sq_lock);
441441
spin_lock_init(&hwq->cq_lock);
442442
mutex_init(&hwq->sq_mutex);

0 commit comments

Comments
 (0)