summaryrefslogtreecommitdiff
path: root/drivers/scsi/ufs/ufshcd.h
diff options
context:
space:
mode:
authorCan Guo <cang@codeaurora.org>2021-01-20 02:04:22 -0800
committerMartin K. Petersen <martin.petersen@oracle.com>2021-01-20 22:23:23 -0500
commit4543d9d78227f0de0056e06427303618c2adac65 (patch)
tree1f2756b93f28ea1db40caa99645de9b004dff01e /drivers/scsi/ufs/ufshcd.h
parent0e9d4ca43ba8112821397f56a26d20682001c011 (diff)
downloadlwn-4543d9d78227f0de0056e06427303618c2adac65.tar.gz
lwn-4543d9d78227f0de0056e06427303618c2adac65.zip
scsi: ufs: Refactor ufshcd_init/exit_clk_scaling/gating()
ufshcd_hba_exit() is always called after ufshcd_exit_clk_scaling() and ufshcd_exit_clk_gating(). Move ufshcd_exit_clk_scaling/gating() to ufshcd_hba_exit(). Meanwhile, add dedicated functions to initialize and remove sysfs nodes of clock scaling/gating to make the code more readable. Overall functionality remains same. Link: https://lore.kernel.org/r/1611137065-14266-3-git-send-email-cang@codeaurora.org Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Can Guo <cang@codeaurora.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufshcd.h')
-rw-r--r--drivers/scsi/ufs/ufshcd.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index cfe76b1e0e9c..ee61f821f75d 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -383,6 +383,7 @@ enum clk_gating_state {
* @delay_attr: sysfs attribute to control delay_attr
* @enable_attr: sysfs attribute to enable/disable clock gating
* @is_enabled: Indicates the current status of clock gating
+ * @is_initialized: Indicates whether clock gating is initialized or not
* @active_reqs: number of requests that are pending and should be waited for
* completion before gating clocks.
*/
@@ -395,6 +396,7 @@ struct ufs_clk_gating {
struct device_attribute delay_attr;
struct device_attribute enable_attr;
bool is_enabled;
+ bool is_initialized;
int active_reqs;
struct workqueue_struct *clk_gating_workq;
};
@@ -423,6 +425,7 @@ struct ufs_saved_pwr_info {
clkscale_enable sysfs node
* @is_allowed: tracks if scaling is currently allowed or not, used to block
clock scaling which is not invoked from devfreq governor
+ * @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
*/
@@ -439,6 +442,7 @@ struct ufs_clk_scaling {
u32 min_gear;
bool is_enabled;
bool is_allowed;
+ bool is_initialized;
bool is_busy_started;
bool is_suspended;
};