scsi: ufs: Ungate the clock synchronously
authorBart Van Assche <bvanassche@acm.org>
Mon, 29 May 2023 20:26:40 +0000 (13:26 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 31 May 2023 15:44:01 +0000 (11:44 -0400)
commit078f4f4b34d6c2dadabb363d3fc6c84b32927dea
treea05edb0875099fa511a4080fc1b3b41bee5f54eb
parent4b68b7f9c46d90c541d39c8b397a86ac0ca4c765
scsi: ufs: Ungate the clock synchronously

Ungating the clock asynchronously causes ufshcd_queuecommand() to return
SCSI_MLQUEUE_HOST_BUSY and hence causes commands to be requeued.  This is
suboptimal. Allow ufshcd_queuecommand() to sleep such that clock ungating
does not trigger command requeuing. Remove the ufshcd_scsi_block_requests()
and ufshcd_scsi_unblock_requests() calls because these are no longer
needed. The flush_work(&hba->clk_gating.ungate_work) call is sufficient to
make the SCSI core wait for clock ungating to complete.

Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230529202640.11883-6-bvanassche@acm.org
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufs-sysfs.c
drivers/ufs/core/ufshcd-crypto.c
drivers/ufs/core/ufshcd.c
include/ufs/ufshcd.h