scsi: ufs: Fix clock gating issue
commit <f0e7e5ba> ("Avoid potential lrb race caused by early release of lrb_in_use") holds lrb_in_use till all operations of lrbp is finished to avoid the potential race with the next task which may use the same lrbp in some corner case. As part of this change, clear_bit_unlock API was moved down just before scsi_done call. Due to which _ufshcd_release is called before we reset the bit for particular request tag in hba->lrb_in_use flag. Hence for the last request in completion handler, _ufshcd_release is called with non zero value of hba->lrb_in_use and hence its return without scheduling the hr timer to start the gate work. Due to which clock are not getting turned off and it remains on till runtime suspend kicks in. This is causing ufs power consumption issue. To fix this, move down __ufshcd_release and __ufshcd_hibern8_release function after the clear_bit_unlock, so that __ufshcd_release will be called with updated value of hba->lrb_in_use flag . Change-Id: I3b42bcd1f7bf12adb3e769154de221d700defa2c Signed-off-by:Nitin Rawat <nitirawa@codeaurora.org>
Loading
Please register or sign in to comment