scsi: ufs: Avoid busy-waiting by eliminating tag conflicts
authorBart Van Assche <bvanassche@acm.org>
Mon, 9 Dec 2019 18:13:08 +0000 (10:13 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 20 Dec 2019 03:08:51 +0000 (22:08 -0500)
commit7252a3603015f1fd04363956f4b72a537c9f9c42
tree8d021ec4d454f0ac237ca451ff26b1f3d9aedc16
parentbd40726153c646ed28f830e22a27f5e831b77017
scsi: ufs: Avoid busy-waiting by eliminating tag conflicts

Instead of tracking which tags are in use in the ufs_hba.lrb_in_use
bitmask, rely on the block layer tag allocation mechanism. This patch
removes the following busy-waiting loop if ufshcd_issue_devman_upiu_cmd()
and the block layer accidentally allocate the same tag for a SCSI request:

 * ufshcd_queuecommand() returns SCSI_MLQUEUE_HOST_BUSY.

 * The SCSI core requeues the SCSI command.

Cc: Can Guo <cang@codeaurora.org>
Cc: Stanley Chu <stanley.chu@mediatek.com>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20191209181309.196233-2-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h