Skip to content

Commit

Permalink
drivers: squash: revert some devfreq
Browse files Browse the repository at this point in the history
This reverts commits:
Revert "PM / devfreq: Allow the governors to set the target flag"
Revert "PM / devfreq: predef governors update freq when device is resumed"
Revert "PM / devfreq: Add a new target flag for the performance governor"
Revert "devfreq: Weight stall cycles more for GPU bus DCVS"
Revert "devfreq: Use busy cycles only for GPU bandwidth decisions"
Revert "drivers: fix incompatible-pointer-types"

Change-Id: f2836761bbea2e0e6d9c92195538404a4c333648
Signed-off-by: TogoFire <italomellopereira@gmail.com>
  • Loading branch information
TogoFire committed Nov 5, 2022
1 parent bf3d3e5 commit 10abd53
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 59 deletions.
2 changes: 1 addition & 1 deletion drivers/devfreq/devfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ int update_devfreq(struct devfreq *devfreq)
freq = ULONG_MAX;
} else {
/* Reevaluate the proper frequency */
err = devfreq->governor->get_target_freq(devfreq, &freq, &flags);
err = devfreq->governor->get_target_freq(devfreq, &freq);
if (err)
return err;
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/devfreq/governor_bw_hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,7 @@ static int gov_resume(struct devfreq *df)
}

static int devfreq_bw_hwmon_get_freq(struct devfreq *df,
unsigned long *freq,
u32 *flag)
unsigned long *freq)
{
struct hwmon_node *node = df->data;

Expand Down
3 changes: 1 addition & 2 deletions drivers/devfreq/governor_bw_vbif.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ static struct devfreq *df;
* by KGSL driver to get and return a value for frequency.
*/
static int devfreq_vbif_get_freq(struct devfreq *df,
unsigned long *freq,
u32 *flag)
unsigned long *freq)
{
/* If the IB isn't set yet, check if it should be non-zero. */
if (!dev_ib && extern_get_bw) {
Expand Down
3 changes: 1 addition & 2 deletions drivers/devfreq/governor_cache_hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ int update_cache_hwmon(struct cache_hwmon *hwmon)
}

static int devfreq_cache_hwmon_get_freq(struct devfreq *df,
unsigned long *freq,
u32 *flag)
unsigned long *freq)
{
struct mrps_stats stat;
struct cache_hwmon_node *node = df->data;
Expand Down
3 changes: 1 addition & 2 deletions drivers/devfreq/governor_cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,7 @@ static unsigned int cpu_to_dev_freq(struct devfreq *df, unsigned int cpu)
}

