Commit 5e8b7b58 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files
Pull devfreq changes for v6.19 from Chanwoo Choi:

"- Move governor.h under include/linux/ and rename to devfreq-governor.h
   in order to allow devfreq governor definitions in out of drivers/devfreq/.

 - Fix potential use-after-free issue of OPP handling on hisi_uncore_freq.c

 - Use min() to improve the readability on tegra30-devfreq.c

 - Fix typo in DFSO_DOWNDIFFERENTIAL macro name on governor_simpleondemand.c"

* tag 'devfreq-next-for-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux:
  PM / devfreq: Fix typo in DFSO_DOWNDIFFERENTIAL macro name
  PM / devfreq: tegra30: use min to simplify actmon_cpu_to_emc_rate
  PM / devfreq: hisi: Fix potential UAF in OPP handling
  PM / devfreq: Move governor.h to a public header location
parents ac3fd01e d9600d57
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <linux/stat.h>
#include <linux/pm_opp.h>
#include <linux/devfreq.h>
#include <linux/devfreq-governor.h>
#include <linux/workqueue.h>
#include <linux/platform_device.h>
#include <linux/list.h>
@@ -28,7 +29,6 @@
#include <linux/of.h>
#include <linux/pm_qos.h>
#include <linux/units.h>
#include "governor.h"

#define CREATE_TRACE_POINTS
#include <trace/events/devfreq.h>
+26 −1
Original line number Diff line number Diff line
@@ -14,8 +14,33 @@
#include <linux/slab.h>
#include <linux/device.h>
#include <linux/devfreq.h>
#include <linux/devfreq-governor.h>
#include <linux/units.h>
#include "governor.h"

/**
 * struct devfreq_cpu_data - Hold the per-cpu data
 * @node:	list node
 * @dev:	reference to cpu device.
 * @first_cpu:	the cpumask of the first cpu of a policy.
 * @opp_table:	reference to cpu opp table.
 * @cur_freq:	the current frequency of the cpu.
 * @min_freq:	the min frequency of the cpu.
 * @max_freq:	the max frequency of the cpu.
 *
 * This structure stores the required cpu_data of a cpu.
 * This is auto-populated by the governor.
 */
struct devfreq_cpu_data {
	struct list_head node;

	struct device *dev;
	unsigned int first_cpu;

	struct opp_table *opp_table;
	unsigned int cur_freq;
	unsigned int min_freq;
	unsigned int max_freq;
};

static struct devfreq_cpu_data *
get_parent_cpu_data(struct devfreq_passive_data *p_data,
+1 −1
Original line number Diff line number Diff line
@@ -7,8 +7,8 @@
 */

#include <linux/devfreq.h>
#include <linux/devfreq-governor.h>
#include <linux/module.h>
#include "governor.h"

static int devfreq_performance_func(struct devfreq *df,
				    unsigned long *freq)
+1 −1
Original line number Diff line number Diff line
@@ -7,8 +7,8 @@
 */

#include <linux/devfreq.h>
#include <linux/devfreq-governor.h>
#include <linux/module.h>
#include "governor.h"

static int devfreq_powersave_func(struct devfreq *df,
				  unsigned long *freq)
+3 −3
Original line number Diff line number Diff line
@@ -9,12 +9,12 @@
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/devfreq.h>
#include <linux/devfreq-governor.h>
#include <linux/math64.h>
#include "governor.h"

/* Default constants for DevFreq-Simple-Ondemand (DFSO) */
#define DFSO_UPTHRESHOLD	(90)
#define DFSO_DOWNDIFFERENCTIAL	(5)
#define DFSO_DOWNDIFFERENTIAL	(5)
static int devfreq_simple_ondemand_func(struct devfreq *df,
					unsigned long *freq)
{
@@ -22,7 +22,7 @@ static int devfreq_simple_ondemand_func(struct devfreq *df,
	struct devfreq_dev_status *stat;
	unsigned long long a, b;
	unsigned int dfso_upthreshold = DFSO_UPTHRESHOLD;
	unsigned int dfso_downdifferential = DFSO_DOWNDIFFERENCTIAL;
	unsigned int dfso_downdifferential = DFSO_DOWNDIFFERENTIAL;
	struct devfreq_simple_ondemand_data *data = df->data;

	err = devfreq_update_stats(df);
Loading