diff --git a/android/abi_gki_aarch64.stg b/android/abi_gki_aarch64.stg index 53f70fca4b5a..bd632daa5065 100644 --- a/android/abi_gki_aarch64.stg +++ b/android/abi_gki_aarch64.stg @@ -189224,6 +189224,12 @@ member { type_id: 0x351ca0f0 offset: 64 } +member { + id: 0x0489a9d9 + name: "suspend_on_no_request" + type_id: 0x6d7f5ff6 + offset: 1672 +} member { id: 0x0b4c6d3f name: "suspend_opp" @@ -266594,6 +266600,7 @@ struct_union { member_id: 0xbbefba04 member_id: 0xb768ef54 member_id: 0x2061f6ba + member_id: 0x0489a9d9 member_id: 0x2d081217 } } diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index f91088fd2480..aabea7aaf048 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -1503,7 +1503,8 @@ static int ufshcd_devfreq_target(struct device *dev, ktime_to_us(ktime_sub(ktime_get(), start)), ret); out: - if (sched_clk_scaling_suspend_work && !scale_up) + if (sched_clk_scaling_suspend_work && + (!scale_up || hba->clk_scaling.suspend_on_no_request)) queue_work(hba->clk_scaling.workq, &hba->clk_scaling.suspend_work); diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index 12965946d194..b817bd525a69 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -425,6 +425,7 @@ struct ufs_saved_pwr_info { * @is_initialized: Indicates whether clock scaling is initialized or not * @is_busy_started: tracks if busy period has started or not * @is_suspended: tracks if devfreq is suspended or not + * @suspend_on_no_request: Flag to suspend clk scaling when there is no request */ struct ufs_clk_scaling { int active_reqs; @@ -442,6 +443,10 @@ struct ufs_clk_scaling { bool is_initialized; bool is_busy_started; bool is_suspended; + /* using hole here would not alter the overall size of the structure. */ +#ifndef __GENKSYMS__ + bool suspend_on_no_request; +#endif ANDROID_KABI_RESERVE(1); };