Skip to content

Commit 7c97575

Browse files
committed
Revert "thermal: boost: phytium: Automatic enable/disable of BOOST feature"
This reverts commit b6c9d54. Signed-off-by: Wentao Guan <[email protected]>
1 parent 96a4921 commit 7c97575

File tree

4 files changed

+2
-65
lines changed

4 files changed

+2
-65
lines changed

drivers/cpufreq/cpufreq.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static void cpufreq_governor_limits(struct cpufreq_policy *policy);
8686
static int cpufreq_set_policy(struct cpufreq_policy *policy,
8787
struct cpufreq_governor *new_gov,
8888
unsigned int new_pol);
89-
bool cpufreq_boost_supported(void);
89+
static bool cpufreq_boost_supported(void);
9090

9191
/*
9292
* Two notifier lists: the "policy" list is involved in the
@@ -2826,14 +2826,10 @@ int cpufreq_boost_trigger_state(int state)
28262826
return ret;
28272827
}
28282828

2829-
bool cpufreq_boost_supported(void)
2829+
static bool cpufreq_boost_supported(void)
28302830
{
2831-
if (!cpufreq_driver)
2832-
return -EINVAL;
2833-
28342831
return cpufreq_driver->set_boost;
28352832
}
2836-
EXPORT_SYMBOL_GPL(cpufreq_boost_supported);
28372833

28382834
static int create_boost_sysfs_file(void)
28392835
{
@@ -2870,9 +2866,6 @@ EXPORT_SYMBOL_GPL(cpufreq_enable_boost_support);
28702866

28712867
int cpufreq_boost_enabled(void)
28722868
{
2873-
if (!cpufreq_driver)
2874-
return -EINVAL;
2875-
28762869
return cpufreq_driver->boost_enabled;
28772870
}
28782871
EXPORT_SYMBOL_GPL(cpufreq_boost_enabled);

drivers/thermal/thermal_core.c

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@
1818
#include <linux/thermal.h>
1919
#include <linux/reboot.h>
2020
#include <linux/string.h>
21-
#include <linux/cpufreq.h>
2221
#include <linux/of.h>
2322
#include <linux/suspend.h>
2423

25-
#include <asm/stacktrace.h>
2624
#define CREATE_TRACE_POINTS
2725
#include "thermal_trace.h"
2826

@@ -343,49 +341,6 @@ static void handle_critical_trips(struct thermal_zone_device *tz,
343341
tz->ops->critical(tz);
344342
}
345343

346-
static int thermal_boost_enable(struct thermal_zone_device *tz)
347-
{
348-
enum thermal_trend trend = get_tz_trend(tz, 0);
349-
struct thermal_trip trip;
350-
351-
if (!tz->overheated)
352-
return -EPERM;
353-
if (trend == THERMAL_TREND_RAISING)
354-
return -EBUSY;
355-
356-
__thermal_zone_get_trip(tz, 0, &trip);
357-
358-
if ((tz->temperature + (trip.temperature >> 2)) < trip.temperature) {
359-
mutex_lock(&tz->lock);
360-
tz->overheated = false;
361-
if (tz->boost_polling) {
362-
tz->boost_polling = false;
363-
thermal_zone_device_set_polling(tz, 0);
364-
}
365-
mutex_unlock(&tz->lock);
366-
cpufreq_boost_trigger_state(1);
367-
return 0;
368-
}
369-
return -EBUSY;
370-
}
371-
372-
static void thermal_boost_disable(struct thermal_zone_device *tz)
373-
{
374-
cpufreq_boost_trigger_state(0);
375-
376-
/*
377-
* If no workqueue for monitoring is running - start one with
378-
* 1000 ms monitoring period
379-
* If workqueue already running - do not change its period and only
380-
* test if target CPU has cooled down
381-
*/
382-
if (tz->mode != THERMAL_DEVICE_ENABLED) {
383-
tz->boost_polling = true;
384-
thermal_zone_device_set_polling(tz, 1000);
385-
}
386-
tz->overheated = true;
387-
}
388-
389344
static void handle_thermal_trip(struct thermal_zone_device *tz, int trip_id)
390345
{
391346
struct thermal_trip trip;
@@ -465,11 +420,6 @@ void __thermal_zone_device_update(struct thermal_zone_device *tz,
465420

466421
update_temperature(tz);
467422

468-
if (cpufreq_boost_supported() && cpufreq_boost_enabled())
469-
if ((tz->temperature + (tz->trips[0].temperature >> 2))
470-
>= tz->trips[0].temperature)
471-
thermal_boost_disable(tz);
472-
473423
__thermal_zone_set_trips(tz);
474424

475425
tz->notify_event = event;
@@ -576,9 +526,6 @@ static void thermal_zone_device_check(struct work_struct *work)
576526
struct thermal_zone_device *tz = container_of(work, struct
577527
thermal_zone_device,
578528
poll_queue.work);
579-
if (cpufreq_boost_supported())
580-
if (!thermal_boost_enable(tz))
581-
return;
582529
thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);
583530
}
584531

include/linux/cpufreq.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,6 @@ ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
797797
#ifdef CONFIG_CPU_FREQ
798798
int cpufreq_boost_trigger_state(int state);
799799
int cpufreq_boost_enabled(void);
800-
bool cpufreq_boost_supported(void);
801800
int cpufreq_enable_boost_support(void);
802801
bool policy_has_boost_freq(struct cpufreq_policy *policy);
803802

include/linux/thermal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,6 @@ struct thermal_zone_device {
176176
int prev_low_trip;
177177
int prev_high_trip;
178178
atomic_t need_update;
179-
bool overheated;
180-
bool boost_polling;
181179
struct thermal_zone_device_ops *ops;
182180
struct thermal_zone_params *tzp;
183181
struct thermal_governor *governor;

0 commit comments

Comments
 (0)