OPP updates for 6.9

- Fix couple of warnings related to W=1 builds. (Viresh Kumar).
 - Move Move dev_pm_opp_{init|free}_cpufreq_table() to pm_opp.h (Viresh Kumar).
 - Extend dev_pm_opp_data with turbo support (Sibi Sankar).
 - dt-bindings: drop maxItems from inner items (David Heidelberg).
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEx73Crsp7f6M6scA70rkcPK6BEhwFAmXulEoACgkQ0rkcPK6B
 EhzN4g//Z0HsbM3jB7f43RosiTB7uS6M6Xp4ODTQLwZQvf9Jq9pl2cp8tgczIKFx
 1FacJsjq/Fjs9wZeASIs75Rz//w7ngJqJ4sM+uYBHzN1B+V5KQK2RvlHSIpEdu63
 puktEQHGAtnCpY+SdjnrI972Qic/cl5qP/ewLeq+WBVcKHNdSbfV1n1rVG9+6ylC
 lrnJGJbt6h7yIqL24hwv4rUJDvvdusFGXtAHBOlrRvM8fJPY9OUiA9UME2e6mNlJ
 PfJWgyWjnJ1+RAloUJ8YH/96hpl/A7fTegD7BuK7RhMp63b8Qf8oAgPDoI2DFx+0
 VD/yDsKv1q+wcB5iPbSdap9zBuvvBJxRUZJ0JKLhXX4SiCtjhfFEkHbdfThal2qW
 /XnUoIqkkQQ6MZIA/bKhJzMxsgyhnaQaTSBMScnAXXbVB5VwO9d8GEtknYPrJQxu
 5LKXYWmbFkJD5B1pMdVeij3b9irB1KknS7gULphrxYaJ+pxIGBQ2FCORm9n8G5LC
 aQ6TWaKz+s//wpd7nYHq1UyFhLC7FY2Q1BR7hflq4h5r9ZyeKbpouOYSJU1hwOri
 AlmX/tLS6te9y+mFbmqXdMH/TDZ53IYoMhTDFR0N+zcuKCegoGAOJIb8mJMpH62y
 /nL/IB4sXaTLrbPk5JpXnAtjK7wfCtCsyIYwFsdvZy2Xp0bKMCw=
 =SvDq
 -----END PGP SIGNATURE-----

Merge tag 'opp-updates-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm into pm

Merge OPP (operating performance points) updates for 6.9 from Viresh
Kumar:

"- Fix couple of warnings related to W=1 builds. (Viresh Kumar).
 - Move Move dev_pm_opp_{init|free}_cpufreq_table() to pm_opp.h (Viresh Kumar).
 - Extend dev_pm_opp_data with turbo support (Sibi Sankar).
 - dt-bindings: drop maxItems from inner items (David Heidelberg)."

* tag 'opp-updates-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm:
  dt-bindings: opp: drop maxItems from inner items
  OPP: debugfs: Fix warning around icc_get_name()
  OPP: debugfs: Fix warning with W=1 builds
  cpufreq: Move dev_pm_opp_{init|free}_cpufreq_table() to pm_opp.h
  OPP: Extend dev_pm_opp_data with turbo support
This commit is contained in:
Rafael J. Wysocki 2024-03-11 16:22:36 +01:00
commit 866b554c2d
5 changed files with 27 additions and 28 deletions

View File

@ -57,8 +57,6 @@ patternProperties:
specific binding.
minItems: 1
maxItems: 32
items:
maxItems: 1
opp-microvolt:
description: |

View File

@ -2065,6 +2065,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct device *dev,
/* populate the opp table */
new_opp->rates[0] = data->freq;
new_opp->level = data->level;
new_opp->turbo = data->turbo;
tol = u_volt * opp_table->voltage_tolerance_v1 / 100;
new_opp->supplies[0].u_volt = u_volt;
new_opp->supplies[0].u_volt_min = u_volt - tol;

View File

