]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: ufs: Try to save power mode change and UIC cmd completion timeout
authorCan Guo <cang@codeaurora.org>
Tue, 3 Nov 2020 06:24:40 +0000 (22:24 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 5 Nov 2020 04:13:33 +0000 (23:13 -0500)
commitcb5069930d3dc1884a237bba463e70ce2538d0f4
treef3110a69ca26f4c93815c2bcbab764e25f5195d8
parent32cbd2b2db424926c30b6e240506cbd9fa318187
scsi: ufs: Try to save power mode change and UIC cmd completion timeout

Use the uic_cmd->cmd_active as a flag to track the lifecycle of an UIC cmd.
The flag is set before sending the UIC cmd and cleared in IRQ handler. When
a PMC or UIC cmd completion timeout happens, if the flag is not set,
instead of returning timeout error, we still treat it as a successful
operation.  This is to deal with the scenario in which completion has been
raised but the one waiting for the completion cannot be awaken in time due
to kernel scheduling problem.

Link: https://lore.kernel.org/r/1604384682-15837-3-git-send-email-cang@codeaurora.org
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h