linux-uconsole/drivers/scsi/ufs
Subhash Jadavani a4c9fd613e scsi: ufs: Fix error handing during hibern8 enter
[ Upstream commit 6d303e4b19 ]

During clock gating (ufshcd_gate_work()), we first put the link hibern8 by
calling ufshcd_uic_hibern8_enter() and if ufshcd_uic_hibern8_enter()
returns success (0) then we gate all the clocks.  Now let’s zoom in to what
ufshcd_uic_hibern8_enter() does internally: It calls
__ufshcd_uic_hibern8_enter() and if failure is encountered, link recovery
shall put the link back to the highest HS gear and returns success (0) to
ufshcd_uic_hibern8_enter() which is the issue as link is still in active
state due to recovery!  Now ufshcd_uic_hibern8_enter() returns success to
ufshcd_gate_work() and hence it goes ahead with gating the UFS clock while
link is still in active state hence I believe controller would raise UIC
error interrupts. But when we service the interrupt, clocks might have
already been disabled!

This change fixes for this by returning failure from
__ufshcd_uic_hibern8_enter() if recovery succeeds as link is still not in
hibern8, upon receiving the error ufshcd_hibern8_enter() would initiate
retry to put the link state back into hibern8.

Link: https://lore.kernel.org/r/1573798172-20534-8-git-send-email-cang@codeaurora.org
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-04 19:13:03 +01:00
..
Kconfig
Makefile
tc-dwc-g210-pci.c
tc-dwc-g210-pltfrm.c
tc-dwc-g210.c
tc-dwc-g210.h
ufs-hisi.c scsi: ufs: fix a missing check of devm_reset_control_get 2019-05-31 06:46:32 -07:00
ufs-hisi.h
ufs-qcom.c
ufs-qcom.h
ufs-sysfs.c
ufs-sysfs.h
ufs.h scsi: ufs: Fix geometry descriptor size 2019-02-27 10:08:55 +01:00
ufs_quirks.h
ufshcd-dwc.c
ufshcd-dwc.h
ufshcd-pci.c
ufshcd-pltfrm.c scsi: ufs: Avoid runtime suspend possibly being blocked forever 2019-06-25 11:35:53 +08:00
ufshcd-pltfrm.h
ufshcd.c scsi: ufs: Fix error handing during hibern8 enter 2020-01-04 19:13:03 +01:00
ufshcd.h
ufshci-dwc.h
ufshci.h
unipro.h scsi: ufs: Fix RX_TERMINATION_FORCE_ENABLE define value 2019-09-06 10:22:02 +02:00