]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
soc/tegra: regulators: Fix locking up when voltage-spread is out of range
authorDmitry Osipenko <digetx@gmail.com>
Tue, 2 Mar 2021 13:18:00 +0000 (16:18 +0300)
committerKelsey Skunberg <kelsey.skunberg@canonical.com>
Mon, 24 May 2021 23:46:12 +0000 (17:46 -0600)
BugLink: https://bugs.launchpad.net/bugs/1929455
commit ef85bb582c41524e9e68dfdbde48e519dac4ab3d upstream.

Fix voltage coupler lockup which happens when voltage-spread is out
of range due to a bug in the code. The max-spread requirement shall be
accounted when CPU regulator doesn't have consumers. This problem is
observed on Tegra30 Ouya game console once system-wide DVFS is enabled
in a device-tree.

Fixes: 783807436f36 ("soc/tegra: regulators: Add regulators coupler for Tegra30")
Cc: stable@vger.kernel.org
Reported-by: Peter Geis <pgwipeout@gmail.com>
Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/soc/tegra/regulators-tegra30.c

index 7f21f31de09d6822b82569461264c7de342c749d..0e776b20f6252fe08da16a7ffe0d50f40e04c927 100644 (file)
@@ -178,7 +178,7 @@ static int tegra30_voltage_update(struct tegra_regulator_coupler *tegra,
         * survive the voltage drop if it's running on a higher frequency.
         */
        if (!cpu_min_uV_consumers)
-               cpu_min_uV = cpu_uV;
+               cpu_min_uV = max(cpu_uV, cpu_min_uV);
 
        /*
         * Bootloader shall set up voltages correctly, but if it