static int devfreq_cpufreq_get_freq(struct devfreq *df,
unsigned long *freq,
u32 *flag)
unsigned long *freq)
{
unsigned int cpu, tgt_freq = 0;
struct devfreq_node *node;
Expand Down
17 changes: 4 additions & 13 deletions drivers/devfreq/governor_gpubw_mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#define HIST 5
#define TARGET 80
#define CAP 75
#define WAIT_THRESHOLD 10
/* AB vote is in multiple of BW_STEP Mega bytes */
#define BW_STEP 160

Expand Down Expand Up @@ -53,8 +52,7 @@ static inline int devfreq_get_freq_level(struct devfreq *devfreq,
}

static int devfreq_gpubw_get_target(struct devfreq *df,
unsigned long *freq,
u32 *flag)
unsigned long *freq)
{

struct devfreq_msm_adreno_tz_data *priv = df->data;
Expand All @@ -67,9 +65,7 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
int result;
int level = 0;
int act_level;
int norm_max_cycles;
int norm_cycles;
int wait_active_percent;
int gpu_percent;
/*
* Normalized AB should at max usage be the gpu_bimc frequency in MHz.
Expand Down Expand Up @@ -98,12 +94,8 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
if (priv->bus.total_time < LONG_FLOOR)
return result;

norm_max_cycles = (unsigned int)(priv->bus.ram_time) /
(unsigned int) priv->bus.total_time;
norm_cycles = (unsigned int)(priv->bus.ram_time + priv->bus.ram_wait) /
(unsigned int) priv->bus.total_time;
wait_active_percent = (100 * (unsigned int)priv->bus.ram_wait) /
(unsigned int) priv->bus.ram_time;
gpu_percent = (100 * (unsigned int)priv->bus.gpu_time) /
(unsigned int) priv->bus.total_time;

Expand All @@ -112,8 +104,8 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
* FAST hint. Otherwise check the current value against the current
* cutoffs.
*/
if (norm_max_cycles > priv->bus.max) {
_update_cutoff(priv, norm_max_cycles);
if (norm_cycles > priv->bus.max) {
_update_cutoff(priv, norm_cycles);
bus_profile->flag = DEVFREQ_FLAG_FAST_HINT;
} else {
/* GPU votes for IB not AB so don't under vote the system */
Expand All @@ -122,8 +114,7 @@ static int devfreq_gpubw_get_target(struct devfreq *df,
act_level = (act_level < 0) ? 0 : act_level;
act_level = (act_level >= priv->bus.num) ?
(priv->bus.num - 1) : act_level;
if ((norm_cycles > priv->bus.up[act_level] ||
wait_active_percent > WAIT_THRESHOLD) &&
if (norm_cycles > priv->bus.up[act_level] &&
gpu_percent > CAP)
bus_profile->flag = DEVFREQ_FLAG_FAST_HINT;
else if (norm_cycles < priv->bus.down[act_level] && level)
Expand Down
3 changes: 1 addition & 2 deletions drivers/devfreq/governor_memlat.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,7 @@ static void gov_stop(struct devfreq *df)
}

static int devfreq_memlat_get_freq(struct devfreq *df,
unsigned long *freq,
u32 *flag)
unsigned long *freq)
{
int i, lat_dev = 0;
struct memlat_node *node = df->data;
Expand Down
2 changes: 1 addition & 1 deletion drivers/devfreq/governor_msm_adreno_tz.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ static inline int devfreq_get_freq_level(struct devfreq *devfreq,
return -EINVAL;
}

static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq, u32 *flag)
static int tz_get_target_freq(struct devfreq *devfreq, unsigned long *freq)
{
int result = 0;
struct devfreq_msm_adreno_tz_data *priv = devfreq->data;
Expand Down
24 changes: 5 additions & 19 deletions drivers/devfreq/governor_performance.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include "governor.h"

static int devfreq_performance_func(struct devfreq *df,
unsigned long *freq,
u32 *flag)
unsigned long *freq)
{
/*
* target callback should be able to get floor value as
Expand All @@ -32,26 +31,13 @@ static int devfreq_performance_handler(struct devfreq *devfreq,
unsigned int event, void *data)
{
int ret = 0;
unsigned long freq;

mutex_lock(&devfreq->lock);
freq = devfreq->previous_freq;
switch (event) {
case DEVFREQ_GOV_START:
devfreq->profile->target(devfreq->dev.parent,
&freq,
DEVFREQ_FLAG_WAKEUP_MAXFREQ);
/* fall through */
case DEVFREQ_GOV_RESUME:
if (event == DEVFREQ_GOV_START) {
mutex_lock(&devfreq->lock);
ret = update_devfreq(devfreq);
break;
case DEVFREQ_GOV_SUSPEND:
devfreq->profile->target(devfreq->dev.parent,
&freq,
DEVFREQ_FLAG_WAKEUP_MAXFREQ);
break;
mutex_unlock(&devfreq->lock);
}
mutex_unlock(&devfreq->lock);

return ret;
}

Expand Down
5 changes: 2 additions & 3 deletions drivers/devfreq/governor_powersave.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include "governor.h"

static int devfreq_powersave_func(struct devfreq *df,
unsigned long *freq,
u32 *flag)
unsigned long *freq)
{
/*
* target callback should be able to get ceiling value as
Expand All @@ -30,7 +29,7 @@ static int devfreq_powersave_handler(struct devfreq *devfreq,
{
int ret = 0;

if (event == DEVFREQ_GOV_START || event == DEVFREQ_GOV_RESUME) {
if (event == DEVFREQ_GOV_START) {
mutex_lock(&devfreq->lock);
ret = update_devfreq(devfreq);
mutex_unlock(&devfreq->lock);
Expand Down
3 changes: 1 addition & 2 deletions drivers/devfreq/governor_simpleondemand.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#define DFSO_UPTHRESHOLD (90)
#define DFSO_DOWNDIFFERENCTIAL (5)
static int devfreq_simple_ondemand_func(struct devfreq *df,
unsigned long *freq,
u32 *flag)
unsigned long *freq)
{
int err;
struct devfreq_dev_status *stat;
Expand Down
2 changes: 1 addition & 1 deletion drivers/devfreq/governor_spdm_bw_hyp.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static irqreturn_t isr(int irq, void *dev_id)
return IRQ_WAKE_THREAD;
}

static int gov_spdm_hyp_target_bw(struct devfreq *devfreq, unsigned long *freq, u32 *flag)
static int gov_spdm_hyp_target_bw(struct devfreq *devfreq, unsigned long *freq)
{
struct devfreq_dev_status status;
int ret = -EINVAL;
Expand Down
3 changes: 1 addition & 2 deletions drivers/devfreq/governor_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ struct userspace_data {
bool valid;
};

static int devfreq_userspace_func(struct devfreq *df, unsigned long *freq,
u32 *flag)
static int devfreq_userspace_func(struct devfreq *df, unsigned long *freq)
{
struct userspace_data *data = df->data;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ static unsigned long __calculate(struct vidc_bus_vote_data *d,
}


static int __get_target_freq(struct devfreq *dev, unsigned long *freq, u32 *flag)
static int __get_target_freq(struct devfreq *dev, unsigned long *freq)
{
unsigned long ab_kbps = 0, c = 0;
struct devfreq_dev_status stats = {0};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ static unsigned long __calculate(struct vidc_bus_vote_data *d,
return calc[d->domain](d, gm);
}

static int __get_target_freq(struct devfreq *dev, unsigned long *freq, u32 *flag)
static int __get_target_freq(struct devfreq *dev, unsigned long *freq)
{
unsigned long ab_kbps = 0, c = 0;
struct devfreq_dev_status stats = {0};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int __get_bus_freq(struct msm_vidc_bus_table_gov *gov,


static int msm_vidc_table_get_target_freq(struct devfreq *dev,
unsigned long *frequency, u32 *flag)
unsigned long *frequency)
{
struct devfreq_dev_status status = {0};
struct msm_vidc_gov_data *vidc_data = NULL;
Expand Down
5 changes: 1 addition & 4 deletions include/linux/devfreq.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ struct devfreq_dev_status {
*/
#define DEVFREQ_FLAG_LEAST_UPPER_BOUND 0x1

#define DEVFREQ_FLAG_WAKEUP_MAXFREQ 0x2

/**
* struct devfreq_dev_profile - Devfreq's user device profile
* @initial_freq: The operating frequency when devfreq_add_device() is
Expand Down Expand Up @@ -126,8 +124,7 @@ struct devfreq_governor {

const char name[DEVFREQ_NAME_LEN];
const unsigned int immutable;
int (*get_target_freq)(struct devfreq *this, unsigned long *freq,
u32 *flag);
int (*get_target_freq)(struct devfreq *this, unsigned long *freq);
int (*event_handler)(struct devfreq *devfreq,
unsigned int event, void *data);
};
Expand Down

0 comments on commit 10abd53

Please sign in to comment.