]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
scsi: ufs: core: Add helpers to pause and resume command processing
authorCan Guo <can.guo@oss.qualcomm.com>
Wed, 25 Mar 2026 15:21:48 +0000 (08:21 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 27 Mar 2026 21:20:29 +0000 (17:20 -0400)
commitdc5dcac5327832bffc1971b1445553823bdebc08
tree0c5959a2b9155593548b3da45328fa86830fa038
parent10c40143f369a601cc54dd39777843e000b730a6
scsi: ufs: core: Add helpers to pause and resume command processing

In preparation for supporting TX Equalization refreshing, introduce helper
functions to safely pause and resume command processing.

ufshcd_pause_command_processing() ensures the host is in a quiescent state
by stopping the block layer tagset, acquiring the necessary locks
(scan_mutex and clk_scaling_lock), and waiting for any in-flight commands
to complete within a specified timeout.

ufshcd_resume_command_processing() restores the host to its previous
operational state by reversing these steps in the correct order.

Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Can Guo <can.guo@oss.qualcomm.com>
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Link: https://patch.msgid.link/20260325152154.1604082-7-can.guo@oss.qualcomm.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd-priv.h
drivers/ufs/core/ufshcd.c