msm-mmrm: Control throttling feature via debugfs

Enable or disable throttling feature by writing
correct value to msm_mmrm debugfs.

Change-Id: If2b06e061ddd102c42d0f5517d3c0be4fc9f6669
Signed-off-by: Mahesh Kumar Sharma <smahesh@codeaurora.org>
Цей коміт міститься в:
Mahesh Kumar Sharma
2021-06-30 11:53:45 -07:00
джерело e653ade312
коміт e1ade39ea4
3 змінених файлів з 8 додано та 4 видалено

Переглянути файл

@@ -30,7 +30,7 @@ static int mmrm_sw_vdd_corner[] = {
};
#define MMRM_SW_CLIENTS_NUM_MAX 35
extern msm_mmrm_enable_throttle_feature;
typedef int (*notifier_callback_fn_t)(
struct mmrm_client_notifier_data *notifier_data);

Переглянути файл

@@ -591,7 +591,8 @@ static int mmrm_sw_check_peak_current(struct mmrm_sw_clk_mgr_info *sinfo,
/* peak overshoot, do not update peak data */
if ((signed)peak_cur + delta_cur >= peak_data->threshold) {
/* Find low prority client and throttle it*/
if (tbl_entry->pri == MMRM_CLIENT_PRIOR_HIGH) {
if ((tbl_entry->pri == MMRM_CLIENT_PRIOR_HIGH)
&& (msm_mmrm_enable_throttle_feature > 0)) {
rc = mmrm_sw_throttle_low_priority_client(sinfo, &delta_cur);
if (rc != 0) {
d_mpr_e("%s: Failed to throttle the low priority client\n",
@@ -604,7 +605,6 @@ static int mmrm_sw_check_peak_current(struct mmrm_sw_clk_mgr_info *sinfo,
rc = -EINVAL;
goto err_peak_overshoot;
}
}
/* update peak data */
peak_data->aggreg_val = peak_cur + delta_cur;

Переглянути файл

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
*/
#include <linux/slab.h>
@@ -8,8 +8,11 @@
#include "mmrm_debug.h"
int msm_mmrm_debug = MMRM_ERR | MMRM_WARN | MMRM_PRINTK;
u8 msm_mmrm_enable_throttle_feature = 0;
u8 msm_mmrm_allow_multiple_register = 0;
#define MAX_DBG_BUF_SIZE 4096
static ssize_t msm_mmrm_debugfs_info_read(
@@ -61,6 +64,7 @@ struct dentry *msm_mmrm_debugfs_init(void)
/* add other params here */
debugfs_create_u32("debug_level", 0644, dir, &msm_mmrm_debug);
debugfs_create_u8("allow_multiple_register", 0644, dir, &msm_mmrm_allow_multiple_register);
debugfs_create_u8("enable_throttle_feature", 0644, dir, &msm_mmrm_enable_throttle_feature);
d_mpr_h("%s: exiting\n", __func__);
return dir;