armbian-build/patch/kernel/archive/sunxi-5.15/megous/devfreq-sun8i-mbus-Set-default-minimum-frequency-for.patch
The-going 33c413c679
Patches megous 5.15.5 (#3295)
* Rework patches for sunxi 5.15.4

* Rework patches sunxi for 5.15.5

* Kernel switch tag=v5.15.5 for sunxi EDGE

* Temporarily disabled, requires rework.

drivers/clk/sunxi-ng/sun8i-de33.c: In function ‘sunxi_de33_clk_probe’:
drivers/clk/sunxi-ng/sun8i-de33.c:155:8:
 error: implicit declaration of function ‘sunxi_ccu_probe’;
 did you mean ‘of_sunxi_ccu_probe’? [-Werror=implicit-function-declarati>
  ret = sunxi_ccu_probe(pdev->dev.of_node, reg, ccu_desc);
        ^~~~~~~~~~~~~~~
        of_sunxi_ccu_probe
cc1: some warnings being treated as errors
make[3]: *** [scripts/Makefile.build:277:
         drivers/clk/sunxi-ng/sun8i-de33.o] Error 1
make[2]: *** [scripts/Makefile.build:540: drivers/clk/sunxi-ng] Error 2

* Correct the comment.
2021-11-28 16:48:47 +01:00

46 lines
1.5 KiB
Diff

From a1dcf3e826e1949340569b56d3a2bd912b91f106 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Sat, 1 May 2021 14:04:05 +0200
Subject: [PATCH 419/467] devfreq: sun8i-mbus: Set default minimum frequency
for the governor
Set it by default to second lowest, so that people don't complain
about the low mmc performance. But allow people who want higher
power savings to set it still lower.
Yes, this should be done in userspace, but some had already disabled
the mbus devfreq driver completely, instead of tuning the governor,
so let's have higher perf by default, instead of losing testers... ;)
Signed-off-by: Ondrej Jirman <megous@megous.com>
---
drivers/devfreq/sun8i-mbus.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/devfreq/sun8i-mbus.c b/drivers/devfreq/sun8i-mbus.c
index d3c1655f1..a2d44d422 100644
--- a/drivers/devfreq/sun8i-mbus.c
+++ b/drivers/devfreq/sun8i-mbus.c
@@ -10,6 +10,7 @@
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/property.h>
+#include <linux/pm_qos.h>
#define MBUS_CR 0x0000
#define MBUS_CR_GET_DRAM_TYPE(x) (((x) >> 16) & 0x7)
@@ -437,6 +438,10 @@ static int sun8i_mbus_probe(struct platform_device *pdev)
goto err_unlock_dram;
}
+ if (max_state > 0)
+ dev_pm_qos_update_request(&priv->devfreq_dram->user_min_freq_req,
+ priv->freq_table[1] / 1000);
+
priv->devfreq_dram->suspend_freq = priv->freq_table[0];
debugfs_create_devm_seqfile(dev, "sun8i-mbus", NULL,
--
2.34.0