scsi: ufs: core: Update the ufshcd_clear_cmds() functionality
authorBao D. Nguyen <quic_nguyenb@quicinc.com>
Mon, 29 May 2023 22:12:21 +0000 (15:12 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 1 Jun 2023 00:17:08 +0000 (20:17 -0400)
commit7aa12d2fe89d7b95ad01ca38a291c7ec3efe7599
tree18db7b76cce85840c590c1dc2384a8a1f36706a1
parenta8f9a36e46344ea5bdc301c2fde0389a463bf0a3
scsi: ufs: core: Update the ufshcd_clear_cmds() functionality

In the ufshcd_clear_cmds(), the 2nd parameter would be the bit mask of the
command to be cleared in the transfer request door bell register. This bit
mask mechanism does not scale well in MCQ mode when the queue depth becomes
much greater than 64. Change the 2nd parameter to the function to be the
task_tag number of the corresponding bit to be cleared in the door bell
register.  By doing so, MCQ mode with a large queue depth can reuse this
function.

Since the behavior of this function is changed from handling multiple
commands into a single command, rename ufshcd_clear_cmds() into
ufshcd_clear_cmd().

Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
Link: https://lore.kernel.org/r/8411fb5363acc90519bced30ea2c2ac582ff2340.1685396241.git.quic_nguyenb@quicinc.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Tested-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Can Guo <quic_cang@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c