armbian-build/patch/kernel/archive/sunxi-5.16/patches.megous/PM-devfreq-Drop-code-for-descending-freq_table.patch
The-going f80117f21c
Recycling of megous v5.16.4 patches (#3449)
* Recycling of megous v5.16.4 patches

The patches were sorted as far as possible. Some patches are renamed
according to their place of application. The length of the patch name
has been changed to improve readability using
the `git format-patch --filename-max-length=75` method.

The folder containing the patches will have the name `patches.name`
and the corresponding file `series.name` for the convenience
of processing and moving them upstream. But the control file remains
`series.conf`.


Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* Add a series of armbian patches for 5.16

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>

* Remove patches whose fixes are already in the kernel

Signed-off-by: The-going <48602507+The-going@users.noreply.github.com>
2022-02-02 11:03:44 +01:00

47 lines
1.7 KiB
Diff

From bd3ad334ca0654e7fc3309e946d219a57aa0f005 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 3 Apr 2021 17:05:37 -0500
Subject: [PATCH 226/446] PM / devfreq: Drop code for descending freq_table
Since commit 416b46a2627a ("PM / devfreq: Show the all available
frequencies"), freq_table's documentation requires it to be sorted in
ascending order. That commit modified available_frequencies_show() to
assume that order. This is also the order used by all existing drivers
and by set_freq_table().
However, there is still some code left over for compatibility with a
freq_table sorted descending. To avoid confusion, let's remove it.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/devfreq/devfreq.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 1cca9fc16..003b4156c 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -130,16 +130,10 @@ static void get_freq_range(struct devfreq *devfreq,
/*
* Initialize minimum/maximum frequency from freq table.
- * The devfreq drivers can initialize this in either ascending or
- * descending order and devfreq core supports both.
+ * The devfreq drivers should initialize this in ascending order.
*/
- if (freq_table[0] < freq_table[devfreq->profile->max_state - 1]) {
- *min_freq = freq_table[0];
- *max_freq = freq_table[devfreq->profile->max_state - 1];
- } else {
- *min_freq = freq_table[devfreq->profile->max_state - 1];
- *max_freq = freq_table[0];
- }
+ *min_freq = freq_table[0];
+ *max_freq = freq_table[devfreq->profile->max_state - 1];
/* Apply constraints from PM QoS */
qos_min_freq = dev_pm_qos_read_value(devfreq->dev.parent,
--
2.31.1