From: Mark Tseng <chun-jen.tseng@mediatek.com>
To: <rafael@kernel.org>, <viresh.kumar@linaro.org>,
<matthias.bgg@gmail.com>,
<angelogioacchino.delregno@collabora.com>, <sumitg@nvidia.com>,
<sanjayc@nvidia.com>
Cc: <rafael.j.wysocki@intel.com>, <linux-pm@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
<devicetree@vger.kernel.org>,
<Project_Global_Chrome_Upstream_Group@mediatek.com>,
<chun-jen.tseng@mediatek.com>
Subject: [PATCH] cpufreq: mediatek: change transition delay for MT8186
Date: Fri, 18 Aug 2023 10:06:16 +0800 [thread overview]
Message-ID: <20230818020616.4748-1-chun-jen.tseng@mediatek.com> (raw)
For MT8186, it has policy0 and policy6 by different governor thread,so
it may be call cpufreq->set_target_index() by different core. In general
case, it must check BCPU, LCPU and CCI together then take about 10ms.
Atfer 44295af5019f this patch, it may call cpufreq_out_of_sync() by
cpufreq_verify_current_freq() because current frequency is bigger
than clk_get_rate() ouver 1Mh. By the same time, it may call
cpufreq->set_target_index() again. So, the CCI freq may be too lower for
BCPU cause BCPU kernel panic.
So, it should change the default transition delay 1ms to 10ms. It can
promise the next freq setting then governor trigger new freq change.
Fixes: 44295af5019f ("cpufreq: use correct unit when verify cur freq")
Signed-off-by: Mark Tseng <chun-jen.tseng@mediatek.com>
---
drivers/cpufreq/mediatek-cpufreq.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c
index a0a61919bc4c..5633a5357e8f 100644
--- a/drivers/cpufreq/mediatek-cpufreq.c
+++ b/drivers/cpufreq/mediatek-cpufreq.c
@@ -23,6 +23,7 @@ struct mtk_cpufreq_platform_data {
int sram_min_volt;
int sram_max_volt;
bool ccifreq_supported;
+ unsigned int transition_delay_us;
};
/*
@@ -595,6 +596,7 @@ static int mtk_cpufreq_init(struct cpufreq_policy *policy)
policy->freq_table = freq_table;
policy->driver_data = info;
policy->clk = info->cpu_clk;
+ policy->transition_delay_us = info->soc_data->transition_delay_us;
return 0;
}
@@ -689,6 +691,7 @@ static const struct mtk_cpufreq_platform_data mt2701_platform_data = {
.sram_min_volt = 0,
.sram_max_volt = 1150000,
.ccifreq_supported = false,
+ .transition_delay_us = 1000,
};
static const struct mtk_cpufreq_platform_data mt7622_platform_data = {
@@ -698,6 +701,7 @@ static const struct mtk_cpufreq_platform_data mt7622_platform_data = {
.sram_min_volt = 0,
.sram_max_volt = 1350000,
.ccifreq_supported = false,
+ .transition_delay_us = 1000,
};
static const struct mtk_cpufreq_platform_data mt7623_platform_data = {
@@ -705,6 +709,7 @@ static const struct mtk_cpufreq_platform_data mt7623_platform_data = {
.max_volt_shift = 200000,
.proc_max_volt = 1300000,
.ccifreq_supported = false,
+ .transition_delay_us = 1000,
};
static const struct mtk_cpufreq_platform_data mt8183_platform_data = {
@@ -714,6 +719,7 @@ static const struct mtk_cpufreq_platform_data mt8183_platform_data = {
.sram_min_volt = 0,
.sram_max_volt = 1150000,
.ccifreq_supported = true,
+ .transition_delay_us = 1000,
};
static const struct mtk_cpufreq_platform_data mt8186_platform_data = {
@@ -723,6 +729,7 @@ static const struct mtk_cpufreq_platform_data mt8186_platform_data = {
.sram_min_volt = 850000,
.sram_max_volt = 1118750,
.ccifreq_supported = true,
+ .transition_delay_us = 10000,
};
static const struct mtk_cpufreq_platform_data mt8516_platform_data = {
@@ -732,6 +739,7 @@ static const struct mtk_cpufreq_platform_data mt8516_platform_data = {
.sram_min_volt = 0,
.sram_max_volt = 1310000,
.ccifreq_supported = false,
+ .transition_delay_us = 1000,
};
/* List of machines supported by this driver */
--
2.18.0
next reply other threads:[~2023-08-18 2:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-18 2:06 Mark Tseng [this message]
2023-08-28 6:39 ` [PATCH] cpufreq: mediatek: change transition delay for MT8186 Viresh Kumar
2023-08-29 6:57 ` Chun-Jen Tseng (曾俊仁)
2023-08-29 7:10 ` Viresh Kumar
2023-08-29 8:25 ` Chun-Jen Tseng (曾俊仁)
2023-08-29 8:31 ` Viresh Kumar
2023-08-29 8:35 ` Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230818020616.4748-1-chun-jen.tseng@mediatek.com \
--to=chun-jen.tseng@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=sanjayc@nvidia.com \
--cc=sumitg@nvidia.com \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).