Commit af8201b8 authored by Jaegeuk Kim's avatar Jaegeuk Kim Committed by Xin Li
Browse files

FROMLIST: scsi: ufs: fix clkgating on/off correctly

The below call stack prevents clk_gating at every IO completion.
We can remove the condition, ufshcd_any_tag_in_use(), since clkgating_work
will check it again.

ufshcd_complete_requests(struct ufs_hba *hba)
  ufshcd_transfer_req_compl()
    __ufshcd_transfer_req_compl()
      __ufshcd_release(hba)
        if (ufshcd_any_tag_in_use() == 1)
           return;
  ufshcd_tmc_handler(hba);
    blk_mq_tagset_busy_iter();

Note that, this still requires a work to deal with a potential racy condition
when user sets clkgating.delay_ms to very small value. That can cause preventing
clkgating by the check of ufshcd_any_tag_in_use() in gate_work.

Bug: 171095848
Link: https://lore.kernel.org/linux-scsi/20201028194352.GA3060274@google.com/T/#m3485ba8df14e4ad5cf0aa5b314ffe1cb90d90105


Fixes: 7252a360 ("scsi: ufs: Avoid busy-waiting by eliminating tag conflicts")
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
Change-Id: I9b56725b26e1be8b1da55ae1db7322ab00fc5298
parent 200098e4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment