Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80d85e5d authored by Can Guo's avatar Can Guo
Browse files

scsi: ufs: Make sure clk scaling happens only when hba is runtime ACTIVE



If someone plays with the UFS clk scaling devfreq governor through sysfs,
ufshcd_devfreq_scale may be called even when hba is not runtime ACTIVE,
which can lead to unexpected error. We cannot just protect it by calling
pm_runtime_get_sync, because that may cause racing problem since hba
runtime suspend ops needs to suspend clk scaling. In order to fix it, call
pm_runtime_get_noresume and check hba's runtime status, then only proceed
if hba is runtime ACTIVE, otherwise just bail.

governor_store
 devfreq_performance_handler
  update_devfreq
   devfreq_set_target
    ufshcd_devfreq_target
     ufshcd_devfreq_scale

Change-Id: I1345985d50bcb239b7af008f7d295de3d7581112
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
parent 4707ea1d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment