ufs: core: Expand MCQ queue slot to DeviceQueueDepth + 1
Subsystems (3)
v3 cover ufs: core: Expand MCQ queue slot to DeviceQueueDepth + 1
From: Naomi Chu <[email protected]>
Expand the MCQ queue slots to comply with the UFSHCI 4.0 specification, enabling host controllers to fully utilize the MCQ queue slots.
v2 -> v3
- Add patch description that why this patch is necessary
v1 -> v2
- Remove QUIRK_MCQ_EXPAND_QUEUE_SLOT quirk and make the change for all host controllers
v1
- Support quirk for host controllers not able to distinguish queue full or empty
Naomi Chu (1):
ufs: core: Expand MCQ queue slot to DeviceQueueDepth + 1
drivers/ufs/core/ufs-mcq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.18.0
PATCH v3 1/1 ufs: core: Expand MCQ queue slot to DeviceQueueDepth + 1
From: Naomi Chu <[email protected]>
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 the hwq->max_entries to DeviceQueueDepth +1 to allow UFSHCI 4.0 controllers to fully utilize MCQ queue slots.
--- drivers/ufs/core/ufs-mcq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ufs/core/ufs-mcq.c +1 -1
@@ -436,7 +436,7 @@ int ufshcd_mcq_init(struct ufs_hba *hba)for (i =0 ; i < hba->nr_hw_queues; i++) { hwq = &hba->uhq[i]; - hwq->max_entries = hba->nutrs; + hwq->max_entries = hba->nutrs +1 ;spin_lock_init (&hwq->sq_lock);spin_lock_init (&hwq->cq_lock);mutex_init (&hwq->sq_mutex);
Signature · 1 line
2.18.0
Quoted 8 lines · On Thu, Nov 2, 2023 at 2:26 PM <[email protected]> wrote:
From: Naomi Chu <[email protected]>
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 the
hwq->max_entriestoDeviceQueueDepth +1to allow UFSHCI 4.0 controllers to fully utilize MCQ queue slots.
Quoted 5 lines
Fixes 4682abfae2eb ("scsi: ufs: core: mcq: Allocate memory for MCQ mode")Signed-off-by Naomi Chu <[email protected]>--- drivers/ufs/core/ufs-mcq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 10 lines · On Thu, Nov 02, 2023 at 01:24:24PM +0800, [email protected] wrote:
From: Naomi Chu <[email protected]>
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 the
hwq->max_entriestoDeviceQueueDepth +1to allow UFSHCI 4.0 controllers to fully utilize MCQ queue slots.Fixes 4682abfae2eb ("scsi: ufs: core: mcq: Allocate memory for MCQ mode")Signed-off-by Naomi Chu <[email protected]>---
Where is the changelog?
- Mani
Quoted 19 lines
drivers/ufs/core/ufs-mcq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/ufs/core/ufs-mcq.c +1
-1@@ -436,7 +436,7 @@ int ufshcd_mcq_init(struct ufs_hba *hba)for (i =0 ; i < hba->nr_hw_queues; i++) { hwq = &hba->uhq[i]; - hwq->max_entries = hba->nutrs; + hwq->max_entries = hba->nutrs +1 ;spin_lock_init (&hwq->sq_lock);spin_lock_init (&hwq->cq_lock);mutex_init (&hwq->sq_mutex);Signature · 1 line
2.18.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Bart Van Assche
reviewerQuoted 1 line · Manivannan Sadhasivam
Where is the changelog?
I think it's here: https://lore.kernel.org/linux-scsi/[email protected]/
Bart.
Quoted 4 lines · On 11/1/23 22:24, [email protected] wrote:
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 the
hwq->max_entriestoDeviceQueueDepth +1to allow UFSHCI 4.0 controllers to fully utilize MCQ queue slots.
Quoted 9 lines · On Thu, 2023-11-02 at 13:24 +0800, [email protected] wrote:
From: Naomi Chu <[email protected]>
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 thehwq->max_entriestoDeviceQueueDepth +1to allow UFSHCI 4.0 controllers to fully utilize MCQ queue slots.
Quoted 31 lines · On Thu, 2023-11-02 at 13:24 +0800, [email protected] wrote:
From: Naomi Chu <[email protected]>
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 thehwq->max_entriestoDeviceQueueDepth +1to allow UFSHCI 4.0 controllers to fully utilize MCQ queue slots.Fixes 4682abfae2eb ("scsi: ufs: core: mcq: Allocate memory for MCQmode")
Signed-off-by Naomi Chu <[email protected]>--- drivers/ufs/core/ufs-mcq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/ufs/core/ufs-mcq.c +1
-1@@ -436,7 +436,7 @@ int ufshcd_mcq_init(struct ufs_hba *hba)for (i =0 ; i < hba->nr_hw_queues; i++) { hwq = &hba->uhq[i]; - hwq->max_entries = hba->nutrs; + hwq->max_entries = hba->nutrs +1 ;spin_lock_init (&hwq->sq_lock);spin_lock_init (&hwq->cq_lock);mutex_init (&hwq->sq_mutex);Signature · 1 line
2.18.0
Martin K. Petersen
AppliedQuoted 5 lines
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 the
hwq->max_entriestoDeviceQueueDepth +1to allow UFSHCI 4.0 controllers to fully utilize MCQ queue slots.
Applied to 6.7/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 10 lines · On Thu, 02 Nov 2023 13:24:23 +0800, [email protected] wrote:
Expand the MCQ queue slots to comply with the UFSHCI 4.0 specification, enabling host controllers to fully utilize the MCQ queue slots.
v2 -> v3
- Add patch description that why this patch is necessaryv1 -> v2
- RemoveQUIRK_MCQ_EXPAND_QUEUE_SLOTquirk and make the change for all host controllers[...]
Applied to 6.7/scsi-fixes, thanks!
[1/1] ufs: core: Expand MCQ queue slot to DeviceQueueDepth + 1
https://git.kernel.org/mkp/scsi/c/defde5a50d91
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering