* [PATCH] cpufreq: imx-cpufreq-dt: Add "cpu-supply" property check
@ 2020-02-17 9:42 Anson Huang
2020-02-17 10:46 ` Viresh Kumar
0 siblings, 1 reply; 2+ messages in thread
From: Anson Huang @ 2020-02-17 9:42 UTC (permalink / raw)
To: rjw, viresh.kumar, shawnguo, s.hauer, kernel, festevam, linux-pm,
linux-arm-kernel, linux-kernel
Cc: Linux-imx
The cpufreq-dt driver allows cpufreq driver enabled without valid
regulator assigned, however, all i.MX platforms using cpufreq-dt
driver now require valid regulator, add "cpu-supply" property check
to avoid i.MX platforms' cpufreq enabled without valid regulator
and lead to system unstable.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
drivers/cpufreq/imx-cpufreq-dt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c
index 6cb8193..0e29d88 100644
--- a/drivers/cpufreq/imx-cpufreq-dt.c
+++ b/drivers/cpufreq/imx-cpufreq-dt.c
@@ -31,6 +31,9 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
int speed_grade, mkt_segment;
int ret;
+ if (!of_find_property(cpu_dev->of_node, "cpu-supply", NULL))
+ return -ENODEV;
+
ret = nvmem_cell_read_u32(cpu_dev, "speed_grade", &cell_value);
if (ret)
return ret;
--
2.7.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cpufreq: imx-cpufreq-dt: Add "cpu-supply" property check
2020-02-17 9:42 [PATCH] cpufreq: imx-cpufreq-dt: Add "cpu-supply" property check Anson Huang
@ 2020-02-17 10:46 ` Viresh Kumar
0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2020-02-17 10:46 UTC (permalink / raw)
To: Anson Huang
Cc: linux-pm, festevam, s.hauer, rjw, linux-kernel, Linux-imx,
kernel, shawnguo, linux-arm-kernel
On 17-02-20, 17:42, Anson Huang wrote:
> The cpufreq-dt driver allows cpufreq driver enabled without valid
> regulator assigned, however, all i.MX platforms using cpufreq-dt
> driver now require valid regulator, add "cpu-supply" property check
> to avoid i.MX platforms' cpufreq enabled without valid regulator
> and lead to system unstable.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> drivers/cpufreq/imx-cpufreq-dt.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c
> index 6cb8193..0e29d88 100644
> --- a/drivers/cpufreq/imx-cpufreq-dt.c
> +++ b/drivers/cpufreq/imx-cpufreq-dt.c
> @@ -31,6 +31,9 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
> int speed_grade, mkt_segment;
> int ret;
>
> + if (!of_find_property(cpu_dev->of_node, "cpu-supply", NULL))
> + return -ENODEV;
> +
> ret = nvmem_cell_read_u32(cpu_dev, "speed_grade", &cell_value);
> if (ret)
> return ret;
Applied. Thanks.
--
viresh
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-17 10:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-17 9:42 [PATCH] cpufreq: imx-cpufreq-dt: Add "cpu-supply" property check Anson Huang
2020-02-17 10:46 ` Viresh Kumar
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).