Skip to content

Commit

Permalink
Revert "mach-exynos: patch dvfs hotplug modules to enable/disable dep…
Browse files Browse the repository at this point in the history
…ending on the selected governor."

This reverts commit f8c40c5.
  • Loading branch information
gokhanmoral committed Sep 14, 2012
1 parent bca2955 commit 9b2ea8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 105 deletions.
55 changes: 2 additions & 53 deletions arch/arm/mach-exynos/dvfs-hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ static unsigned int freq_in_trg;
static unsigned int freq_min = -1UL;

static unsigned int can_hotplug;
static unsigned int hotplug_enabled;


static void exynos4_integrated_dvfs_hotplug(unsigned int freq_old,
unsigned int freq_new)
Expand Down Expand Up @@ -108,55 +106,12 @@ static int hotplug_cpufreq_transition(struct notifier_block *nb,
{
struct cpufreq_freqs *freqs = (struct cpufreq_freqs *)data;

if ((val == CPUFREQ_POSTCHANGE) && can_hotplug && hotplug_enabled)
if ((val == CPUFREQ_POSTCHANGE) && can_hotplug)
exynos4_integrated_dvfs_hotplug(freqs->old, freqs->new);

return 0;
}

static int hotplug_cpufreq_policy_notifier_call(struct notifier_block *this,
unsigned long code, void *data)
{
struct cpufreq_policy *policy = data;

switch (code) {
case CPUFREQ_ADJUST:
if (
(!strnicmp(policy->governor->name, "pegasusq", CPUFREQ_NAME_LEN)) ||
(!strnicmp(policy->governor->name, "hotplug", CPUFREQ_NAME_LEN))
)
{
if(hotplug_enabled)
{
printk(KERN_DEBUG "Hotplug is disabled: governor=%s\n",
policy->governor->name);
hotplug_enabled = false;
}
}
else
{
if(!hotplug_enabled)
{
printk(KERN_DEBUG "Hotplug is enabled: governor=%s\n",
policy->governor->name);
consecutv_highestlevel_cnt = 0;
consecutv_lowestlevel_cnt = 0;
hotplug_enabled = true;
}
}
break;
case CPUFREQ_INCOMPATIBLE:
case CPUFREQ_NOTIFY:
default:
break;
}

return NOTIFY_DONE;
}
static struct notifier_block hotplug_cpufreq_policy_notifier = {
.notifier_call = hotplug_cpufreq_policy_notifier_call,
};

static struct notifier_block dvfs_hotplug = {
.notifier_call = hotplug_cpufreq_transition,
};
Expand Down Expand Up @@ -198,11 +153,7 @@ static int __init exynos4_integrated_dvfs_hotplug_init(void)
consecutv_highestlevel_cnt = 0;
consecutv_lowestlevel_cnt = 0;
can_hotplug = 1;
#if defined(CPU_FREQ_DEFAULT_GOV_HOTPLUG) || defined(CPU_FREQ_DEFAULT_GOV_PEGASUSQ)
hotplug_enabled = false;
#else
hotplug_enabled = true;
#endif

table = cpufreq_frequency_get_table(0);
if (IS_ERR(table)) {
printk(KERN_ERR "%s: Check loading cpufreq before\n", __func__);
Expand All @@ -222,8 +173,6 @@ static int __init exynos4_integrated_dvfs_hotplug_init(void)

register_pm_notifier(&pm_hotplug);

cpufreq_register_notifier(&hotplug_cpufreq_policy_notifier,
CPUFREQ_POLICY_NOTIFIER);
return cpufreq_register_notifier(&dvfs_hotplug,
CPUFREQ_TRANSITION_NOTIFIER);
}
Expand Down
54 changes: 2 additions & 52 deletions arch/arm/mach-exynos/dynamic-nr_running-hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ static unsigned int freq_max;
static unsigned int freq_in_trg;
static unsigned int freq_min;
static unsigned int can_hotplug;
static unsigned int hotplug_enabled;

static void exynos4_integrated_dvfs_hotplug(unsigned int freq_old,
unsigned int freq_new)
Expand Down Expand Up @@ -121,55 +120,12 @@ static int hotplug_cpufreq_transition(struct notifier_block *nb,
{
struct cpufreq_freqs *freqs = (struct cpufreq_freqs *)data;

if ((val == CPUFREQ_POSTCHANGE) && can_hotplug && hotplug_enabled)
if ((val == CPUFREQ_POSTCHANGE) && can_hotplug)
exynos4_integrated_dvfs_hotplug(freqs->old, freqs->new);

return 0;
}

static int hotplug_cpufreq_policy_notifier_call(struct notifier_block *this,
unsigned long code, void *data)
{
struct cpufreq_policy *policy = data;

switch (code) {
case CPUFREQ_ADJUST:
if (
(!strnicmp(policy->governor->name, "pegasusq", CPUFREQ_NAME_LEN)) ||
(!strnicmp(policy->governor->name, "hotplug", CPUFREQ_NAME_LEN))
)
{
if(hotplug_enabled)
{
printk(KERN_DEBUG "Hotplug is disabled: governor=%s\n",
policy->governor->name);
hotplug_enabled = false;
}
}
else
{
if(!hotplug_enabled)
{
printk(KERN_DEBUG "Hotplug is enabled: governor=%s\n",
policy->governor->name);
ctn_highestlevel_cnt = 0;
ctn_lowestlevel_cnt = 0;
hotplug_enabled = true;
}
}
break;
case CPUFREQ_INCOMPATIBLE:
case CPUFREQ_NOTIFY:
default:
break;
}

return NOTIFY_DONE;
}
static struct notifier_block hotplug_cpufreq_policy_notifier = {
.notifier_call = hotplug_cpufreq_policy_notifier_call,
};

static struct notifier_block dvfs_hotplug = {
.notifier_call = hotplug_cpufreq_transition,
};
Expand Down Expand Up @@ -218,11 +174,7 @@ static int __init exynos4_integrated_dvfs_hotplug_init(void)
ctn_nr_running_under4 = 0;

can_hotplug = 1;
#if defined(CPU_FREQ_DEFAULT_GOV_HOTPLUG) || defined(CPU_FREQ_DEFAULT_GOV_PEGASUSQ)
hotplug_enabled = false;
#else
hotplug_enabled = true;
#endif

table = cpufreq_frequency_get_table(0);
if (IS_ERR(table)) {
printk(KERN_ERR "%s: Check loading cpufreq before\n", __func__);
Expand All @@ -240,8 +192,6 @@ static int __init exynos4_integrated_dvfs_hotplug_init(void)

register_pm_notifier(&pm_hotplug);

cpufreq_register_notifier(&hotplug_cpufreq_policy_notifier,
CPUFREQ_POLICY_NOTIFIER);
return cpufreq_register_notifier(&dvfs_hotplug,
CPUFREQ_TRANSITION_NOTIFIER);
}
Expand Down

0 comments on commit 9b2ea8e

Please sign in to comment.