@ -37,10 +37,12 @@ static ssize_t bw_name_read(struct file *fp, char __user *userbuf,
size_t count, loff_t *ppos)
{
struct icc_path *path = fp->private_data;
const char *name = icc_get_name(path);
char buf[64];
int i;
int i = 0;
i = scnprintf(buf, sizeof(buf), "%.62s\n", icc_get_name(path));
if (name)
i = scnprintf(buf, sizeof(buf), "%.62s\n", name);
return simple_read_from_buffer(userbuf, count, ppos, buf, i);
}
@ -56,11 +58,11 @@ static void opp_debug_create_bw(struct dev_pm_opp *opp,
struct dentry *pdentry)
{
struct dentry *d;
char name[20];
char name[] = "icc-path-XXXXXXXXXXX"; /* Integers can take 11 chars max */
int i;
for (i = 0; i < opp_table->path_count; i++) {
snprintf(name, sizeof(name), "icc-path-%.1d", i);
snprintf(name, sizeof(name), "icc-path-%d", i);
/* Create per-path directory */
d = debugfs_create_dir(name, pdentry);
@ -78,7 +80,7 @@ static void opp_debug_create_clks(struct dev_pm_opp *opp,
struct opp_table *opp_table,
struct dentry *pdentry)
{
char name[12];
char name[] = "rate_hz_XXXXXXXXXXX"; /* Integers can take 11 chars max */
int i;
if (opp_table->clk_count == 1) {
@ -100,7 +102,7 @@ static void opp_debug_create_supplies(struct dev_pm_opp *opp,
int i;
for (i = 0; i < opp_table->regulator_count; i++) {
char name[15];
char name[] = "supply-XXXXXXXXXXX"; /* Integers can take 11 chars max */
snprintf(name, sizeof(name), "supply-%d", i);

View File

@ -693,26 +693,6 @@ struct cpufreq_frequency_table {
* order */
};
#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
int dev_pm_opp_init_cpufreq_table(struct device *dev,
struct cpufreq_frequency_table **table);
void dev_pm_opp_free_cpufreq_table(struct device *dev,
struct cpufreq_frequency_table **table);
#else
static inline int dev_pm_opp_init_cpufreq_table(struct device *dev,
struct cpufreq_frequency_table
**table)
{
return -EINVAL;
}
static inline void dev_pm_opp_free_cpufreq_table(struct device *dev,
struct cpufreq_frequency_table
**table)
{
}
#endif
/*
* cpufreq_for_each_entry - iterate over a cpufreq_frequency_table
* @pos: the cpufreq_frequency_table * to use as a loop cursor.

View File

@ -16,6 +16,7 @@
#include <linux/notifier.h>
struct clk;
struct cpufreq_frequency_table;
struct regulator;
struct dev_pm_opp;
struct device;
@ -87,12 +88,14 @@ struct dev_pm_opp_config {
/**
* struct dev_pm_opp_data - The data to use to initialize an OPP.
* @turbo: Flag to indicate whether the OPP is to be marked turbo or not.
* @level: The performance level for the OPP. Set level to OPP_LEVEL_UNSET if
* level field isn't used.
* @freq: The clock rate in Hz for the OPP.
* @u_volt: The voltage in uV for the OPP.
*/
struct dev_pm_opp_data {
bool turbo;
unsigned int level;
unsigned long freq;
unsigned long u_volt;
@ -444,6 +447,21 @@ static inline int dev_pm_opp_sync_regulators(struct device *dev)
#endif /* CONFIG_PM_OPP */
#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
int dev_pm_opp_init_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table);
void dev_pm_opp_free_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table);
#else
static inline int dev_pm_opp_init_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table)
{
return -EINVAL;
}
static inline void dev_pm_opp_free_cpufreq_table(struct device *dev, struct cpufreq_frequency_table **table)
{
}
#endif
#if defined(CONFIG_PM_OPP) && defined(CONFIG_OF)
int dev_pm_opp_of_add_table(struct device *dev);
int dev_pm_opp_of_add_table_indexed(struct device *dev, int index);