]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
clk: mvebu: armada-37xx-periph: Fix workaround for switching from L1 to L0
authorPali Rohár <pali@kernel.org>
Thu, 8 Apr 2021 11:42:19 +0000 (13:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:49:47 +0000 (10:49 +0200)
commit3e9213bf2b991b8d4aad74ec31ecdcb5ed02b2e1
tree1bd1b6c38969048233b543c3ed80785a79c16703
parent56e7090ff89ae09dfa62cd795732ae4116b80c9c
clk: mvebu: armada-37xx-periph: Fix workaround for switching from L1 to L0

[ Upstream commit e93033aff684641f71a436ca7a9d2a742126baaf ]

When CPU frequency is at 250 MHz and set_rate() is called with 500 MHz (L1)
quickly followed by a call with 1 GHz (L0), the CPU does not necessarily
stay in L1 for at least 20ms as is required by Marvell errata.

This situation happens frequently with the ondemand cpufreq governor and
can be also reproduced with userspace governor. In most cases it causes CPU
to crash.

This change fixes the above issue and ensures that the CPU always stays in
L1 for at least 20ms when switching from any state to L0.

Signed-off-by: Marek Behún <kabel@kernel.org>
Signed-off-by: Pali Rohár <pali@kernel.org>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Acked-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Anders Trier Olesen <anders.trier.olesen@gmail.com>
Tested-by: Philip Soares <philips@netisense.com>
Fixes: 61c40f35f5cd ("clk: mvebu: armada-37xx-periph: Fix switching CPU rate from 300Mhz to 1.2GHz")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/mvebu/armada-37xx-periph.c