OSDN Git Service

scsi: ufs: fix deadlock when attempting hibern8 during clock gating
authorSubhash Jadavani <subhashj@codeaurora.org>
Fri, 15 Aug 2014 00:54:02 +0000 (17:54 -0700)
committerDavid Keitel <dkeitel@codeaurora.org>
Tue, 22 Mar 2016 17:57:13 +0000 (10:57 -0700)
commit155737fa4ee230b7cdd9b1631fbed28a977a1625
tree073967fbeb4fb061d679a2b15d0d2d63bb8a2ad8
parent2fcdc6a23493c03c2abb8d24da6e9abcc1c7d026
scsi: ufs: fix deadlock when attempting hibern8 during clock gating

If UFSHCD_CAP_HIBERN8_WITH_CLK_GATING capability is enabled then UFS
driver should put the link in hibern8 along with gating of UFS related
clocks but we are hitting the deadlock in this case. UFS gating work
calls the ufshcd_uic_hibern8_enter() which would call the helper function
ufshcd_uic_pwr_ctrl(). ufshcd_uic_pwr_ctrl() calls ufshcd_hold() to make
sure that clocks are ungated which means clock ungate work would end up
waiting for the gate work to finish which causes the deadlock (as gate
work is waiting for ufshcd_uic_pwer_ctrl() to finish).

Fix this issue by letting the callers of ufshcd_uic_pwr_ctrl() to decide
if they really need to vote for the UFS clocks or not.

Change-Id: I5b9d1a1c75bbc5a7097e6cc71cd9ec6885cd271a
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[subhashj@codeaurora.org: resolved merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
drivers/scsi/ufs/ufshcd.c