build/patch/kernel/archive/sunxi-5.15/patches.megous/devfreq-sun8i-mbus-Set-default-minimum-frequency-for-the-govern.patch

46 lines
1.5 KiB
Diff
Raw Normal View History

From d2e8b87c1211226cc6e1f4a0ecf6da589dc7093d Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megous@megous.com>
Date: Sat, 1 May 2021 14:04:05 +0200
Subject: [PATCH 424/478] 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 d3c1655f1550..a2d44d422586 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.35.3